|
28 | 28 | restore-keys: |
|
29 | 29 | repo-cache-${{ runner.os }}-nixpkgs-${{ env.cache-version }}-
|
30 | 30 |
|
31 |
| - - name: Prefetch Stackage snapshot |
32 |
| - shell: bash |
33 |
| - run: | |
34 |
| - set -e -o pipefail |
35 |
| - nix-shell --pure --run "cmd='bazel fetch @stackage//... $BAZEL_ARGS'; \$cmd || \$cmd || \$cmd" |
36 |
| -
|
37 | 31 | - name: run gazelle_cabal
|
38 | 32 | run: |
|
39 | 33 | nix-shell --pure --run "bazel run $BAZEL_ARGS //:gazelle"
|
|
47 | 41 | ~/repo-cache
|
48 | 42 | ~/disk-cache
|
49 | 43 | key: repo-cache-${{ runner.os }}-nixpkgs-${{ env.cache-version }}-${{ github.run_id }}-${{ github.run_attempt }}
|
50 |
| - - name: gazelle check |
51 |
| - run: | |
52 |
| - if ! git diff --exit-code |
53 |
| - then |
54 |
| - echo Repository files have changed |
55 |
| - echo You might need to run: nix-shell --run "\"bazel run //:gazelle\"" |
56 |
| - echo and commit the resulting changes. |
57 |
| - exit 1 |
58 |
| - fi |
59 |
| -
|
60 |
| - run-tests-with-stack: |
61 |
| - name: with stack |
62 |
| - runs-on: ubuntu-latest |
63 |
| - steps: |
64 |
| - - uses: actions/checkout@v4 |
65 |
| - - uses: cachix/install-nix-action@v31 |
66 |
| - - name: Configure |
67 |
| - run: | |
68 |
| - mkdir -p ~/repo-cache ~/disk-cache |
69 |
| - echo build --host_platform=@io_tweag_rules_nixpkgs//nixpkgs/platforms:host > .bazelrc.local |
70 |
| - - name: Get Stack snapshot install directory |
71 |
| - id: stack-snapshot |
72 |
| - # NOTE: `stack path` must run at least once prior to caching to ensure the directory |
73 |
| - # exists and is populated. |
74 |
| - run: | |
75 |
| - stack --nix path --snapshot-install-root |
76 |
| - echo "dir=$(stack --nix path --snapshot-install-root)" > "${GITHUB_OUTPUT}" |
77 |
| - - uses: actions/cache@v4 |
78 |
| - with: |
79 |
| - path: ${{ steps.stack-snapshot.outputs.dir }} |
80 |
| - key: ${{ runner.os }}-stack-${{ hashFiles('**/*.cabal') }} |
81 |
| - restore-keys: ${{ runner.os }}-stack- |
82 |
| - - name: Build |
83 |
| - run: | |
84 |
| - stack --nix build |
85 |
| - - name: Test |
86 |
| - if: ${{ runner.os == 'Linux' }} |
87 |
| - run: | |
88 |
| - stack --nix test |
89 | 44 |
|
90 | 45 | run-tests-with-darwin:
|
91 | 46 | name: with bazel in darwin
|
|
0 commit comments