ci: try enabling direnv #4
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: ci | |
| on: | |
| push: | |
| workflow_dispatch: | |
| jobs: | |
| stack: | |
| name: stack | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: cachix/install-nix-action@v31 | |
| with: | |
| nix_path: nixpkgs=channel:nixos-unstable | |
| - uses: DeterminateSystems/magic-nix-cache-action@main | |
| - uses: actions/cache@v5 | |
| name: Cache ~/.stack | |
| with: | |
| path: ~/.stack | |
| key: ${{ runner.os }}-stack | |
| - name: Install direnv | |
| run: | | |
| curl -sfL https://direnv.net/install.sh | bash | |
| echo "$HOME/.local/bin" >> $GITHUB_PATH | |
| - name: Allow direnv | |
| run: direnv allow | |
| - name: Build | |
| run: | | |
| eval "$(direnv export bash)" | |
| export NIX_PATH="nixpkgs=$(nix run .#nixpkgsPath)" | |
| echo "NIX_PATH: $NIX_PATH" | |
| nix run .#stack -- build --nix --test --bench --no-run-tests --no-run-benchmarks | |
| - name: Test | |
| run: | | |
| eval "$(direnv export bash)" | |
| export NIX_PATH="nixpkgs=$(nix run .#nixpkgsPath)" | |
| echo "NIX_PATH: $NIX_PATH" | |
| nix run .#stack -- test --nix --test-arguments --print | |
| no-gmp: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: cachix/install-nix-action@v31 | |
| with: | |
| nix_path: nixpkgs=channel:nixos-unstable | |
| - uses: DeterminateSystems/magic-nix-cache-action@main | |
| - name: No GMP | |
| run: | | |
| nix run .#verify-no-gmp | |
| nix: | |
| name: Nix | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: cachix/install-nix-action@v31 | |
| with: | |
| nix_path: nixpkgs=channel:nixos-unstable | |
| - uses: DeterminateSystems/magic-nix-cache-action@main | |
| - name: Build | |
| run: | | |
| nix build |