Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DETERMINATE_NIX_KVM fixup, support Magic Nix Cache + FlakeHub Cache on Namespace runners #72

Merged
merged 16 commits into from
Mar 11, 2024
Merged
29 changes: 24 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,18 @@ jobs:
- run: npm run all
- run: git status --porcelain=v1
- run: test $(git status --porcelain=v1 2>/dev/null | wc -l) -eq 0
run-x86_64-linux:
name: Run x86_64 Linux
run-test-suite:
name: Run test suite
strategy:
matrix:
runner:
- ubuntu-latest
- nscloud-ubuntu-22.04-amd64-4x16
- namespace-profile-default-arm64
- ubuntu-latest
- nscloud-ubuntu-22.04-amd64-4x16
- namespace-profile-default-arm64
runs-on: ${{ matrix.runner }}
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v3
- name: Install Nix
Expand All @@ -33,8 +36,15 @@ jobs:
logger: pretty
log-directives: nix_installer=trace
backtrace: full
- uses: DeterminateSystems/magic-nix-cache-action@main
- name: echo $PATH
run: echo $PATH

- name: Render the devshell
if: success() || failure()
run: |
nix develop --command date

- name: Test `nix` with `$GITHUB_PATH`
if: success() || failure()
run: |
Expand All @@ -43,6 +53,7 @@ jobs:
hello
nix store gc
nix run nixpkgs#hello

- name: Test bash
run: nix-instantiate -E 'builtins.currentTime' --eval
if: success() || failure()
Expand Down Expand Up @@ -91,6 +102,9 @@ jobs:
run-x86_64-darwin:
name: Run x86_64 Darwin
runs-on: macos-12
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v3
- name: Install Nix
Expand All @@ -99,6 +113,7 @@ jobs:
logger: pretty
log-directives: nix_installer=trace
backtrace: full
- uses: DeterminateSystems/magic-nix-cache-action@main
- name: echo $PATH
run: echo $PATH
- name: Test `nix` with `$GITHUB_PATH`
Expand Down Expand Up @@ -135,6 +150,10 @@ jobs:
hello
nix store gc
nix run nixpkgs#hello
- name: Terminate the magic nix cache pre-reinstall
if: success() || failure()
run: |
pkill magic-nix-cache
- name: Reinstall Nix
uses: ./
with:
Expand Down
8 changes: 7 additions & 1 deletion dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

outputs = { self, flake-schemas, nixpkgs }:
let
supportedSystems = [ "x86_64-linux" "aarch64-darwin" ];
supportedSystems = [ "x86_64-linux" "aarch64-darwin" "aarch64-linux" "x86_64-darwin" ];
forEachSupportedSystem = f: nixpkgs.lib.genAttrs supportedSystems (system: f {
pkgs = import nixpkgs { inherit system; };
});
Expand Down
9 changes: 7 additions & 2 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -513,8 +513,6 @@ class NixInstallerAction {
actions_core.info("KVM is not available.");
actions_core.exportVariable("DETERMINATE_NIX_KVM", "0");
}

actions_core.exportVariable("DETERMINATE_NIX_KVM", "0");
}

// Normal just doing of the install
Expand Down Expand Up @@ -587,9 +585,16 @@ class NixInstallerAction {
"run",
"--detach",
"--privileged",
"--network=host",
"--userns=host",
"--pid=host",
"--mount",
"type=bind,src=/bin,dst=/bin,readonly",
"--mount",
"type=bind,src=/lib,dst=/lib,readonly",
"--mount",
"type=bind,src=/home,dst=/home,readonly",
"--mount",
"type=bind,src=/tmp,dst=/tmp",
"--mount",
"type=bind,src=/nix,dst=/nix",
Expand Down
Loading