mirror of
https://github.com/NixOS/nixos-hardware.git
synced 2025-11-05 01:37:24 +08:00
Compare commits
2 Commits
mnt-reform
...
ci-better-
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0aa778c6a4 | ||
|
|
8229a43214 |
35
tests/eval-one.sh
Executable file
35
tests/eval-one.sh
Executable file
@@ -0,0 +1,35 @@
|
||||
#!/bin/sh
|
||||
set -u
|
||||
here=$(cd "$(dirname "$0")" && pwd)
|
||||
|
||||
if [ -z "$1" ]; then
|
||||
echo "Usage: $0 <profile>"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
profile=$1
|
||||
logfile=$(mktemp)
|
||||
|
||||
# shellcheck disable=SC2039
|
||||
echo -n "evaluating $profile: "
|
||||
|
||||
nix-build \
|
||||
'<nixpkgs/nixos>' \
|
||||
-I "nixos-config=$here/eval-test.nix" \
|
||||
-I "nixos-hardware-profile=$profile" \
|
||||
--dry-run \
|
||||
--no-out-link \
|
||||
--show-trace \
|
||||
-A system > "$logfile" 2>&1
|
||||
ret=$?
|
||||
|
||||
if [ "$ret" -gt 0 ]; then
|
||||
echo ERROR
|
||||
echo ===================================================================== >&2
|
||||
cat "$logfile" >&2
|
||||
else
|
||||
echo OK
|
||||
fi
|
||||
|
||||
rm "$logfile"
|
||||
exit "$ret"
|
||||
@@ -1,15 +1,11 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
|
||||
set -efu
|
||||
cd "$(dirname "$0")/.."
|
||||
|
||||
for profile in $(find . -name default.nix); do
|
||||
echo evaluating $profile >&2
|
||||
echo "### Evaluating all profiles ###"
|
||||
echo
|
||||
|
||||
nix-build '<nixpkgs/nixos>' \
|
||||
-I nixos-config=tests/eval-test.nix \
|
||||
-I nixos-hardware-profile=$profile \
|
||||
-A system \
|
||||
--dry-run
|
||||
# shellcheck disable=SC2044
|
||||
for profile in $(find . -name default.nix); do
|
||||
./tests/eval-one.sh "$profile"
|
||||
done
|
||||
|
||||
Reference in New Issue
Block a user