Skip to content

add head metrics gauge #286

add head metrics gauge

add head metrics gauge #286

Workflow file for this run

name: CI
on:
push:
branches:
- main
tags:
- 'v?[0-9]+.[0-9]+.[0-9]+**' # Matches release tags of the form major.minor.patch, e.g. 1.2.1
pull_request:
jobs:
assemble:
runs-on: ubuntu-latest
env:
GRADLE_OPTS: -Dorg.gradle.daemon=false -Dorg.gradle.parallel=true -Dorg.gradle.workers.max=2
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: 17
distribution: 'adopt'
- name: Cache Gradle dependencies
uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/gradle/versions.gradle') }}-${{ github.sha }}
restore-keys: |
${{ runner.os }}-gradle-${{ hashFiles('**/gradle/versions.gradle') }}
${{ runner.os }}-gradle-
- name: Assemble
run: ./gradlew --no-daemon clean compileJava compileTestJava assemble
- name: Upload workspace
uses: actions/upload-artifact@v3
with:
name: workspace
path: |
./
!./.git/**
unitTests:
needs: assemble
runs-on: ubuntu-latest
env:
GRADLE_OPTS: -Dorg.gradle.daemon=false -Dorg.gradle.parallel=true -Dorg.gradle.workers.max=2
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: 17
distribution: 'adopt'
- name: Cache Gradle dependencies
uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/gradle/versions.gradle') }}-${{ github.sha }}
restore-keys: |
${{ runner.os }}-gradle-${{ hashFiles('**/gradle/versions.gradle') }}
${{ runner.os }}-gradle-
- name: Download workspace
uses: actions/download-artifact@v3
with:
name: workspace
- name: Build
run: ./gradlew --no-daemon build
- name: Store distribution artifacts
uses: actions/upload-artifact@v3
with:
name: distributions
path: build/distributions
build:
runs-on: ubuntu-latest
env:
architecture: "amd64"
GRADLE_OPTS: "-Dorg.gradle.daemon=false -Dorg.gradle.parallel=true -Dorg.gradle.workers.max=2"
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup JDK
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'adopt'
- name: Check Dockerfile syntax
run: |
docker run --rm -i hadolint/hadolint < docker/openjdk-17/Dockerfile
docker run --rm -i hadolint/hadolint < docker/openjdk-17-debug/Dockerfile
docker run --rm -i hadolint/hadolint < docker/openjdk-latest/Dockerfile
- name: Build Docker Image
run: |
./gradlew --no-daemon dockerDist
- name: Test Docker Image
run: |
mkdir -p docker/reports
curl -L https://github.com/goss-org/goss/releases/download/v0.3.22/goss-linux-amd64 -o ./docker/tests/goss-linux-amd64
./gradlew --no-daemon dockerTest
buildArm64:
runs-on: [ ARM64, Linux, self-hosted ]
strategy:
matrix:
architecture: [ arm64 ]
env:
architecture: "arm64"
GRADLE_OPTS: "-Dorg.gradle.daemon=false -Dorg.gradle.parallel=true -Dorg.gradle.workers.max=2"
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup JDK
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'adopt'
architecture: aarch64
- name: Check Dockerfile syntax
run: |
docker run --rm -i hadolint/hadolint < docker/openjdk-17/Dockerfile
docker run --rm -i hadolint/hadolint < docker/openjdk-17-debug/Dockerfile
docker run --rm -i hadolint/hadolint < docker/openjdk-latest/Dockerfile
docker run --rm -i hadolint/hadolint < docker/graalvm/Dockerfile
- name: Build Docker Image
run: |
./gradlew --no-daemon dockerDist
- name: Test Docker Image
run: |
mkdir -p docker/reports
curl -L https://github.com/goss-org/goss/releases/download/v0.3.22/goss-linux-arm64 -o ./docker/tests/goss-linux-arm64
./gradlew --no-daemon dockerTest
publishDocker:
needs: build
if: github.event_name == 'push'
runs-on: ubuntu-latest
env:
architecture: "amd64"
GRADLE_OPTS: "-Dorg.gradle.daemon=false -Dorg.gradle.parallel=true -Dorg.gradle.workers.max=2"
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup JDK
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'adopt'
- name: Login to Docker Hub for self hosted
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USER_RW }}
password: ${{ secrets.DOCKER_PAT_RW }}
- name: Publish Docker Image
run: |
./gradlew --no-daemon dockerUpload
publishDockerArm64:
needs: buildArm64
if: github.event_name == 'push'
runs-on: [ ARM64, Linux, self-hosted ]
env:
architecture: "arm64"
GRADLE_OPTS: "-Dorg.gradle.daemon=false -Dorg.gradle.parallel=true -Dorg.gradle.workers.max=2"
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup JDK
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'adopt'
architecture: aarch64
- name: Login to Docker Hub for self hosted
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USER_RW }}
password: ${{ secrets.DOCKER_PAT_RW }}
- name: Publish Docker Image
run: |
./gradlew --no-daemon dockerUpload
publishManifest:
needs: [ publishDocker, publishDockerArm64 ]
if: github.event_name == 'push'
runs-on: ubuntu-latest
env:
architecture: "amd64"
GRADLE_OPTS: "-Dorg.gradle.daemon=false -Dorg.gradle.parallel=true -Dorg.gradle.workers.max=2"
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup JDK
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'adopt'
- name: Login to Docker Hub for self hosted
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USER_RW }}
password: ${{ secrets.DOCKER_PAT_RW }}
- name: Publish Multi-arch Docker Image
run: |
./gradlew --no-daemon dockerManifest
draftRelease:
if: startsWith(github.ref, 'refs/tags/')
needs: publishManifest
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Get date
id: date
run: echo "::set-output name=date::$(date +'%Y-%m-%d')"
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
body: |
## Release ${{ github.ref }}
### Release Date: ${{ steps.date.outputs.date }}
### Additions and Improvements
### Bug Fixes
draft: true
prerelease: false