-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
run: pull target from Nix cache with new input
Pulling a single derivation and its deps from a Nix cache is a lot faster than pulling the entire /nix/store produced by the discovery phase, so allow us to skip the GitHub cache restoration if they are available.
- Loading branch information
Showing
3 changed files
with
14 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,6 +18,9 @@ inputs: | |
json: | ||
description: "JSON describing the action, found in the discovery phase." | ||
required: true | ||
cached: | ||
description: "Boolean marking whether to pull discovery artifacts from the Nix cache." | ||
required: false | ||
extra_nix_config: | ||
description: "Configuration to append to the nix.conf." | ||
required: false | ||
|
@@ -42,6 +45,7 @@ runs: | |
shell: bash | ||
|
||
- name: Restore Cache & Discovery Results | ||
if: inputs.cached != 'true' || inputs.cache == 'auto' | ||
id: restore-cache | ||
uses: divnix/[email protected] | ||
with: | ||
|
@@ -61,6 +65,11 @@ runs: | |
secret-key-files = ${{ env.NIX_KEY_PATH }} | ||
${{ inputs.extra_nix_config }} | ||
- name: Pull Target from Nix Cache | ||
if: inputs.cached == 'true' && inputs.cache != 'auto' | ||
run: nix copy --derivation --from ${{ inputs.cache }} ${{ fromJSON(env.JSON).targetDrv }} | ||
shell: bash | ||
|
||
- name: Build ${{ fromJSON(env.JSON).name }} | ||
id: build | ||
run: | | ||
|