Files
netrunner/.github/workflows/build-test.yml
T
Zach Kelling 301fa41eb5 fix: update CI for golangci-lint v2 and CGO-free builds
- Update golangci-lint from v1.49 to v2.1.6 in lint.sh
- Add GOWORK=off to workflow env for workspace isolation
- Add CGO_ENABLED=0 to unit tests (avoids luxfi/accel C headers)
- Update GitHub Actions: checkout v4, setup-go v5, upload-artifact v4
- Update OS matrix: ubuntu-22.04, macos-14
- Run go mod tidy for updated checksums
2026-01-28 10:01:14 -08:00

71 lines
1.8 KiB
YAML

name: Build + test
on:
push:
branches:
- main
pull_request:
env:
GOWORK: off
jobs:
lint_test:
name: Lint tests
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.25.5'
check-latest: true
- name: Run static analysis tests
shell: bash
run: scripts/lint.sh
unit_test:
name: Unit tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '1.25.5'
- run: go test -v -timeout 10m ./...
env:
CGO_ENABLED: "0"
CGO_CFLAGS: "-O -D__BLST_PORTABLE__" # Set the CGO flags to use the portable version of BLST
e2e_test:
name: e2e tests
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-22.04, macos-14]
steps:
- name: Git checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.25.5'
- name: Run e2e tests
shell: bash
run: scripts/tests.e2e.sh
- name: Set ubuntu tmpdir into actions env
if: always() && startsWith(matrix.os, 'ubuntu')
run: echo "ANR_TMPDIR=/tmp/" >> $GITHUB_ENV
- name: Set macos tmpdir into actions env
if: always() && startsWith(matrix.os, 'macos')
run: echo "ANR_TMPDIR=$TMPDIR" >> $GITHUB_ENV
- name: "Upload Artifact"
if: always()
uses: actions/upload-artifact@v4
with:
name: anr-logs-${{ matrix.os }}
path: |
${{ env.ANR_TMPDIR }}/network-runner-root-data*
retention-days: 5