build(deps): bump library/golang from 1.23.5 to 1.24rc2 #1669
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.22" | |
- "1.23" | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
with: | |
show-progress: false | |
- name: Use golang ${{ matrix.go_version }} | |
uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5.3.0 | |
with: | |
go-version: ${{ matrix.go_version }} | |
check-latest: true | |
- name: Go get dependencies | |
run: go get -v -t -d ./... | |
- name: Run tests | |
run: make coverage | |
- name: Send the coverage output | |
uses: coverallsapp/github-action@648a8eb78e6d50909eff900e4ec85cab4524a45b # v2.3.6 | |
with: | |
flag-name: go-${{ join(matrix.*, '-') }} | |
parallel: true | |
file: coverage.out | |
post-tests: | |
needs: tests | |
runs-on: ubuntu-latest | |
steps: | |
- name: Coveralls Finished | |
uses: coverallsapp/github-action@648a8eb78e6d50909eff900e4ec85cab4524a45b # v2.3.6 | |
with: | |
parallel-finished: true | |
test-latest: | |
name: Test latest | |
runs-on: ubuntu-latest | |
continue-on-error: true | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
with: | |
show-progress: false | |
- name: Use golang stable | |
uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5.3.0 | |
with: | |
go-version: stable | |
check-latest: true | |
- name: Go get dependencies | |
run: go get -v -t -d ./... | |
- name: Run tests | |
run: make coverage | |
bench: | |
name: Benchmark | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
with: | |
show-progress: false | |
- name: Setup golang | |
uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5.3.0 | |
with: | |
go-version-file: go.mod | |
check-latest: true | |
- name: Run benchmark | |
run: make bench | tee output.txt; exit ${PIPESTATUS[0]} | |
- name: Download previous benchmark data | |
uses: actions/cache/restore@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0 | |
with: | |
path: ./cache | |
key: ${{ runner.os }}-benchmark | |
- name: Store benchmark result | |
uses: benchmark-action/github-action-benchmark@d48d326b4ca9ba73ca0cd0d59f108f9e02a381c7 # v1.20.4 | |
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@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0 | |
with: | |
path: ./cache | |
key: ${{ runner.os }}-benchmark | |
build: | |
name: Build Docker Images | |
runs-on: ubuntu-latest | |
if: ${{ startsWith(github.ref, 'refs/tags/') || github.ref == format('refs/heads/{0}', github.event.repository.default_branch) }} | |
permissions: | |
actions: read | |
contents: write | |
packages: write | |
id-token: write | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
with: | |
show-progress: false | |
- name: Docker Login to GitHub Repository | |
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Docker Login to DockerHub | |
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0 | |
with: | |
username: ${{ secrets.BOT_DOCKER_USERNAME }} | |
password: ${{ secrets.BOT_DOCKER_TOKEN }} | |
- name: Login to Mia registry | |
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0 | |
with: | |
registry: nexus.mia-platform.eu | |
username: ${{ secrets.MIA_PLATFORM_DOCKER_REGISTRY_USERNAME }} | |
password: ${{ secrets.MIA_PLATFORM_DOCKER_REGISTRY_PASSWORD }} | |
- name: Install Cosign | |
uses: sigstore/cosign-installer@dc72c7d5c4d10cd6bcb8cf6e3fd625a9e5e537da # v3.7.0 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@53851d14592bedcffcf25ea515637cff71ef929a # v3.3.0 | |
with: | |
platforms: amd64,arm64 | |
- name: Configure docker metadata | |
id: meta | |
uses: docker/metadata-action@369eb591f429131d6889c46b94e711f089e6ca96 # v5.6.1 | |
env: | |
DOCKER_METADATA_ANNOTATIONS_LEVELS: manifest,index | |
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 | |
annotations: | | |
org.opencontainers.image.documentation=https://rond-authz.io | |
org.opencontainers.image.vendor=rond authz | |
- name: Setup Buildx Context | |
uses: docker/setup-buildx-action@6524bf65af31da8d45b59e8c27de4bd072b392f5 # v3.8.0 | |
id: buildx | |
with: | |
platforms: linux/amd64,linux/arm64 | |
- name: Build and push | |
id: docker-build | |
uses: docker/build-push-action@ca877d9245402d1537745e0e356eab47c3520991 # v6.13.0 | |
with: | |
context: . | |
push: true | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} | |
annotations: ${{ steps.meta.output.annotations }} | |
platforms: ${{ steps.buildx.outputs.platforms }} | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |
- name: Generate SBOM | |
uses: anchore/sbom-action@f325610c9f50a54015d37c8d16cb3b0e2c8f4de0 # v0.18.0 | |
if: github.ref_type == 'tag' | |
with: | |
artifact-name: rond-authz-sbom.spdx.json | |
output-file: ./rond-authz-sbom.spdx.json | |
image: nexus.mia-platform.eu/rond-authz/rond:${{ steps.meta.output.version.main }} | |
upload-release-assets: true | |
- name: GCP Auth | |
uses: google-github-actions/auth@6fc4af4b145ae7821d527454aa9bd537d1f2dc5f # v2.1.7 | |
if: github.ref_type == 'tag' | |
with: | |
project_id: ${{ secrets.MIA_PLATFORM_KMS_PROJECT }} | |
workload_identity_provider: ${{ secrets.MIA_PLATFORM_GCP_WIF }} | |
create_credentials_file: true | |
- name: Sign public images with Mia-Platform key | |
if: github.ref_type == 'tag' | |
run: | | |
for tag in ${TAGS}; do | |
image="${tag}@${DIGEST}" | |
cosign sign --recursive --yes --key "${COSIGN_PRIVATE_KEY}" "${image}" | |
cosign attest --recursive --yes --key "${COSIGN_PRIVATE_KEY}" --predicate "rond-authz-sbom.spdx.json" --type="spdxjson" "${image}" | |
done | |
env: | |
TAGS: | | |
ghcr.io/rond-authz/rond:${{ steps.meta.output.version.main }} | |
docker.io/rondauthz/rond:${{ steps.meta.output.version.main }} | |
nexus.mia-platform.eu/rond-authz/rond:${{ steps.meta.output.version.main }} | |
DIGEST: ${{ steps.docker-build.outputs.digest }} | |
COSIGN_PRIVATE_KEY: ${{ secrets.MIA_PLATFORM_COSIGN_KEY }} |