2020-11-18 12:51:33 +00:00
|
|
|
name: "Test"
|
|
|
|
on:
|
|
|
|
pull_request:
|
|
|
|
push:
|
|
|
|
jobs:
|
|
|
|
test-nix:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2024-10-23 16:14:40 +00:00
|
|
|
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
|
2020-11-18 12:51:33 +00:00
|
|
|
with:
|
|
|
|
# Nix Flakes doesn't work on shallow clones
|
|
|
|
fetch-depth: 0
|
2023-05-28 18:59:10 +00:00
|
|
|
- name: Install Nix
|
2024-11-14 20:02:05 +00:00
|
|
|
uses: DeterminateSystems/nix-installer-action@v16
|
2023-07-02 23:27:10 +00:00
|
|
|
- uses: DeterminateSystems/magic-nix-cache-action@main
|
2020-11-18 12:51:33 +00:00
|
|
|
- run: nix-build
|
|
|
|
test:
|
|
|
|
strategy:
|
|
|
|
matrix:
|
2024-07-02 11:33:19 +00:00
|
|
|
go-version: [ 1.22.x ]
|
2020-11-18 12:51:33 +00:00
|
|
|
os: [ ubuntu-latest ]
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
steps:
|
|
|
|
- name: Install Go
|
2023-12-06 16:32:32 +00:00
|
|
|
uses: actions/setup-go@v5
|
2020-11-18 12:51:33 +00:00
|
|
|
with:
|
|
|
|
go-version: ${{ matrix.go-version }}
|
|
|
|
- name: Checkout code
|
2024-10-23 16:14:40 +00:00
|
|
|
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
|
2020-11-18 12:51:33 +00:00
|
|
|
- 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 ./...
|