Skip to content

build(deps): bump actions/checkout from 4.2.2 to 6.0.0 #710

build(deps): bump actions/checkout from 4.2.2 to 6.0.0

build(deps): bump actions/checkout from 4.2.2 to 6.0.0 #710

Workflow file for this run

name: main
on:
push:
branches:
- main
tags:
- 'v*'
pull_request:
branches:
- '*'
jobs:
build:
name: Build
runs-on: ubuntu-latest
services:
postgres:
image: postgres:14-alpine
env:
POSTGRES_DB: auditum_db
POSTGRES_USER: user
POSTGRES_PASSWORD: pass
options: >-
--health-cmd "pg_isready -U user"
--health-interval 1s
--health-timeout 10s
--health-retries 10
ports:
- 5432:5432
steps:
- name: Checkout
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
- name: Setup Go
uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5.3.0
with:
go-version-file: 'go.mod'
- name: Download dependencies
run: |
go mod download
- name: Run unit tests
run: |
go test -v -race -coverprofile=coverage.txt -covermode=atomic $(go list ./...)
- name: Run linter
uses: golangci/golangci-lint-action@2226d7cb06a077cd73e56eedd38eecad18e5d837 # v6.5.0
with:
version: v1.59.1
args: --verbose
- name: Build
run: |
go build -v -o ./bin/auditum ./cmd/auditum
- name: Run integration tests
env:
POSTGRES_HOST: 127.0.0.1
POSTGRES_PORT: 5432
POSTGRES_DBNAME: auditum_db
POSTGRES_USER: user
POSTGRES_PASSWORD: pass
POSTGRES_SSL_MODE: disable
run: |
go test \
-tags "integration postgres" \
-v \
-p 1 \
-count 1 \
./internal/sql/... \
-run "TestIntegration"
go test \
-tags "integration sqlite" \
-v \
-p 1 \
-count 1 \
./internal/sql/... \
-run "TestIntegration"
docker:
name: Docker
runs-on: ubuntu-latest
needs:
- build
permissions:
contents: read
packages: write
env:
IMAGE_REGISTRY_GITHUB: ghcr.io
IMAGE_NAME_GITHUB: ${{ github.repository }}
IMAGE_NAME_DOCKERHUB_AUDITUMIO: auditumio/auditum
# For PR, we only build for AMD64, just to be sure that Docker build works.
# For main branch and tags we also build for ARM64.
# Note that building for ARM64 is very slow.
IMAGE_PLATFORMS: |
linux/amd64
${{ github.event_name != 'pull_request' && 'linux/arm64' || '' }}
steps:
- name: Checkout
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
- name: Setup Go
uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5.3.0
with:
go-version-file: 'go.mod'
- name: Download dependencies
run: |
go mod download
go mod vendor
- name: Extract Docker image metadata
id: docker_meta
uses: docker/metadata-action@369eb591f429131d6889c46b94e711f089e6ca96 # v5.6.1
with:
images: |
${{ env.IMAGE_NAME_DOCKERHUB_AUDITUMIO }}
${{ env.IMAGE_REGISTRY_GITHUB }}/${{ env.IMAGE_NAME_GITHUB }}
tags: |
type=ref,event=pr
type=ref,event=branch,enable={{ is_default_branch }}
type=semver,pattern={{ version }}
- name: Login to Docker Hub for auditumio
uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0
with:
username: auditumio
password: ${{ secrets.DOCKERHUB_AUDITUMIO_TOKEN }}
if: github.event_name != 'pull_request'
- name: Login to GitHub Container Registry
uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0
with:
registry: ${{ env.IMAGE_REGISTRY_GITHUB }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
if: github.event_name != 'pull_request'
# Used for arm images.
- name: Set up QEMU
uses: docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392 # v3.6.0
with:
platforms: ${{ env.IMAGE_PLATFORMS }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1
- name: Build and push Docker image
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0
with:
context: .
platforms: ${{ env.IMAGE_PLATFORMS }}
tags: ${{ steps.docker_meta.outputs.tags }}
labels: ${{ steps.docker_meta.outputs.labels }}
push: ${{ github.event_name != 'pull_request' }}
goreleaser:
name: GoReleaser
runs-on: ubuntu-latest
needs:
- build
permissions:
contents: write
if: startsWith(github.ref, 'refs/tags/')
steps:
- name: Checkout
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
with:
fetch-depth: 0
- name: Setup Go
uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5.3.0
with:
go-version-file: 'go.mod'
- name: Download dependencies
run: |
go mod download
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@90a3faa9d0182683851fbfa97ca1a2cb983bfca3 # v6.2.1
with:
version: latest
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GORELEASER_PREVIOUS_TAG: ""