tests: improve env tests and move to tests dir

This commit is contained in:
Sander 2025-09-21 17:20:39 +02:00
parent d487f94a7a
commit 7449e8905b
No known key found for this signature in database
3 changed files with 12 additions and 8 deletions

View file

@ -27,12 +27,12 @@ jobs:
with:
nix_path: ${{ env.nixpkgs_channel }}
- name: Test environment variables
run: ./test-env.sh
run: ./tests/test-env.sh
- run: nix-env -iA cachix -f https://cachix.org/api/v1/install
- run: cat /etc/nix/nix.conf
# cachix should be available and be able to configure a cache
- run: cachix use cachix
- run: nix-build test.nix
- run: nix-build tests/test-build.nix
custom-nix-path:
strategy:
@ -51,7 +51,7 @@ jobs:
with:
nix_path: ${{ env.nixpkgs_channel }}
- run: test $NIX_PATH == '${{ env.nixpkgs_channel }}'
- run: nix-build test.nix
- run: nix-build tests/test-build.nix
extra-nix-config:
strategy:
@ -72,7 +72,7 @@ jobs:
extra_nix_config: |
sandbox = relaxed
- run: cat /etc/nix/nix.conf
- run: nix-build test.nix --arg noChroot true
- run: nix-build tests/test-build.nix --arg noChroot true
flakes:
strategy:
@ -117,7 +117,7 @@ jobs:
nix_path: ${{ env.nixpkgs_channel }}
install_url: https://hydra.nixos.org/job/nix/master/installerScript/latest-finished/download/1/install
install_options: "--tarball-url-prefix http://localhost:8080"
- run: nix-build test.nix
- run: nix-build tests/test-build.nix
oldest-supported-installer:
strategy:
@ -142,7 +142,7 @@ jobs:
with:
nix_path: ${{ env.nixpkgs_channel }}
install_url: https://releases.nixos.org/nix/${{ matrix.installer_version }}/install
- run: nix-build test.nix
- run: nix-build tests/test-build.nix
act-support:
strategy:

View file

@ -20,10 +20,12 @@ if [[ -n "${NIX_SSL_CERT_FILE:-}" ]]; then
if [[ -f "$NIX_SSL_CERT_FILE" ]]; then
echo "✓ NIX_SSL_CERT_FILE is set and file exists"
else
echo "⚠ NIX_SSL_CERT_FILE is set but file does not exist: $NIX_SSL_CERT_FILE"
echo "✗ NIX_SSL_CERT_FILE is set but file does not exist: $NIX_SSL_CERT_FILE"
exit 1
fi
else
echo "⚠ NIX_SSL_CERT_FILE is not set (may be OK depending on system)"
echo "✗ NIX_SSL_CERT_FILE is not set"
exit 1
fi
# Test PATH contains Nix paths
@ -41,6 +43,7 @@ if [[ -n "${NIX_PATH:-}" ]]; then
echo "✓ NIX_PATH is set"
else
echo "NIX_PATH: <not set>"
exit 1
fi
# Test TMPDIR
@ -49,6 +52,7 @@ if [[ -n "${TMPDIR:-}" ]]; then
echo "✓ TMPDIR is set"
else
echo "⚠ TMPDIR is not set"
exit 1
fi
echo