Skip to content

Commit

Permalink
ci: test installer on aarch64-linux (#972)
Browse files Browse the repository at this point in the history
* Test the installer on aarch64-linux runners

* Remove buildkite reference in step names

* Fix build job YAML file path

* Use apt install -y

* Run only on ARM system

* Use apt install -y on ARM machine
  • Loading branch information
lucperkins authored May 24, 2024
1 parent 18d265a commit 02fc8e2
Showing 1 changed file with 114 additions and 3 deletions.
117 changes: 114 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ jobs:
build-x86_64-darwin:
uses: ./.github/workflows/build-x86_64-darwin.yml

build-aarch64-linux:
uses: ./.github/workflows/build-aarch64-linux.yml

lints:
name: Lints
runs-on: ubuntu-latest
Expand Down Expand Up @@ -56,7 +59,7 @@ jobs:
contents: "read"
steps:
- uses: actions/checkout@v3
- name: Restore Github cache of Buildkite artifacts
- name: Restore Github cache artifacts
uses: actions/cache/restore@v3
with:
path: nix-installer
Expand Down Expand Up @@ -164,7 +167,7 @@ jobs:
contents: "read"
steps:
- uses: actions/checkout@v3
- name: Restore Github cache of Buildkite artifacts
- name: Restore Github cache artifacts
uses: actions/cache/restore@v3
with:
path: nix-installer
Expand Down Expand Up @@ -278,7 +281,7 @@ jobs:
contents: "read"
steps:
- uses: actions/checkout@v3
- name: Restore Github cache of Buildkite artifacts
- name: Restore Github cache artifacts
uses: actions/cache/restore@v3
with:
path: nix-installer
Expand Down Expand Up @@ -351,3 +354,111 @@ jobs:
NIX_INSTALLER_LOGGER: pretty
NIX_INSTALLER_LOG_DIRECTIVES: nix_installer=debug
RUST_BACKTRACE: full

run-aarch64-linux:
name: Run aarch64 Linux
runs-on: namespace-profile-default-arm64
needs: [lints, build-aarch64-linux]
permissions:
id-token: "write"
contents: "read"
steps:
- uses: actions/checkout@v3
- name: Restore Github cache artifacts
uses: actions/cache/restore@v3
with:
path: nix-installer
key: aarch64-linux-artifacts-${{ github.sha }}
- name: Move & set executable
run: |
mkdir install-root
cp nix-installer.sh install-root/nix-installer.sh
mv ./nix-installer install-root/nix-installer-aarch64-linux
chmod +x install-root/nix-installer-aarch64-linux install-root/nix-installer.sh
- run: sudo apt install -y fish zsh
- name: Initial install
uses: DeterminateSystems/nix-installer-action@main
with:
flakehub: true
local-root: install-root/
logger: pretty
log-directives: nix_installer=debug
backtrace: full
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Initial uninstall (without a `nix run` first)
run: sudo -E /nix/nix-installer uninstall
env:
NIX_INSTALLER_NO_CONFIRM: true
NIX_INSTALLER_LOGGER: pretty
NIX_INSTALLER_LOG_DIRECTIVES: nix_installer=debug
RUST_BACKTRACE: full
- name: Ensure `nix` is removed
run: |
if systemctl is-active nix-daemon.socket; then
echo "nix-daemon.socket was still running"
exit 1
fi
if systemctl is-active nix-daemon.service; then
echo "nix-daemon.service was still running"
exit 1
fi
if [ -e /nix ]; then
echo "/nix exists"
exit 1
fi
- name: Repeated install
uses: DeterminateSystems/nix-installer-action@main
with:
flakehub: true
local-root: install-root/
logger: pretty
log-directives: nix_installer=debug
backtrace: full
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: echo $PATH
run: echo $PATH
- name: Test `nix` with `$GITHUB_PATH`
if: success() || failure()
run: |
nix run nixpkgs#hello
nix profile install nixpkgs#hello
hello
nix store gc
nix run nixpkgs#hello
- name: Test bash
run: nix-instantiate -E 'builtins.currentTime' --eval
if: success() || failure()
shell: bash --login {0}
- name: Test sh
run: nix-instantiate -E 'builtins.currentTime' --eval
if: success() || failure()
shell: sh -l {0}
- name: Test zsh
run: nix-instantiate -E 'builtins.currentTime' --eval
if: success() || failure()
shell: zsh --login --interactive {0}
- name: Test fish
run: nix-instantiate -E 'builtins.currentTime' --eval
if: success() || failure()
shell: fish --login {0}
- name: Repeated uninstall
run: sudo -E /nix/nix-installer uninstall
env:
NIX_INSTALLER_NO_CONFIRM: true
NIX_INSTALLER_LOGGER: pretty
NIX_INSTALLER_LOG_DIRECTIVES: nix_installer=debug
RUST_BACKTRACE: full
- name: Ensure `nix` is removed
run: |
if systemctl is-active nix-daemon.socket; then
echo "nix-daemon.socket was still running"
exit 1
fi
if systemctl is-active nix-daemon.service; then
echo "nix-daemon.service was still running"
exit 1
fi
if [ -e /nix ]; then
echo "/nix exists"
exit 1
fi

0 comments on commit 02fc8e2

Please sign in to comment.