2021-11-20 11:30:40 -08:00
|
|
|
name: "CI"
|
|
|
|
on:
|
|
|
|
pull_request:
|
|
|
|
push:
|
|
|
|
jobs:
|
2021-11-20 11:39:24 -08:00
|
|
|
tests-linux:
|
2023-01-29 08:27:20 -08:00
|
|
|
runs-on: ubuntu-latest
|
2021-11-20 11:39:24 -08:00
|
|
|
steps:
|
2023-01-29 08:27:20 -08:00
|
|
|
- uses: actions/checkout@v3
|
2023-09-15 07:54:21 -06:00
|
|
|
- uses: cachix/install-nix-action@v22
|
2021-11-20 11:39:24 -08:00
|
|
|
with:
|
2023-12-23 14:43:03 -08:00
|
|
|
extra_nix_config: |
|
|
|
|
system-features = nixos-test recursive-nix benchmark big-parallel kvm
|
|
|
|
extra-experimental-features = recursive-nix nix-command flakes
|
2021-11-20 11:39:24 -08:00
|
|
|
- run: nix build
|
2023-02-26 14:17:37 -08:00
|
|
|
- run: nix build .#doc
|
2023-01-29 08:27:20 -08:00
|
|
|
- run: nix fmt . -- --check
|
2021-11-20 11:39:24 -08:00
|
|
|
- run: nix flake check
|
|
|
|
tests-darwin:
|
2025-01-13 11:58:57 +08:00
|
|
|
runs-on: macos-latest
|
2021-11-20 11:30:40 -08:00
|
|
|
steps:
|
2023-01-29 08:27:20 -08:00
|
|
|
- uses: actions/checkout@v3
|
2025-01-12 22:25:25 +08:00
|
|
|
- uses: cachix/install-nix-action@v30
|
2021-11-20 11:37:06 -08:00
|
|
|
with:
|
2023-12-21 13:15:07 -07:00
|
|
|
extra_nix_config: |
|
|
|
|
system-features = nixos-test recursive-nix benchmark big-parallel kvm
|
|
|
|
extra-experimental-features = recursive-nix nix-command flakes
|
2021-11-20 11:37:06 -08:00
|
|
|
- run: nix build
|
2023-02-26 14:17:37 -08:00
|
|
|
- run: nix build .#doc
|
2023-01-29 08:27:20 -08:00
|
|
|
- run: nix fmt . -- --check
|
2021-11-20 11:31:38 -08:00
|
|
|
- run: nix flake check
|
2023-05-03 17:25:54 -06:00
|
|
|
- name: "Install nix-darwin module"
|
|
|
|
run: |
|
2025-01-13 11:58:57 +08:00
|
|
|
# Determine architecture of GitHub runner
|
|
|
|
ARCH=x86_64
|
|
|
|
if [ "$(arch)" = arm64 ]; then
|
2025-01-13 12:02:14 +08:00
|
|
|
ARCH=aarch64
|
2025-01-13 11:58:57 +08:00
|
|
|
fi
|
2023-12-21 13:15:07 -07:00
|
|
|
# https://github.com/ryantm/agenix/pull/230#issuecomment-1867025385
|
|
|
|
|
|
|
|
sudo mv /etc/nix/nix.conf{,.bak}
|
|
|
|
nix \
|
|
|
|
--extra-experimental-features 'nix-command flakes' \
|
2025-01-13 11:58:57 +08:00
|
|
|
build .#checks."${ARCH}"-darwin.integration
|
2023-12-21 13:15:07 -07:00
|
|
|
|
|
|
|
./result/activate-user
|
|
|
|
sudo ./result/activate
|
2023-05-03 17:25:54 -06:00
|
|
|
- name: "Test nix-darwin module"
|
|
|
|
run: |
|
|
|
|
sudo /run/current-system/sw/bin/agenix-integration
|
|
|
|
- name: "Test home-manager module"
|
|
|
|
run: |
|
|
|
|
# Do the job of `home-manager switch` in-line to avoid rate limiting
|
|
|
|
nix build .#homeConfigurations.integration-darwin.activationPackage
|
|
|
|
./result/activate
|
|
|
|
~/agenix-home-integration/bin/agenix-home-integration
|