Skip to content

Commit

Permalink
don't rely on profiles on ci
Browse files Browse the repository at this point in the history
  • Loading branch information
domenkozar committed Feb 23, 2024
1 parent deae4e8 commit afeeece
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 22 deletions.
4 changes: 4 additions & 0 deletions .envrc
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
# Used by https://direnv.net
set -euo pipefail

# Use our own last built devenv/nix in CLI
devenv_bin=$(nix build --print-out-paths --accept-flake-config)
PATH_add "$devenv_bin/bin"

# External users should use `source_url` to load this file
source_env ./direnvrc

Expand Down
32 changes: 10 additions & 22 deletions .github/workflows/buildtest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,25 +18,16 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v25
with:
extra_nix_config: |
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
- uses: cachix/cachix-action@v14
with:
name: devenv
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
- name: "Reinstall devenv"
run: |
nix profile remove '.*'
nix profile install --accept-flake-config .
nix profile list
echo $PATH
which devenv
- run: nix build
- name: Run tests
run: |
devenv ci
devenv shell devenv-run-tests
devenv search ncdu | grep "pkgs\.ncdu"
./result/bin/devenv ci
./result/bin/devenv shell devenv-run-tests
./result/bin/devenv search ncdu | grep "pkgs\.ncdu"
pin:
needs: build
if: startsWith(github.ref, 'refs/tags/v')
Expand Down Expand Up @@ -73,14 +64,13 @@ jobs:
with:
name: devenv
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
- run: |
nix profile remove '.*'
nix profile install --accept-flake-config .
- name: Disable package aliases
run: |
mkdir -p ~/.config/nixpkgs
echo '{ allowAliases = false; }' > ~/.config/nixpkgs/config.nix
- run: devenv test ${{ matrix.example }}
- run: |
nix build
./result/bin/devenv test ${{ matrix.example }}
direnv:
name: direnv (${{ join(matrix.os) }})
needs: build
Expand Down Expand Up @@ -133,9 +123,7 @@ jobs:
with:
name: devenv
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
- run: nix build
- run: |
nix profile remove '.*'
nix profile install --accept-flake-config .
- run: |
nix shell nixpkgs#zsh -c zsh -c "$(which devenv) version"
nix shell nixpkgs#fish -c fish -c "$(which devenv) version"
nix shell nixpkgs#zsh -c zsh -c "./result/bin/devenv version"
nix shell nixpkgs#fish -c fish -c "./result/bin/devenv version"

0 comments on commit afeeece

Please sign in to comment.