2023-01-13 19:07:57 +01:00
|
|
|
name: CI
|
|
|
|
|
|
|
|
on:
|
|
|
|
pull_request:
|
|
|
|
push:
|
|
|
|
branches: [main]
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
run-x86_64-linux:
|
|
|
|
name: Run x86_64 Linux
|
|
|
|
runs-on: ubuntu-22.04
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
2023-01-13 19:13:23 +01:00
|
|
|
- name: Install Nix
|
2023-01-13 19:07:57 +01:00
|
|
|
uses: ./
|
|
|
|
with:
|
|
|
|
logger: pretty
|
|
|
|
log-directives: nix_installer=trace
|
|
|
|
backtrace: full
|
|
|
|
- name: echo $PATH
|
|
|
|
run: echo $PATH
|
|
|
|
- name: Test `nix` with `$GITHUB_PATH`
|
|
|
|
if: success() || failure()
|
|
|
|
run: |
|
2023-05-25 17:54:25 +02:00
|
|
|
nix run nixpkgs#hello
|
|
|
|
nix profile install nixpkgs#hello
|
|
|
|
hello
|
2023-01-13 19:07:57 +01:00
|
|
|
nix store gc
|
2023-05-25 17:54:25 +02:00
|
|
|
nix run nixpkgs#hello
|
2023-01-13 19:07:57 +01: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}
|
2023-01-13 21:09:36 +01:00
|
|
|
- name: Install Nix again (noop)
|
|
|
|
uses: ./
|
|
|
|
with:
|
|
|
|
logger: pretty
|
|
|
|
log-directives: nix_installer=trace
|
|
|
|
backtrace: full
|
2023-01-13 21:18:14 +01:00
|
|
|
- name: Test `nix` with `$GITHUB_PATH`
|
|
|
|
if: success() || failure()
|
|
|
|
run: |
|
2023-05-25 17:54:25 +02:00
|
|
|
nix run nixpkgs#hello
|
|
|
|
nix profile install nixpkgs#hello
|
|
|
|
hello
|
2023-01-13 21:18:14 +01:00
|
|
|
nix store gc
|
2023-05-25 17:54:25 +02:00
|
|
|
nix run nixpkgs#hello
|
2023-01-13 21:09:36 +01:00
|
|
|
- name: Reinstall Nix
|
|
|
|
uses: ./
|
|
|
|
with:
|
|
|
|
logger: pretty
|
|
|
|
log-directives: nix_installer=trace
|
|
|
|
backtrace: full
|
|
|
|
reinstall: true
|
2023-01-28 00:10:13 +01:00
|
|
|
extra-conf: |
|
|
|
|
use-sqlite-wal = true
|
2023-01-13 21:18:14 +01:00
|
|
|
- name: Test `nix` with `$GITHUB_PATH`
|
|
|
|
if: success() || failure()
|
|
|
|
run: |
|
2023-05-25 17:54:25 +02:00
|
|
|
nix run nixpkgs#hello
|
|
|
|
nix profile install nixpkgs#hello
|
|
|
|
hello
|
2023-01-13 21:18:14 +01:00
|
|
|
nix store gc
|
2023-05-25 17:54:25 +02:00
|
|
|
nix run nixpkgs#hello
|
2023-01-28 00:10:13 +01:00
|
|
|
- name: Verify the generated nix.conf
|
|
|
|
run: |
|
|
|
|
cat -n /etc/nix/nix.conf
|
|
|
|
grep -E "^trusted-users = .*$USER" /etc/nix/nix.conf
|
2023-01-28 00:10:13 +01:00
|
|
|
grep -E "^use-sqlite-wal = true" /etc/nix/nix.conf
|
2023-01-13 19:07:57 +01:00
|
|
|
|
|
|
|
run-x86_64-darwin:
|
|
|
|
name: Run x86_64 Darwin
|
|
|
|
runs-on: macos-12
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
2023-01-13 19:13:23 +01:00
|
|
|
- name: Install Nix
|
2023-01-13 19:07:57 +01:00
|
|
|
uses: ./
|
|
|
|
with:
|
|
|
|
logger: pretty
|
|
|
|
log-directives: nix_installer=trace
|
|
|
|
backtrace: full
|
|
|
|
- name: echo $PATH
|
|
|
|
run: echo $PATH
|
|
|
|
- name: Test `nix` with `$GITHUB_PATH`
|
|
|
|
if: success() || failure()
|
|
|
|
run: |
|
2023-05-25 17:54:25 +02:00
|
|
|
nix run nixpkgs#hello
|
|
|
|
nix profile install nixpkgs#hello
|
|
|
|
hello
|
2023-01-13 19:07:57 +01:00
|
|
|
nix store gc
|
2023-05-25 17:54:25 +02:00
|
|
|
nix run nixpkgs#hello
|
2023-01-13 19:07:57 +01: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}
|
2023-01-13 21:09:36 +01:00
|
|
|
- name: Install Nix again (noop)
|
|
|
|
uses: ./
|
|
|
|
with:
|
|
|
|
logger: pretty
|
|
|
|
log-directives: nix_installer=trace
|
|
|
|
backtrace: full
|
2023-01-13 21:18:14 +01:00
|
|
|
- name: Test `nix` with `$GITHUB_PATH`
|
|
|
|
if: success() || failure()
|
|
|
|
run: |
|
2023-05-25 17:54:25 +02:00
|
|
|
nix run nixpkgs#hello
|
|
|
|
nix profile install nixpkgs#hello
|
|
|
|
hello
|
2023-01-13 21:18:14 +01:00
|
|
|
nix store gc
|
2023-05-25 17:54:25 +02:00
|
|
|
nix run nixpkgs#hello
|
2023-01-13 21:09:36 +01:00
|
|
|
- name: Reinstall Nix
|
|
|
|
uses: ./
|
|
|
|
with:
|
|
|
|
logger: pretty
|
|
|
|
log-directives: nix_installer=trace
|
|
|
|
backtrace: full
|
|
|
|
reinstall: true
|
2023-01-28 00:10:13 +01:00
|
|
|
extra-conf: |
|
|
|
|
use-sqlite-wal = true
|
2023-01-13 21:18:14 +01:00
|
|
|
- name: Test `nix` with `$GITHUB_PATH`
|
|
|
|
if: success() || failure()
|
|
|
|
run: |
|
2023-05-25 17:54:25 +02:00
|
|
|
nix run nixpkgs#hello
|
|
|
|
nix profile install nixpkgs#hello
|
|
|
|
hello
|
2023-01-13 21:18:14 +01:00
|
|
|
nix store gc
|
2023-05-25 17:54:25 +02:00
|
|
|
nix run nixpkgs#hello
|
2023-01-28 00:10:13 +01:00
|
|
|
- name: Verify the generated nix.conf
|
|
|
|
run: |
|
2023-07-01 22:59:30 +02:00
|
|
|
cat /etc/nix/nix.conf
|
2023-01-28 00:10:13 +01:00
|
|
|
grep -E "^trusted-users = .*$USER" /etc/nix/nix.conf
|
2023-01-28 00:10:13 +01:00
|
|
|
grep -E "^use-sqlite-wal = true" /etc/nix/nix.conf
|