2022-09-09 19:02:43 +00:00
|
|
|
name: CI
|
|
|
|
|
|
|
|
on:
|
|
|
|
pull_request:
|
|
|
|
push:
|
|
|
|
branches: [main]
|
|
|
|
|
|
|
|
jobs:
|
2022-11-14 17:57:04 +00:00
|
|
|
lints:
|
2022-11-14 16:45:41 +00:00
|
|
|
name: Lints
|
2022-11-16 21:08:42 +00:00
|
|
|
runs-on: ubuntu-22.04
|
2022-09-09 19:02:43 +00:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
2023-01-13 21:26:15 +00:00
|
|
|
- name: Install Nix
|
2023-02-14 16:27:40 +00:00
|
|
|
uses: DeterminateSystems/nix-installer-action@main
|
2022-09-09 19:02:43 +00:00
|
|
|
with:
|
2023-01-13 21:26:15 +00:00
|
|
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
2022-11-16 21:08:42 +00:00
|
|
|
- name: Cache lint store (x86_64-linux)
|
|
|
|
id: lint-store-x86_64-linux
|
|
|
|
uses: actions/cache@v3
|
|
|
|
with:
|
|
|
|
path: ~/.ci-store
|
|
|
|
key: lint-store-x86_64-linux-${{ hashFiles('**/Cargo.lock', '**/flake.lock') }}-v1
|
2022-09-09 19:02:43 +00:00
|
|
|
- name: Check rustfmt
|
2022-12-05 18:27:12 +00:00
|
|
|
run: nix develop --store ~/.ci-store --command check-rustfmt
|
2022-09-09 19:02:43 +00:00
|
|
|
- name: Check Spelling
|
2022-12-05 18:27:12 +00:00
|
|
|
run: nix develop --store ~/.ci-store --command check-spelling
|
2022-09-09 19:02:43 +00:00
|
|
|
- name: Check nixpkgs-fmt formatting
|
2022-12-05 18:27:12 +00:00
|
|
|
run: nix develop --store ~/.ci-store --command check-nixpkgs-fmt
|
2022-09-09 19:02:43 +00:00
|
|
|
- name: Check EditorConfig conformance
|
2022-12-05 18:27:12 +00:00
|
|
|
run: nix develop --store ~/.ci-store --command check-editorconfig
|
2023-02-14 16:27:40 +00:00
|
|
|
- name: Download Buildkite Artifacts
|
|
|
|
uses: EnricoMi/download-buildkite-artifact-action@v1.14
|
2022-09-09 19:02:43 +00:00
|
|
|
with:
|
2023-02-14 16:27:40 +00:00
|
|
|
buildkite_token: ${{ secrets.BUILDKITE_TOKEN }}
|
|
|
|
output_path: artifacts
|
|
|
|
- name: Output list of Buildkite artifacts
|
2022-11-16 21:08:42 +00:00
|
|
|
run: |
|
2023-02-14 16:27:40 +00:00
|
|
|
ls -lah artifacts/
|
|
|
|
ls -lah artifacts/**/*
|
|
|
|
# Mac's can't run this action, so we're forced to do this.
|
|
|
|
- name: Create Github cache from Buildkite artifacts
|
|
|
|
id: cache-buildkite-artifacts
|
|
|
|
uses: actions/cache/save@v3
|
2022-09-09 19:02:43 +00:00
|
|
|
with:
|
2023-02-14 16:27:40 +00:00
|
|
|
path: artifacts
|
|
|
|
key: buildkite-artifacts-${{ github.sha }}
|
2022-12-12 20:21:10 +00:00
|
|
|
|
2022-11-14 16:45:41 +00:00
|
|
|
run-x86_64-linux:
|
|
|
|
name: Run x86_64 Linux
|
2022-11-16 21:08:42 +00:00
|
|
|
runs-on: ubuntu-22.04
|
2023-02-14 16:27:40 +00:00
|
|
|
needs: [lints]
|
2022-11-08 19:30:49 +00:00
|
|
|
steps:
|
2022-12-16 18:55:28 +00:00
|
|
|
- uses: actions/checkout@v3
|
2023-02-14 16:27:40 +00:00
|
|
|
- name: Restore Github cache of Buildkite artifacts
|
|
|
|
id: cache-buildkite-artifacts
|
|
|
|
uses: actions/cache/restore@v3
|
2022-11-08 19:30:49 +00:00
|
|
|
with:
|
2023-02-14 16:27:40 +00:00
|
|
|
path: artifacts
|
|
|
|
key: buildkite-artifacts-${{ github.sha }}
|
|
|
|
- run: sudo apt install fish zsh
|
2022-12-12 17:27:43 +00:00
|
|
|
- name: Move & set executable
|
|
|
|
run: |
|
2022-12-16 18:55:28 +00:00
|
|
|
mkdir install-root
|
2022-12-19 18:26:58 +00:00
|
|
|
cp nix-installer.sh install-root/nix-installer.sh
|
2023-02-14 16:27:40 +00:00
|
|
|
mv ./artifacts/nix-installer-x86_64-linux-*/* install-root/nix-installer-x86_64-linux
|
|
|
|
chmod +x install-root/nix-installer-x86_64-linux install-root/nix-installer.sh
|
2022-11-08 19:30:49 +00:00
|
|
|
- name: Initial install
|
2023-02-14 16:27:40 +00:00
|
|
|
uses: DeterminateSystems/nix-installer-action@main
|
2022-12-16 18:55:28 +00:00
|
|
|
with:
|
|
|
|
local-root: install-root/
|
|
|
|
logger: pretty
|
2023-03-10 19:50:08 +00:00
|
|
|
log-directives: nix_installer=debug
|
2022-12-16 18:55:28 +00:00
|
|
|
backtrace: full
|
|
|
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
2022-12-02 15:31:15 +00:00
|
|
|
- name: Initial uninstall (without a `nix run` first)
|
2022-12-19 18:26:58 +00:00
|
|
|
run: sudo -E /nix/nix-installer uninstall
|
2022-12-16 18:55:28 +00:00
|
|
|
env:
|
2022-12-19 18:26:58 +00:00
|
|
|
NIX_INSTALLER_NO_CONFIRM: true
|
|
|
|
NIX_INSTALLER_LOGGER: pretty
|
2023-03-10 19:50:08 +00:00
|
|
|
NIX_INSTALLER_LOG_DIRECTIVES: nix_installer=debug
|
2022-12-16 18:55:28 +00:00
|
|
|
RUST_BACKTRACE: full
|
|
|
|
- name: Ensure `nix` is removed
|
2022-12-12 17:27:43 +00:00
|
|
|
run: |
|
2022-12-16 18:55:28 +00:00
|
|
|
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
|
2023-02-14 16:27:40 +00:00
|
|
|
uses: DeterminateSystems/nix-installer-action@main
|
2022-12-16 18:55:28 +00:00
|
|
|
with:
|
|
|
|
local-root: install-root/
|
|
|
|
logger: pretty
|
2023-03-10 19:50:08 +00:00
|
|
|
log-directives: nix_installer=debug
|
2022-12-16 18:55:28 +00:00
|
|
|
backtrace: full
|
|
|
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
2022-12-07 16:22:24 +00:00
|
|
|
- name: echo $PATH
|
|
|
|
run: echo $PATH
|
2022-12-12 17:27:43 +00:00
|
|
|
- name: Test `nix` with `$GITHUB_PATH`
|
2022-12-07 16:22:24 +00:00
|
|
|
if: success() || failure()
|
2023-01-05 15:56:09 +00:00
|
|
|
run: |
|
|
|
|
nix run nixpkgs#fortune
|
|
|
|
nix profile install nixpkgs#fortune
|
|
|
|
fortune
|
|
|
|
nix store gc
|
|
|
|
nix run nixpkgs#fortune
|
2022-12-07 16:22:24 +00:00
|
|
|
- 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}
|
2022-12-09 16:17:45 +00:00
|
|
|
- name: Test fish
|
|
|
|
run: nix-instantiate -E 'builtins.currentTime' --eval
|
|
|
|
if: success() || failure()
|
|
|
|
shell: fish --login {0}
|
2022-12-02 15:31:15 +00:00
|
|
|
- name: Repeated uninstall
|
2022-12-19 18:26:58 +00:00
|
|
|
run: sudo -E /nix/nix-installer uninstall
|
2022-12-16 18:55:28 +00:00
|
|
|
env:
|
2022-12-19 18:26:58 +00:00
|
|
|
NIX_INSTALLER_NO_CONFIRM: true
|
|
|
|
NIX_INSTALLER_LOGGER: pretty
|
2023-03-10 19:50:08 +00:00
|
|
|
NIX_INSTALLER_LOG_DIRECTIVES: nix_installer=debug
|
2022-12-16 18:55:28 +00:00
|
|
|
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
|
2022-11-08 19:22:08 +00:00
|
|
|
|
2023-02-01 20:35:52 +00:00
|
|
|
run-x86_64-linux-no-init:
|
|
|
|
name: Run x86_64 Linux (No init)
|
|
|
|
runs-on: ubuntu-22.04
|
2023-02-14 16:27:40 +00:00
|
|
|
needs: [lints]
|
2023-02-01 20:35:52 +00:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
2023-02-14 16:27:40 +00:00
|
|
|
- name: Restore Github cache of Buildkite artifacts
|
|
|
|
id: cache-buildkite-artifacts
|
|
|
|
uses: actions/cache/restore@v3
|
2023-02-01 20:35:52 +00:00
|
|
|
with:
|
2023-02-14 16:27:40 +00:00
|
|
|
path: artifacts
|
|
|
|
key: buildkite-artifacts-${{ github.sha }}
|
|
|
|
- run: sudo apt install fish zsh
|
2023-02-01 20:35:52 +00:00
|
|
|
- name: Move & set executable
|
|
|
|
run: |
|
|
|
|
mkdir install-root
|
|
|
|
cp nix-installer.sh install-root/nix-installer.sh
|
2023-02-14 16:27:40 +00:00
|
|
|
mv ./artifacts/nix-installer-x86_64-linux-*/* install-root/nix-installer-x86_64-linux
|
|
|
|
chmod +x install-root/nix-installer-x86_64-linux install-root/nix-installer.sh
|
2023-02-01 20:35:52 +00:00
|
|
|
- name: Initial install
|
2023-02-14 16:27:40 +00:00
|
|
|
uses: DeterminateSystems/nix-installer-action@main
|
2023-02-01 20:35:52 +00:00
|
|
|
with:
|
|
|
|
init: none
|
2023-02-10 20:35:00 +00:00
|
|
|
planner: linux
|
2023-02-01 20:35:52 +00:00
|
|
|
local-root: install-root/
|
|
|
|
logger: pretty
|
2023-03-10 19:50:08 +00:00
|
|
|
log-directives: nix_installer=debug
|
2023-02-01 20:35:52 +00:00
|
|
|
backtrace: full
|
|
|
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Ensure daemon was not configured with init
|
|
|
|
run: |
|
|
|
|
if systemctl is-active nix-daemon.socket; then
|
|
|
|
echo "nix-daemon.socket was running"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
if systemctl is-active nix-daemon.service; then
|
|
|
|
echo "nix-daemon.service was running"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
- 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
|
2023-03-10 19:50:08 +00:00
|
|
|
NIX_INSTALLER_LOG_DIRECTIVES: nix_installer=debug
|
2023-02-01 20:35:52 +00:00
|
|
|
RUST_BACKTRACE: full
|
|
|
|
- name: Ensure `nix` is removed
|
|
|
|
run: |
|
|
|
|
if [ -e /nix ]; then
|
|
|
|
echo "/nix exists"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
- name: Repeated install
|
2023-02-14 16:27:40 +00:00
|
|
|
uses: DeterminateSystems/nix-installer-action@main
|
2023-02-01 20:35:52 +00:00
|
|
|
with:
|
|
|
|
init: none
|
2023-02-10 20:35:00 +00:00
|
|
|
planner: linux
|
2023-02-01 20:35:52 +00:00
|
|
|
local-root: install-root/
|
|
|
|
logger: pretty
|
2023-03-10 19:50:08 +00:00
|
|
|
log-directives: nix_installer=debug
|
2023-02-01 20:35:52 +00:00
|
|
|
backtrace: full
|
|
|
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: echo $PATH
|
|
|
|
run: echo $PATH
|
|
|
|
- name: Test `nix` with `$GITHUB_PATH`
|
|
|
|
if: success() || failure()
|
|
|
|
run: |
|
|
|
|
sudo -i nix run nixpkgs#fortune
|
|
|
|
sudo -i nix profile install nixpkgs#fortune
|
|
|
|
fortune
|
|
|
|
sudo -i nix store gc
|
|
|
|
sudo -i nix run nixpkgs#fortune
|
|
|
|
- name: Test bash
|
|
|
|
run: sudo -i nix-instantiate -E 'builtins.currentTime' --eval
|
|
|
|
if: success() || failure()
|
|
|
|
shell: bash --login {0}
|
|
|
|
- name: Test sh
|
|
|
|
run: sudo -i nix-instantiate -E 'builtins.currentTime' --eval
|
|
|
|
if: success() || failure()
|
|
|
|
shell: sh -l {0}
|
|
|
|
- name: Test zsh
|
|
|
|
run: sudo -i nix-instantiate -E 'builtins.currentTime' --eval
|
|
|
|
if: success() || failure()
|
|
|
|
shell: zsh --login --interactive {0}
|
|
|
|
- name: Test fish
|
|
|
|
run: sudo -i 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
|
2023-03-10 19:50:08 +00:00
|
|
|
NIX_INSTALLER_LOG_DIRECTIVES: nix_installer=debug
|
2023-02-01 20:35:52 +00:00
|
|
|
RUST_BACKTRACE: full
|
|
|
|
- name: Ensure `nix` is removed
|
|
|
|
run: |
|
|
|
|
if systemctl is-active nix-daemon.socket; then
|
|
|
|
echo "nix-daemon.socket was running"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
if systemctl is-active nix-daemon.service; then
|
|
|
|
echo "nix-daemon.service was running"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
if [ -e /nix ]; then
|
|
|
|
echo "/nix exists"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2022-12-02 15:31:15 +00:00
|
|
|
run-steam-deck:
|
|
|
|
name: Run Steam Deck (mock)
|
|
|
|
runs-on: ubuntu-22.04
|
2023-02-14 16:27:40 +00:00
|
|
|
needs: [lints]
|
2022-12-02 15:31:15 +00:00
|
|
|
steps:
|
2022-12-16 18:55:28 +00:00
|
|
|
- uses: actions/checkout@v3
|
2023-02-14 16:27:40 +00:00
|
|
|
- name: Restore Github cache of Buildkite artifacts
|
|
|
|
id: cache-buildkite-artifacts
|
|
|
|
uses: actions/cache/restore@v3
|
2022-12-02 15:31:15 +00:00
|
|
|
with:
|
2023-02-14 16:27:40 +00:00
|
|
|
path: artifacts
|
|
|
|
key: buildkite-artifacts-${{ github.sha }}
|
|
|
|
- run: sudo apt install fish zsh
|
2022-12-12 17:27:43 +00:00
|
|
|
- name: Move & set executable
|
|
|
|
run: |
|
2022-12-16 18:55:28 +00:00
|
|
|
mkdir install-root
|
2022-12-19 18:26:58 +00:00
|
|
|
cp nix-installer.sh install-root/nix-installer.sh
|
2023-02-14 16:27:40 +00:00
|
|
|
mv ./artifacts/nix-installer-x86_64-linux-*/* install-root/nix-installer-x86_64-linux
|
|
|
|
chmod +x install-root/nix-installer-x86_64-linux install-root/nix-installer.sh
|
2022-12-02 15:31:15 +00:00
|
|
|
- name: Make the CI look like a steam deck
|
|
|
|
run: |
|
|
|
|
mkdir -p ~/bin
|
|
|
|
echo -e "#! /bin/sh\nexit 0" | sudo tee -a /bin/steamos-readonly
|
|
|
|
sudo chmod +x /bin/steamos-readonly
|
|
|
|
sudo useradd -m deck
|
|
|
|
- name: Initial install
|
2023-02-14 16:27:40 +00:00
|
|
|
uses: DeterminateSystems/nix-installer-action@main
|
2022-12-16 18:55:28 +00:00
|
|
|
with:
|
|
|
|
local-root: install-root/
|
|
|
|
logger: pretty
|
2023-03-10 19:50:08 +00:00
|
|
|
log-directives: nix_installer=debug
|
2022-12-16 18:55:28 +00:00
|
|
|
backtrace: full
|
|
|
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
planner: steam-deck
|
|
|
|
extra-args: --persistence /home/runner/.ci-test-nix-home
|
2022-12-02 15:31:15 +00:00
|
|
|
- name: Initial uninstall (without a `nix run` first)
|
2022-12-19 18:26:58 +00:00
|
|
|
run: sudo -E /nix/nix-installer uninstall
|
2022-12-16 18:55:28 +00:00
|
|
|
env:
|
2022-12-19 18:26:58 +00:00
|
|
|
NIX_INSTALLER_NO_CONFIRM: true
|
|
|
|
NIX_INSTALLER_LOGGER: pretty
|
2023-03-10 19:50:08 +00:00
|
|
|
NIX_INSTALLER_LOG_DIRECTIVES: nix_installer=debug
|
2022-12-16 18:55:28 +00:00
|
|
|
RUST_BACKTRACE: full
|
|
|
|
- name: Ensure `nix` is removed
|
2022-12-12 17:27:43 +00:00
|
|
|
run: |
|
2022-12-16 18:55:28 +00:00
|
|
|
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
|
|
|
|
if [ -e /home/runner/.ci-test-nix-home ]; then
|
|
|
|
echo "/home/runner/.ci-test-nix-home exists"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
- name: Repeated install
|
2023-02-14 16:27:40 +00:00
|
|
|
uses: DeterminateSystems/nix-installer-action@main
|
2022-12-16 18:55:28 +00:00
|
|
|
with:
|
|
|
|
local-root: install-root/
|
|
|
|
logger: pretty
|
2023-03-10 19:50:08 +00:00
|
|
|
log-directives: nix_installer=debug
|
2022-12-16 18:55:28 +00:00
|
|
|
backtrace: full
|
|
|
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
planner: steam-deck
|
|
|
|
extra-args: --persistence /home/runner/.ci-test-nix-home
|
2022-12-07 16:22:24 +00:00
|
|
|
- name: echo $PATH
|
|
|
|
run: echo $PATH
|
2022-12-12 17:27:43 +00:00
|
|
|
- name: Test `nix` with `$GITHUB_PATH`
|
2022-12-07 16:22:24 +00:00
|
|
|
if: success() || failure()
|
2023-01-05 15:56:09 +00:00
|
|
|
run: |
|
|
|
|
nix run nixpkgs#fortune
|
|
|
|
nix profile install nixpkgs#fortune
|
|
|
|
fortune
|
|
|
|
nix store gc
|
|
|
|
nix run nixpkgs#fortune
|
2022-12-07 16:22:24 +00:00
|
|
|
- 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}
|
2022-12-09 16:17:45 +00:00
|
|
|
- name: Test fish
|
|
|
|
run: nix-instantiate -E 'builtins.currentTime' --eval
|
|
|
|
if: success() || failure()
|
|
|
|
shell: fish --login {0}
|
2022-12-02 15:31:15 +00:00
|
|
|
- name: Repeated uninstall
|
2022-12-19 18:26:58 +00:00
|
|
|
run: sudo -E /nix/nix-installer uninstall
|
2022-12-16 18:55:28 +00:00
|
|
|
env:
|
2022-12-19 18:26:58 +00:00
|
|
|
NIX_INSTALLER_NO_CONFIRM: true
|
|
|
|
NIX_INSTALLER_LOGGER: pretty
|
2023-03-10 19:50:08 +00:00
|
|
|
NIX_INSTALLER_LOG_DIRECTIVES: nix_installer=debug
|
2022-12-16 18:55:28 +00:00
|
|
|
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
|
|
|
|
if [ -e /home/runner/.ci-test-nix-home ]; then
|
|
|
|
echo "/home/runner/.ci-test-nix-home exists"
|
|
|
|
exit 1
|
|
|
|
fi
|
2022-12-02 15:31:15 +00:00
|
|
|
|
2022-11-14 16:45:41 +00:00
|
|
|
run-x86_64-darwin:
|
|
|
|
name: Run x86_64 Darwin
|
2022-11-16 21:08:42 +00:00
|
|
|
runs-on: macos-12
|
2023-02-14 16:27:40 +00:00
|
|
|
needs: [lints]
|
2022-11-08 19:30:49 +00:00
|
|
|
steps:
|
2022-12-16 18:55:28 +00:00
|
|
|
- uses: actions/checkout@v3
|
2023-02-14 16:27:40 +00:00
|
|
|
- name: Restore Github cache of Buildkite artifacts
|
|
|
|
id: cache-buildkite-artifacts
|
|
|
|
uses: actions/cache/restore@v3
|
2022-11-08 19:30:49 +00:00
|
|
|
with:
|
2023-02-14 16:27:40 +00:00
|
|
|
path: artifacts
|
|
|
|
key: buildkite-artifacts-${{ github.sha }}
|
|
|
|
- run: brew install fish coreutils
|
2022-12-12 17:27:43 +00:00
|
|
|
- name: Move & set executable
|
|
|
|
run: |
|
2022-12-16 18:55:28 +00:00
|
|
|
mkdir install-root
|
2022-12-19 18:26:58 +00:00
|
|
|
cp nix-installer.sh install-root/nix-installer.sh
|
2023-02-14 16:27:40 +00:00
|
|
|
mv ./artifacts/nix-installer-x86_64-darwin-*/* install-root/nix-installer-x86_64-darwin
|
|
|
|
chmod +x install-root/nix-installer-x86_64-darwin install-root/nix-installer.sh
|
2022-11-08 19:30:49 +00:00
|
|
|
- name: Initial install
|
2023-02-14 16:27:40 +00:00
|
|
|
uses: DeterminateSystems/nix-installer-action@main
|
2022-12-16 18:55:28 +00:00
|
|
|
with:
|
|
|
|
local-root: install-root/
|
|
|
|
logger: pretty
|
2023-03-10 19:50:08 +00:00
|
|
|
log-directives: nix_installer=debug
|
2022-12-16 18:55:28 +00:00
|
|
|
backtrace: full
|
|
|
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
2023-01-11 19:42:35 +00:00
|
|
|
extra-conf: |
|
|
|
|
trusted-users = root runner
|
2022-12-02 15:31:15 +00:00
|
|
|
- name: Initial uninstall (without a `nix run` first)
|
2022-12-19 18:26:58 +00:00
|
|
|
run: sudo -E /nix/nix-installer uninstall
|
2022-12-16 18:55:28 +00:00
|
|
|
env:
|
2022-12-19 18:26:58 +00:00
|
|
|
NIX_INSTALLER_NO_CONFIRM: true
|
|
|
|
NIX_INSTALLER_LOGGER: pretty
|
2023-03-10 19:50:08 +00:00
|
|
|
NIX_INSTALLER_LOG_DIRECTIVES: nix_installer=debug
|
2022-12-16 18:55:28 +00:00
|
|
|
RUST_BACKTRACE: full
|
2022-11-08 19:30:49 +00:00
|
|
|
- name: Repeated install
|
2023-02-14 16:27:40 +00:00
|
|
|
uses: DeterminateSystems/nix-installer-action@main
|
2022-12-16 18:55:28 +00:00
|
|
|
with:
|
|
|
|
local-root: install-root/
|
|
|
|
logger: pretty
|
2023-03-10 19:50:08 +00:00
|
|
|
log-directives: nix_installer=debug
|
2022-12-16 18:55:28 +00:00
|
|
|
backtrace: full
|
|
|
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
2023-01-11 19:42:35 +00:00
|
|
|
extra-conf: trusted-users = root runner
|
2022-12-07 16:22:24 +00:00
|
|
|
- name: echo $PATH
|
|
|
|
run: echo $PATH
|
2023-02-13 20:46:55 +00:00
|
|
|
# The Mac CI constantly fails here despite us setting the token....
|
|
|
|
# - name: Test `nix` with `$GITHUB_PATH`
|
|
|
|
# if: success() || failure()
|
|
|
|
# run: |
|
|
|
|
# nix run nixpkgs#fortune
|
|
|
|
# nix profile install nixpkgs#fortune
|
|
|
|
# fortune
|
|
|
|
# nix store gc
|
|
|
|
# nix run nixpkgs#fortune
|
2022-12-07 16:22:24 +00:00
|
|
|
- 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}
|
2022-11-08 19:30:49 +00:00
|
|
|
- name: Repeated uninstall
|
2022-12-19 18:26:58 +00:00
|
|
|
run: sudo -E /nix/nix-installer uninstall
|
2022-12-16 18:55:28 +00:00
|
|
|
env:
|
2022-12-19 18:26:58 +00:00
|
|
|
NIX_INSTALLER_NO_CONFIRM: true
|
|
|
|
NIX_INSTALLER_LOGGER: pretty
|
2023-03-10 19:50:08 +00:00
|
|
|
NIX_INSTALLER_LOG_DIRECTIVES: nix_installer=debug
|
2022-12-16 18:55:28 +00:00
|
|
|
RUST_BACKTRACE: full
|