chore(deps): bump github.com/prometheus/client_golang #1300
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Test and build | |
on: | |
pull_request: | |
types: [opened] | |
push: | |
jobs: | |
tests: | |
name: Test | |
strategy: | |
matrix: | |
go_version: ['1.20', '1.21', '1.22'] | |
os: [ubuntu-latest] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Use golang ${{ matrix.go_version }} | |
uses: actions/setup-go@v5 | |
with: | |
go-version: ${{ matrix.go_version }} | |
- name: Go version | |
run: go version | |
- name: Go get dependencies | |
run: go get -v -t -d ./... | |
- name: Run tests | |
run: make coverage | |
- name: Send the coverage output | |
uses: shogo82148/actions-goveralls@v1 | |
with: | |
path-to-profile: coverage.out | |
flag-name: Go-${{ matrix.go_version }} | |
parallel: true | |
post-tests: | |
runs-on: ubuntu-latest | |
needs: tests | |
steps: | |
- name: Close coverage report | |
uses: shogo82148/actions-goveralls@v1 | |
with: | |
parallel-finished: true | |
test-latest: | |
name: Test latest | |
strategy: | |
matrix: | |
os: [ubuntu-latest] | |
runs-on: ${{ matrix.os }} | |
continue-on-error: true | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Use golang latest | |
uses: actions/setup-go@v5 | |
with: | |
go-version: 'stable' | |
check-latest: true | |
- name: Go version | |
run: go version | |
- name: Go get dependencies | |
run: go get -v -t -d ./... | |
- name: Run tests | |
run: make coverage | |
bench: | |
name: Benchmark | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
go_version: ['1.22'] | |
os: [ubuntu-latest] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-go@v5 | |
with: | |
go-version: ${{ matrix.go_version }} | |
- name: Run benchmark | |
run: make bench | tee output.txt; exit ${PIPESTATUS[0]} | |
- name: Download previous benchmark data | |
uses: actions/cache/restore@v4 | |
with: | |
path: ./cache | |
key: ${{ runner.os }}-benchmark | |
- name: Store benchmark result | |
uses: benchmark-action/github-action-benchmark@v1 | |
with: | |
tool: 'go' | |
output-file-path: ./output.txt | |
external-data-json-path: ./cache/benchmark-data.json | |
comment-on-alert: false | |
fail-on-alert: true | |
# only execute this step when cache was restored | |
# do not fail hard here, as the key might not exist | |
- name: Clear cache | |
shell: bash | |
if: ${{ github.ref == format('refs/heads/{0}', github.event.repository.default_branch) }} | |
env: | |
GH_TOKEN: ${{ github.token }} | |
run: | | |
gh extension install actions/gh-actions-cache | |
gh actions-cache delete '${{ runner.os }}-benchmark' --confirm | |
continue-on-error: true | |
- name: Update benchmark data | |
if: ${{ github.ref == format('refs/heads/{0}', github.event.repository.default_branch) }} | |
uses: actions/cache/save@v4 | |
with: | |
path: ./cache | |
key: ${{ runner.os }}-benchmark | |
build: | |
name: Build docker image | |
needs: tests | |
runs-on: ubuntu-latest | |
if: ${{ startsWith(github.ref, 'refs/tags/') || github.ref == format('refs/heads/{0}', github.event.repository.default_branch) }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Configure docker metadata | |
id: meta | |
uses: docker/metadata-action@v5 | |
with: | |
images: | | |
ghcr.io/rond-authz/rond | |
docker.io/rondauthz/rond | |
nexus.mia-platform.eu/rond-authz/rond | |
tags: | | |
type=ref,event=branch | |
type=semver,pattern={{version}} | |
type=semver,pattern={{major}}.{{minor}} | |
type=semver,pattern={{major}} | |
labels: | | |
org.opencontainers.image.documentation=https://rond-authz.io | |
org.opencontainers.image.vendor=rond authz | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Docker Login to ghcr.io | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Docker Login to DockerHub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.BOT_DOCKER_USERNAME }} | |
password: ${{ secrets.BOT_DOCKER_TOKEN }} | |
- name: Docker Login to Mia-Platform Registry | |
uses: docker/login-action@v3 | |
with: | |
registry: nexus.mia-platform.eu | |
username: ${{ secrets.MIA_PLATFORM_DOCKER_REGISTRY_USERNAME }} | |
password: ${{ secrets.MIA_PLATFORM_DOCKER_REGISTRY_PASSWORD }} | |
- name: Prepare build cache | |
uses: actions/cache@v4 | |
with: | |
path: /tmp/.buildx-cache | |
key: ${{ runner.os }}-buildx-${{ github.sha }} | |
restore-keys: | | |
${{ runner.os }}-buildx- | |
- name: Build and push | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
platforms: linux/amd64,linux/arm64 | |
push: true | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} | |
cache-from: type=local,src=/tmp/.buildx-cache | |
cache-to: type=local,dest=/tmp/.buildx-cache | |
build-args: | | |
BUILDTIME=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.created'] }} | |
VERSION=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.version'] }} |