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

fix: always restore cache after Nix install #32

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 10 additions & 11 deletions discover/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,16 @@ outputs:
runs:
using: "composite"
steps:
- name: Install Nix
uses: nixbuild/nix-quick-install-action@v21
if: startsWith(runner.name, 'discovery') == false
with:
nix_conf: |
experimental-features = nix-command flakes
accept-flake-config = true
trusted-users = runner
access-tokens = github.com=${{ inputs.github_pat }}

- name: Cache Nix Store
id: cache-nix
if: startsWith(runner.name, 'discovery') == false
Expand All @@ -32,17 +42,6 @@ runs:
discovery-${{ runner.os }}-${{ runner.arch }}-${{ github.ref }}-
discovery-${{ runner.os }}-${{ runner.arch }}-


- name: Install Nix
uses: nixbuild/nix-quick-install-action@v21
if: startsWith(runner.name, 'discovery') == false
with:
nix_conf: |
experimental-features = nix-command flakes
accept-flake-config = true
trusted-users = runner
access-tokens = github.com=${{ inputs.github_pat }}

- name: Discover
id: eval
env:
Expand Down
13 changes: 1 addition & 12 deletions run/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,17 +74,6 @@ runs:
sudo chmod 0600 ~/.ssh/known_hosts
shell: bash

- name: Restore Cache & Discovery Results
id: restore-cache
if: inputs.discovery_ssh == 'none' && runner.os != 'macOS'
uses: divnix/[email protected]
with:
path: |
/nix
~/.cache/nix
~root/.cache/nix
key: discovery-${{ runner.os }}-${{ runner.arch }}-${{ github.ref }}-${{ github.sha }}

- name: Install Nix
uses: nixbuild/nix-quick-install-action@v21
with:
Expand All @@ -98,7 +87,7 @@ runs:

- name: Restore Cache & Discovery Results
id: restore-cache-mac
if: inputs.discovery_ssh == 'none' && runner.os == 'macOS'
if: inputs.discovery_ssh == 'none'
uses: divnix/[email protected]
with:
path: |
Expand Down