Skip to content

Bump the actions-deps group with 7 updates #14

Bump the actions-deps group with 7 updates

Bump the actions-deps group with 7 updates #14

Workflow file for this run

name: CI
on:
push:
branches: [main]
tags: ['*']
pull_request:
workflow_dispatch:
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ !contains(github.ref, 'main') && !startsWith(github.ref, 'refs/tags/') }}
jobs:
test:
name: Build, vet, test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
with:
go-version-file: go.mod
cache: true
- name: Build
run: go build ./...
- name: Vet
run: go vet ./...
- name: Check formatting
run: |
fmt_out="$(gofmt -l .)"
if [ -n "$fmt_out" ]; then
echo "The following files are not gofmt-formatted:"
echo "$fmt_out"
exit 1
fi
- name: Test
run: go test -race -coverprofile=coverage.out ./...
- name: Upload coverage
uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0
with:
files: coverage.out
continue-on-error: true
docker:
name: Docker build
needs: test
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@bb05f3f5519dd87d3ba754cc423b652a5edd6d2c # v4.2.0
- name: Log in to GitHub Container Registry
if: github.event_name != 'pull_request'
uses: docker/login-action@af1e73f918a031802d376d3c8bbc3fe56130a9b0 # v4.4.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels)
id: meta
uses: docker/metadata-action@dc802804100637a589fabce1cb79ff13a1411302 # v6.2.0
with:
images: |
ghcr.io/${{ github.repository }}
flavor: |
latest=${{ startsWith(github.ref, 'refs/tags/') && !endsWith(github.ref, '-rc') }}
tags: |
type=edge,branch=main
type=ref,event=branch
type=ref,event=tag
- name: Build image
uses: docker/build-push-action@53b7df96c91f9c12dcc8a07bcb9ccacbed38856a # v7.3.0
with:
context: .
push: false
platforms: linux/amd64,linux/arm64
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha,scope=image-geo-decoding
cache-to: type=gha,scope=image-geo-decoding,mode=max
- name: Build and push image
if: >
(github.ref == 'refs/heads/main' && github.event_name == 'push') ||
(startsWith(github.ref, 'refs/tags/') && github.event_name == 'push') ||
(github.event_name == 'workflow_dispatch')
uses: docker/build-push-action@53b7df96c91f9c12dcc8a07bcb9ccacbed38856a # v7.3.0
with:
context: .
push: true
platforms: linux/amd64,linux/arm64
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha,scope=image-geo-decoding
cache-to: type=gha,scope=image-geo-decoding,mode=max