Skip to content

fix(ghaction): Use SHA256SUMS filename instead of checksums.txt (… #1797

fix(ghaction): Use SHA256SUMS filename instead of checksums.txt (…

fix(ghaction): Use SHA256SUMS filename instead of checksums.txt (… #1797

Workflow file for this run

name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true
jobs:
test:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
with:
go-version: '1.25'
- name: Build
run: go build ./...
- name: Test with race detection (Linux/macOS)
if: matrix.os != 'windows-latest'
run: go test -race -shuffle=on -tags integration ./...
- name: Test (Windows)
if: matrix.os == 'windows-latest'
shell: pwsh
run: |
# go test on Windows can exit 1 due to temp .exe cleanup
# ("go: remove ...\.exe: Access is denied") even when all
# tests pass. Only suppress that specific pattern.
go test -shuffle=on -tags integration ./... 2>&1 | Tee-Object -Variable testOut
$exitCode = $LASTEXITCODE
if ($exitCode -ne 0) {
$failed = $testOut | Select-String "^FAIL\s"
if ($failed) {
Write-Host "Tests failed:"
Write-Host ($failed -join "`n")
exit 1
}
$cleanup = $testOut | Select-String "go: remove .+\.exe: Access is denied"
if (-not $cleanup) {
Write-Host "go test failed with unknown error"
exit $exitCode
}
Write-Host "All tests passed (ignoring temp .exe cleanup error)"
exit 0
}
- name: Build with CGO disabled
run: go build ./...
env:
CGO_ENABLED: 0
coverage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
with:
go-version: '1.25'
- name: Test with coverage
# -p 1 serializes package execution to avoid ROBOREV_DATA_DIR race conditions
# between tests in different packages that modify this environment variable
run: go test -race -shuffle=on -tags integration -p 1 -coverprofile=coverage.out ./...
- name: Upload coverage
uses: codecov/codecov-action@57e3a136b779b570ffcdbf80b3bdc90e7fab3de2 # v6.0.0
with:
file: coverage.out
continue-on-error: true
integration:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:16-alpine
env:
POSTGRES_USER: roborev_test
POSTGRES_PASSWORD: roborev_test_password
POSTGRES_DB: roborev_test
ports:
- 5433:5432
options: >-
--health-cmd "pg_isready -U roborev_test -d roborev_test"
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
with:
go-version: '1.25'
- name: Run integration tests
run: go test -shuffle=on -tags=postgres -v ./internal/storage/... -run Integration
env:
TEST_POSTGRES_URL: postgres://roborev_test:roborev_test_password@localhost:5433/roborev_test
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
with:
go-version: '1.25'
- name: golangci-lint
uses: golangci/golangci-lint-action@1e7e51e771db61008b38414a730f564565cf7c20 # v9.2.0
with:
version: v2.10.1
nix:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: cachix/install-nix-action@96951a368ba55167b55f1c916f7d416bac6505fe # v31.10.3
with:
nix_path: nixpkgs=channel:nixos-unstable
- name: Check flake
run: nix flake check
- name: Build package
run: nix build
- name: Verify binaries
run: ./result/bin/roborev version
- name: Verify nix apps
run: nix run .#roborev -- version