mirror of
https://github.com/cachix/install-nix-action.git
synced 2025-09-21 23:59:11 +00:00
tests: improve env tests and move to tests dir
This commit is contained in:
parent
d487f94a7a
commit
7449e8905b
3 changed files with 12 additions and 8 deletions
12
.github/workflows/test.yml
vendored
12
.github/workflows/test.yml
vendored
|
@ -27,12 +27,12 @@ jobs:
|
||||||
with:
|
with:
|
||||||
nix_path: ${{ env.nixpkgs_channel }}
|
nix_path: ${{ env.nixpkgs_channel }}
|
||||||
- name: Test environment variables
|
- 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: nix-env -iA cachix -f https://cachix.org/api/v1/install
|
||||||
- run: cat /etc/nix/nix.conf
|
- run: cat /etc/nix/nix.conf
|
||||||
# cachix should be available and be able to configure a cache
|
# cachix should be available and be able to configure a cache
|
||||||
- run: cachix use cachix
|
- run: cachix use cachix
|
||||||
- run: nix-build test.nix
|
- run: nix-build tests/test-build.nix
|
||||||
|
|
||||||
custom-nix-path:
|
custom-nix-path:
|
||||||
strategy:
|
strategy:
|
||||||
|
@ -51,7 +51,7 @@ jobs:
|
||||||
with:
|
with:
|
||||||
nix_path: ${{ env.nixpkgs_channel }}
|
nix_path: ${{ env.nixpkgs_channel }}
|
||||||
- run: test $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:
|
extra-nix-config:
|
||||||
strategy:
|
strategy:
|
||||||
|
@ -72,7 +72,7 @@ jobs:
|
||||||
extra_nix_config: |
|
extra_nix_config: |
|
||||||
sandbox = relaxed
|
sandbox = relaxed
|
||||||
- run: cat /etc/nix/nix.conf
|
- 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:
|
flakes:
|
||||||
strategy:
|
strategy:
|
||||||
|
@ -117,7 +117,7 @@ jobs:
|
||||||
nix_path: ${{ env.nixpkgs_channel }}
|
nix_path: ${{ env.nixpkgs_channel }}
|
||||||
install_url: https://hydra.nixos.org/job/nix/master/installerScript/latest-finished/download/1/install
|
install_url: https://hydra.nixos.org/job/nix/master/installerScript/latest-finished/download/1/install
|
||||||
install_options: "--tarball-url-prefix http://localhost:8080"
|
install_options: "--tarball-url-prefix http://localhost:8080"
|
||||||
- run: nix-build test.nix
|
- run: nix-build tests/test-build.nix
|
||||||
|
|
||||||
oldest-supported-installer:
|
oldest-supported-installer:
|
||||||
strategy:
|
strategy:
|
||||||
|
@ -142,7 +142,7 @@ jobs:
|
||||||
with:
|
with:
|
||||||
nix_path: ${{ env.nixpkgs_channel }}
|
nix_path: ${{ env.nixpkgs_channel }}
|
||||||
install_url: https://releases.nixos.org/nix/${{ matrix.installer_version }}/install
|
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:
|
act-support:
|
||||||
strategy:
|
strategy:
|
||||||
|
|
|
@ -20,10 +20,12 @@ if [[ -n "${NIX_SSL_CERT_FILE:-}" ]]; then
|
||||||
if [[ -f "$NIX_SSL_CERT_FILE" ]]; then
|
if [[ -f "$NIX_SSL_CERT_FILE" ]]; then
|
||||||
echo "✓ NIX_SSL_CERT_FILE is set and file exists"
|
echo "✓ NIX_SSL_CERT_FILE is set and file exists"
|
||||||
else
|
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
|
fi
|
||||||
else
|
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
|
fi
|
||||||
|
|
||||||
# Test PATH contains Nix paths
|
# Test PATH contains Nix paths
|
||||||
|
@ -41,6 +43,7 @@ if [[ -n "${NIX_PATH:-}" ]]; then
|
||||||
echo "✓ NIX_PATH is set"
|
echo "✓ NIX_PATH is set"
|
||||||
else
|
else
|
||||||
echo "NIX_PATH: <not set>"
|
echo "NIX_PATH: <not set>"
|
||||||
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Test TMPDIR
|
# Test TMPDIR
|
||||||
|
@ -49,6 +52,7 @@ if [[ -n "${TMPDIR:-}" ]]; then
|
||||||
echo "✓ TMPDIR is set"
|
echo "✓ TMPDIR is set"
|
||||||
else
|
else
|
||||||
echo "⚠ TMPDIR is not set"
|
echo "⚠ TMPDIR is not set"
|
||||||
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo
|
echo
|
Loading…
Add table
Add a link
Reference in a new issue