Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: use tweag/run-nix-shell #77

Merged
merged 2 commits into from
Dec 13, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 13 additions & 7 deletions .github/workflows/workflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,10 @@ jobs:
ln -s ../.bazelrc.local example/.bazelrc.local
ln -s ../../.bazelrc.local tests/alternative-deps/.bazelrc.local
- name: Build & test
run: nix-shell --pure --run 'bazel test --config=${{ matrix.ghc-version }} --test_output=all //...'
if: ${{ !matrix.enable-bzlmod }}
uses: tweag/run-nix-shell@v0
with:
run: bazel test --config=${{ matrix.ghc-version }} --test_output=all //...
- name: Test the example
run: |
cd example
Expand Down Expand Up @@ -125,15 +127,19 @@ jobs:
nix-shell --pure --run 'bazel run //:gazelle-update-repos --config=${{ matrix.ghc-version }}'
nix-shell --pure --run 'bazel test //... --config=${{ matrix.ghc-version }}'
- name: Test alternative dependencies
run: |
cd tests/alternative-deps
nix-shell --pure --run 'bazel run //:gazelle --config=${{ matrix.ghc-version }}'
nix-shell --pure --run 'bazel run //:gazelle-update-repos --config=${{ matrix.ghc-version }}'
nix-shell --pure --run 'bazel test //... --config=${{ matrix.ghc-version }}'
if: ${{ !matrix.enable-bzlmod }}
uses: tweag/run-nix-shell@v0
with:
working-directory: tests/alternative-deps
run: |
bazel run //:gazelle --config=${{ matrix.ghc-version }}
bazel run //:gazelle-update-repos --config=${{ matrix.ghc-version }}
bazel test //... --config=${{ matrix.ghc-version }}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should add set -e here, to make the shell exit immediately when the gazelle commands fail. Maybe we could even make this the default in the run-nix-shell action? Github's run step passes --noprofile --norc -eo pipefail to bash by default.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will add the set -e. I agree about having run-nix-shell add certain shell flags. I will add this in a subsequent PR.

- name: Test for buildifier suggestions
run: nix-shell --pure --run 'bazel run //:buildifier-diff'
if: ${{ !matrix.enable-bzlmod }}
uses: tweag/run-nix-shell@v0
with:
run: bazel run //:buildifier-diff

all_ci_tests:
runs-on: ubuntu-latest
Expand Down