From afeeece98baa7f9b3a7602f2226ed54427f39b0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Domen=20Ko=C5=BEar?= Date: Fri, 23 Feb 2024 15:37:00 +0000 Subject: [PATCH] don't rely on profiles on ci --- .envrc | 4 ++++ .github/workflows/buildtest.yml | 32 ++++++++++---------------------- 2 files changed, 14 insertions(+), 22 deletions(-) diff --git a/.envrc b/.envrc index 53b74fc41..648c747af 100755 --- a/.envrc +++ b/.envrc @@ -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 diff --git a/.github/workflows/buildtest.yml b/.github/workflows/buildtest.yml index cb78a2c8b..be32836b8 100644 --- a/.github/workflows/buildtest.yml +++ b/.github/workflows/buildtest.yml @@ -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') @@ -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 @@ -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"