-
-
Notifications
You must be signed in to change notification settings - Fork 127
34 lines (34 loc) · 955 Bytes
/
test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
name: "Test"
on:
pull_request:
push:
jobs:
test-nix:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
with:
# Nix Flakes doesn't work on shallow clones
fetch-depth: 0
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@v9
- uses: DeterminateSystems/magic-nix-cache-action@main
- run: nix-build
test:
strategy:
matrix:
go-version: [ 1.19.x, 1.20.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@b4ffde65f46336ab88eb53be808477a3936bae11 # 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 ./...