35 lines
948 B
YAML
35 lines
948 B
YAML
name: "Test"
|
|
on:
|
|
pull_request:
|
|
push:
|
|
jobs:
|
|
test-nix:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
|
|
with:
|
|
# Nix Flakes doesn't work on shallow clones
|
|
fetch-depth: 0
|
|
- name: Install Nix
|
|
uses: DeterminateSystems/nix-installer-action@v16
|
|
- uses: DeterminateSystems/magic-nix-cache-action@main
|
|
- run: nix-build
|
|
test:
|
|
strategy:
|
|
matrix:
|
|
go-version: [ 1.22.x ]
|
|
os: [ ubuntu-latest ]
|
|
runs-on: ${{ matrix.os }}
|
|
steps:
|
|
- name: Install Go
|
|
uses: actions/setup-go@v5
|
|
with:
|
|
go-version: ${{ matrix.go-version }}
|
|
- name: Checkout code
|
|
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
|
|
- name: Format
|
|
run: if [ "$(gofmt -s -l . | wc -l)" -gt 0 ]; then exit 1; fi
|
|
if: matrix.os == 'ubuntu-latest'
|
|
- name: Test
|
|
run: go test -race ./...
|