name: "Test"
on:
  pull_request:
  push:
jobs:
  test-nix:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
      with:
          # Nix Flakes doesn't work on shallow clones
          fetch-depth: 0
    - uses: cachix/install-nix-action@v16
      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:
        go-version: [ 1.17.x, 1.18.x ]
        os: [ ubuntu-latest ]
    runs-on: ${{ matrix.os }}
    steps:
    - name: Install Go
      uses: actions/setup-go@v2
      with:
        go-version: ${{ matrix.go-version }}
    - name: Checkout code
      uses: actions/checkout@v2
    - 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 ./...

name: "Test"
on:
  pull_request:
  push:
jobs:
  test-nix:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v3
      with:
          # Nix Flakes doesn't work on shallow clones
          fetch-depth: 0
    - uses: cachix/install-nix-action@v16
      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:
        go-version: [ 1.17.x, 1.18.x ]
        os: [ ubuntu-latest ]
    runs-on: ${{ matrix.os }}
    steps:
    - name: Install Go
      uses: actions/setup-go@v2
      with:
        go-version: ${{ matrix.go-version }}
    - name: Checkout code
      uses: actions/checkout@v3
    - 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 ./...

Update actions/checkout action to v3
Update actions/checkout action to v3