2020-11-18 12:51:33 +00:00
|
|
|
name: "Test"
|
|
|
|
on:
|
|
|
|
pull_request:
|
|
|
|
push:
|
|
|
|
jobs:
|
|
|
|
test-nix:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2022-07-07 19:18:49 +00:00
|
|
|
- uses: actions/checkout@v3
|
2020-11-18 12:51:33 +00:00
|
|
|
with:
|
|
|
|
# Nix Flakes doesn't work on shallow clones
|
|
|
|
fetch-depth: 0
|
2023-03-01 07:39:51 +00:00
|
|
|
- uses: cachix/install-nix-action@v20
|
2020-11-18 12:51:33 +00:00
|
|
|
with:
|
|
|
|
nix_path: nixpkgs=channel:nixos-unstable
|
|
|
|
extra_nix_config: |
|
|
|
|
experimental-features = nix-command flakes
|
|
|
|
system-features = nixos-test benchmark big-parallel kvm
|
|
|
|
- run: nix-build
|
|
|
|
test:
|
|
|
|
strategy:
|
|
|
|
matrix:
|
2022-06-15 15:53:34 +00:00
|
|
|
go-version: [ 1.17.x, 1.18.x ]
|
2020-11-18 12:51:33 +00:00
|
|
|
os: [ ubuntu-latest ]
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
steps:
|
|
|
|
- name: Install Go
|
2023-03-15 18:44:42 +00:00
|
|
|
uses: actions/setup-go@v4
|
2020-11-18 12:51:33 +00:00
|
|
|
with:
|
|
|
|
go-version: ${{ matrix.go-version }}
|
|
|
|
- name: Checkout code
|
2022-07-07 19:18:49 +00:00
|
|
|
uses: actions/checkout@v3
|
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 ./...
|