mirror of
https://github.com/LnL7/nix-darwin.git
synced 2024-12-14 11:57:34 +00:00
ci: remove tests to ensure submodules work
This commit is contained in:
parent
1d8c91b40e
commit
53b9de4d6c
1 changed files with 0 additions and 115 deletions
115
.github/workflows/test.yml
vendored
115
.github/workflows/test.yml
vendored
|
@ -153,60 +153,6 @@ jobs:
|
|||
run: |
|
||||
. /etc/static/bashrc
|
||||
darwin-rebuild build --flake ./modules/examples/flake#simple --override-input nix-darwin . --override-input nixpkgs nixpkgs/${{ env.CURRENT_STABLE_CHANNEL }}
|
||||
- name: Test git submodules
|
||||
run: |
|
||||
. /etc/static/bashrc
|
||||
|
||||
mkdir -p /tmp/{test-nix-darwin-submodules,example-submodule}
|
||||
|
||||
pushd /tmp/example-submodule
|
||||
echo '"hello"' > hello.nix
|
||||
git init
|
||||
git add .
|
||||
git commit -m "add a submodule we will import"
|
||||
popd
|
||||
|
||||
cp -a ./modules/examples/. /tmp/test-nix-darwin-submodules
|
||||
cp -a ./modules/examples/flake/flake.nix /tmp/test-nix-darwin-submodules
|
||||
|
||||
pushd /tmp/test-nix-darwin-submodules
|
||||
/usr/bin/sed -i.bak \
|
||||
'\#modules = \[#s#configuration#configuration ./simple.nix#' \
|
||||
./flake.nix
|
||||
/usr/bin/sed -i.bak \
|
||||
's#pkgs.vim#pkgs."${import ./submodule-test/hello.nix}"#' \
|
||||
./simple.nix
|
||||
git init
|
||||
git add flake.nix simple.nix
|
||||
git \
|
||||
-c protocol.file.allow=always \
|
||||
submodule add /tmp/example-submodule submodule-test
|
||||
popd
|
||||
|
||||
# Should fail
|
||||
darwin-rebuild build \
|
||||
--flake /tmp/test-nix-darwin-submodules#simple \
|
||||
--override-input nix-darwin . \
|
||||
--override-input nixpkgs nixpkgs/${{ env.CURRENT_STABLE_CHANNEL }} \
|
||||
&& {
|
||||
printf 'succeeded while expecting failure due to submodule\n' >/dev/stderr
|
||||
exit 1
|
||||
}
|
||||
# Should also fail
|
||||
darwin-rebuild build \
|
||||
--flake /tmp/test-nix-darwin-submodules?submodules=0#simple \
|
||||
--override-input nix-darwin . \
|
||||
--override-input nixpkgs nixpkgs/${{ env.CURRENT_STABLE_CHANNEL }} \
|
||||
&& {
|
||||
printf 'succeeded while expecting failure due to submodule\n' >/dev/stderr
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Should succeed
|
||||
darwin-rebuild build \
|
||||
--flake /tmp/test-nix-darwin-submodules?submodules=1#simple \
|
||||
--override-input nix-darwin . \
|
||||
--override-input nixpkgs nixpkgs/${{ env.CURRENT_STABLE_CHANNEL }} \
|
||||
|
||||
install-flake-against-unstable:
|
||||
runs-on: macos-12
|
||||
|
@ -236,64 +182,3 @@ jobs:
|
|||
run: |
|
||||
. /etc/static/bashrc
|
||||
darwin-rebuild build --flake ./modules/examples/flake#simple --override-input nix-darwin . --override-input nixpkgs nixpkgs/nixpkgs-unstable
|
||||
- name: Test git submodules
|
||||
run: |
|
||||
. /etc/static/bashrc
|
||||
|
||||
mkdir -p /tmp/{test-nix-darwin-submodules,example-submodule}
|
||||
|
||||
pushd /tmp/example-submodule
|
||||
echo '"hello"' > hello.nix
|
||||
git init
|
||||
git add .
|
||||
git commit -m "add a submodule we will import"
|
||||
popd
|
||||
|
||||
cp -a ./modules/examples/. /tmp/test-nix-darwin-submodules
|
||||
cp -a ./modules/examples/flake/flake.nix /tmp/test-nix-darwin-submodules
|
||||
|
||||
pushd /tmp/test-nix-darwin-submodules
|
||||
/usr/bin/sed -i.bak \
|
||||
'\#modules = \[#s#configuration#configuration ./simple.nix#' \
|
||||
./flake.nix
|
||||
/usr/bin/sed -i.bak \
|
||||
's#pkgs.vim#pkgs."${import ./submodule-test/hello.nix}"#' \
|
||||
./simple.nix
|
||||
git init
|
||||
git add flake.nix simple.nix
|
||||
git \
|
||||
-c protocol.file.allow=always \
|
||||
submodule add /tmp/example-submodule submodule-test
|
||||
popd
|
||||
|
||||
# Should fail
|
||||
darwin-rebuild build \
|
||||
--flake /tmp/test-nix-darwin-submodules#simple \
|
||||
--override-input nix-darwin . \
|
||||
--override-input nixpkgs nixpkgs/nixpkgs-unstable \
|
||||
&& {
|
||||
printf 'succeeded while expecting failure due to submodule\n' >/dev/stderr
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Should also fail
|
||||
darwin-rebuild build \
|
||||
--flake /tmp/test-nix-darwin-submodules?submodules=0#simple \
|
||||
--override-input nix-darwin . \
|
||||
--override-input nixpkgs nixpkgs/nixpkgs-unstable \
|
||||
&& {
|
||||
printf 'succeeded while expecting failure due to submodule\n' >/dev/stderr
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Should succeed
|
||||
darwin-rebuild build \
|
||||
--flake /tmp/test-nix-darwin-submodules?submodules=1#simple \
|
||||
--override-input nix-darwin . \
|
||||
--override-input nixpkgs nixpkgs/nixpkgs-unstable
|
||||
|
||||
# Should also succeed
|
||||
darwin-rebuild build \
|
||||
--flake git+file:///tmp/test-nix-darwin-submodules?submodules=1#simple \
|
||||
--override-input nix-darwin . \
|
||||
--override-input nixpkgs nixpkgs/nixpkgs-unstable
|
||||
|
|
Loading…
Reference in a new issue