@@ -31,6 +31,12 @@ permissions:
3131 contents : read
3232 pull-requests : read
3333
34+ defaults :
35+ run :
36+ # Explicitly setting the shell to bash runs commands with
37+ # `bash --noprofile --norc -eo pipefail` instead of `bash -e`.
38+ shell : bash
39+
3440env :
3541 HOMEBREW_GITHUB_API_TOKEN : ${{ secrets.GITHUB_TOKEN }}"
3642 HOMEBREW_NO_ANALYTICS : 1
@@ -102,10 +108,10 @@ jobs:
102108 brew install dash zsh
103109 fi
104110 - name : Install Nix
105- uses : DeterminateSystems/nix-installer-action@v1
111+ uses : DeterminateSystems/nix-installer-action@v4
106112 with :
107113 logger : pretty
108- nix-build-user-count : 4
114+ extra-conf : experimental-features = ca-derivations fetch-closure
109115 - name : Run tests
110116 env :
111117 # For devbox.json tests, we default to non-debug mode since the debug output is less useful than for unit testscripts.
@@ -115,6 +121,15 @@ jobs:
115121 # Used in `go test -timeout` flag. Needs a value that time.ParseDuration can parse.
116122 DEVBOX_GOLANG_TEST_TIMEOUT : " ${{ (github.ref == 'refs/heads/main' || inputs.run-mac-tests) && '35m' || '20m' }}"
117123 run : |
124+ echo "::group::Nix version"
125+ nix --version
126+ echo "::endgroup::"
127+ echo "::group::Contents of /etc/nix/nix.conf"
128+ cat /etc/nix/nix.conf || true
129+ echo "::endgroup::"
130+ echo "::group::Resolved Nix config"
131+ nix show-config
132+ echo "::endgroup::"
118133 go test -v -timeout $DEVBOX_GOLANG_TEST_TIMEOUT ./...
119134
120135 auto-nix-install : # ensure Devbox installs nix and works properly after installation.
@@ -141,12 +156,14 @@ jobs:
141156 devbox run echo "Installing packages..."
142157 - name : Test removing package
143158 run : devbox rm go
144-
145- test-with-old-nix-version :
159+
160+ # Run a sanity test to make sure Devbox can install and remove packages with
161+ # the last 3 Nix releases.
162+ test-nix-versions :
146163 strategy :
147164 matrix :
148165 os : [ubuntu-latest, macos-latest]
149- version : [2.15.1]
166+ version : [2.15.1, 2.16.1, 2.17.0 ]
150167 runs-on : ${{ matrix.os }}
151168 steps :
152169 - uses : actions/checkout@v3
@@ -155,15 +172,23 @@ jobs:
155172 go-version-file : ./go.mod
156173 - name : Build devbox
157174 run : go install ./cmd/devbox
158- - name : Install nix
159- run : sh <(curl -L https://releases.nixos.org/nix/nix-${{ matrix.version }}/install) --daemon
160- - name : Install devbox packages
175+ - name : Install Nix
176+ uses : DeterminateSystems/nix-installer-action@v4
177+ with :
178+ logger : pretty
179+ extra-conf : experimental-features = ca-derivations fetch-closure
180+ nix-package-url : https://releases.nixos.org/nix/nix-${{ matrix.version }}/nix-${{ matrix.version }}-${{ runner.arch == 'X64' && 'x86_64' || 'aarch64' }}-${{ runner.os == 'macOS' && 'darwin' || 'linux' }}.tar.xz
181+ - name : Run devbox install, devbox run, devbox rm
161182 run : |
162- # Setup github authentication to ensure Github's rate limits are not hit.
163- # If this works, we can consider refactoring this into a reusable github action helper.
164- mkdir -p ~/.config/nix
165- echo "access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}" > ~/.config/nix/nix.conf
166-
167- devbox run echo "Installing packages..."
168- - name : Test removing package
169- run : devbox rm go
183+ echo "::group::Nix version"
184+ nix --version
185+ echo "::endgroup::"
186+ echo "::group::Contents of /etc/nix/nix.conf"
187+ cat /etc/nix/nix.conf || true
188+ echo "::endgroup::"
189+ echo "::group::Resolved Nix config"
190+ nix show-config
191+ echo "::endgroup::"
192+ devbox install
193+ devbox run -- echo "Hello from devbox!"
194+ devbox rm go
0 commit comments