| 1 | name: For each commit and PR |
| 2 | on: |
| 3 | push: |
| 4 | pull_request: |
| 5 | |
| 6 | jobs: |
| 7 | validation: |
| 8 | runs-on: [ubuntu-latest] |
| 9 | env: |
| 10 | CGO_ENABLED: 0 |
| 11 | steps: |
| 12 | - name: Setup Dynamic Env |
| 13 | run: | |
| 14 | echo "MAKEFLAGS=-j$(nproc)" | tee $GITHUB_ENV |
| 15 | |
| 16 | - name: Checkout code |
| 17 | uses: actions/checkout@v2 |
| 18 | |
| 19 | - name: Install nix |
| 20 | uses: cachix/install-nix-action@018abf956a0a15673dae4932ae26f0f071ac0944 |
| 21 | with: |
| 22 | nix_path: nixpkgs=channel:nixpkgs-unstable |
| 23 | |
| 24 | - name: Fetch Nix Derivations |
| 25 | run: nix-shell --command true |
| 26 | |
| 27 | - name: Install Go tools |
| 28 | run: nix-shell --run 'make tools' |
| 29 | |
| 30 | - name: Linters and Go Formatting |
| 31 | run: nix-shell --run 'make verify' |
| 32 | |
| 33 | - name: Non Go Formatters |
| 34 | run: ./.github/workflows/formatters.sh |
| 35 | |
| 36 | - name: Install ZFS |
| 37 | run: sudo apt-get -y update && sudo apt-get -y install zfsutils-linux |
| 38 | |
| 39 | - name: Tests |
| 40 | run: nix-shell --run 'sudo make test' |