name: "Test" on: pull_request: push: jobs: test-nix: runs-on: ubuntu-latest steps: - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4 with: # Nix Flakes doesn't work on shallow clones fetch-depth: 0 - name: Install Nix uses: DeterminateSystems/nix-installer-action@v6 - 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@v4 with: go-version: ${{ matrix.go-version }} - name: Checkout code uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # 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 ./...