|
41 | 41 | rustup component add rustfmt
|
42 | 42 | cargo fmt --check
|
43 | 43 |
|
| 44 | + - name: 'Install Nix' |
| 45 | + |
| 46 | + with: |
| 47 | + install_url: https://releases.nixos.org/nix/nix-2.30.1/install |
| 48 | + extra_nix_config: | |
| 49 | + substituters = https://cache.nixos.org |
| 50 | + trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= |
| 51 | +
|
| 52 | + - name: "Check `nixfmt`" |
| 53 | + run: | |
| 54 | + NIX_FILES=$(bash -O globstar -c 'ls **/*.nix') |
| 55 | + nix shell nixpkgs#nixfmt-rfc-style --command nixfmt --check ${NIX_FILES} |
| 56 | +
|
44 | 57 | integration-tests:
|
45 | 58 | needs: code-quality
|
46 | 59 | name: "Integration tests"
|
@@ -106,3 +119,41 @@ jobs:
|
106 | 119 | - name: 'Run smir integration tests'
|
107 | 120 | run: |
|
108 | 121 | RUST_DIR_ROOT='rust' VERBOSE=1 make test-ui
|
| 122 | +
|
| 123 | + nix: |
| 124 | + needs: code-quality |
| 125 | + name: 'Nix Tests' |
| 126 | + strategy: |
| 127 | + fail-fast: false |
| 128 | + matrix: |
| 129 | + runner: [normal, MacM1] # MacM1 / normal are self-hosted, |
| 130 | + runs-on: ${{ matrix.runner }} |
| 131 | + timeout-minutes: 20 |
| 132 | + steps: |
| 133 | + - name: 'Check out code' |
| 134 | + uses: actions/checkout@v4 |
| 135 | + with: |
| 136 | + # Check out pull request HEAD instead of merge commit. |
| 137 | + ref: ${{ github.event.pull_request.head.sha }} |
| 138 | + submodules: recursive |
| 139 | + |
| 140 | + - name: 'Install Nix' |
| 141 | + if: ${{ matrix.runner != 'MacM1' }} |
| 142 | + |
| 143 | + with: |
| 144 | + install_url: https://releases.nixos.org/nix/nix-2.30.1/install |
| 145 | + extra_nix_config: | |
| 146 | + substituters = http://cache.nixos.org https://cache.iog.io |
| 147 | + trusted-public-keys = cache.nixos.org |
| 148 | +
|
| 149 | + - name: 'Install Cachix' |
| 150 | + if: ${{ matrix.runner != 'MacM1' }} |
| 151 | + uses: cachix/cachix-action@v16 |
| 152 | + with: |
| 153 | + name: k-framework |
| 154 | + |
| 155 | + - name: 'Build and test' |
| 156 | + run: | |
| 157 | + set -euxo pipefail |
| 158 | + nix --version |
| 159 | + nix flake check # build and run integration & unit tests |
0 commit comments