Skip to content

chore(deps): bump actions/checkout from 6.0.2 to 6.0.3 (#33) #77

chore(deps): bump actions/checkout from 6.0.2 to 6.0.3 (#33)

chore(deps): bump actions/checkout from 6.0.2 to 6.0.3 (#33) #77

Workflow file for this run

name: CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
# Cancel in-progress runs when new commits are pushed
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
pull-requests: read
jobs:
# Detect what files changed to skip tests on doc-only changes
changes:
name: Detect Changes
runs-on: ubuntu-latest
outputs:
code: ${{ steps.filter.outputs.code }}
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
- uses: dorny/paths-filter@fbd0ab8f3e69293af611ebaee6363fc25e6d187d # v4
id: filter
with:
filters: |
code:
- '**/*.go'
- 'go.mod'
- 'go.sum'
- '.github/workflows/**'
- '.golangci.yml'
- 'Taskfile.yml'
test:
needs: changes
if: needs.changes.outputs.code == 'true' || github.event_name != 'pull_request'
timeout-minutes: 15
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
- name: Set up Go
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6
with:
go-version-file: go.mod
cache: true
- name: Download dependencies
run: go mod download
- name: Run tests
run: go test -v -race -timeout=10m ./...
lint:
needs: changes
if: needs.changes.outputs.code == 'true' || github.event_name != 'pull_request'
timeout-minutes: 10
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
- name: Set up Go
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6
with:
go-version-file: go.mod
cache: true
- name: Run golangci-lint
uses: golangci/golangci-lint-action@82606bf257cbaff209d206a39f5134f0cfbfd2ee # v9
with:
version: latest
args: --timeout 5m
- name: Install govulncheck
run: go install golang.org/x/vuln/cmd/govulncheck@latest
- name: Run govulncheck
run: govulncheck ./...
build:
needs: changes
if: needs.changes.outputs.code == 'true' || github.event_name != 'pull_request'
timeout-minutes: 10
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
- name: Set up Go
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6
with:
go-version-file: go.mod
cache: true
- name: Build
run: go build -v ./...
- name: Cross-compile check
run: |
echo "Cross-compiling for Linux (amd64)..."
GOOS=linux GOARCH=amd64 go build -v ./...
echo "Cross-compiling for Linux (arm64)..."
GOOS=linux GOARCH=arm64 go build -v ./...
echo "Cross-compiling for Windows (amd64)..."
GOOS=windows GOARCH=amd64 go build -v ./...
echo "Cross-compiling for macOS (amd64)..."
GOOS=darwin GOARCH=amd64 go build -v ./...
echo "Cross-compiling for macOS (arm64)..."
GOOS=darwin GOARCH=arm64 go build -v ./...
coverage:
needs: changes
if: needs.changes.outputs.code == 'true' || github.event_name != 'pull_request'
timeout-minutes: 15
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
- name: Set up Go
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6
with:
go-version-file: go.mod
cache: true
- name: Run tests with coverage
run: go test -race -coverprofile=coverage.txt -covermode=atomic ./...
- name: Upload coverage to Codecov
uses: codecov/codecov-action@e79a6962e0d4c0c17b229090214935d2e33f8354 # v6
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.txt
flags: unittests
fail_ci_if_error: false