Add nix flake submodule prefetch
This commit is contained in:
parent
fe38fa67fc
commit
2ac1137284
1 changed files with 7 additions and 3 deletions
10
action.yml
10
action.yml
|
@ -1,4 +1,4 @@
|
||||||
name: 'Initialize CI Environment and Repository'
|
name: 'Initialize CI Environment and Repository for Flake Builds'
|
||||||
description: 'Initialize a CI environment with nix (and also checkout the repository recursively with LFS)'
|
description: 'Initialize a CI environment with nix (and also checkout the repository recursively with LFS)'
|
||||||
inputs:
|
inputs:
|
||||||
token:
|
token:
|
||||||
|
@ -6,7 +6,7 @@ inputs:
|
||||||
required: false
|
required: false
|
||||||
default: ${{ github.token }}
|
default: ${{ github.token }}
|
||||||
lfs:
|
lfs:
|
||||||
description: 'Whether to enable lfs'
|
description: Whether to enable lfs. Note that nix flakes don't support LFS currently.
|
||||||
required: false
|
required: false
|
||||||
default: true
|
default: true
|
||||||
runs:
|
runs:
|
||||||
|
@ -27,4 +27,8 @@ runs:
|
||||||
echo -e "machine $GIT_SERVER\nlogin oauth2\npassword ${{ inputs.token }}" > ~/.netrc
|
echo -e "machine $GIT_SERVER\nlogin oauth2\npassword ${{ inputs.token }}" > ~/.netrc
|
||||||
# Disable clone protection to pull LFS as well
|
# Disable clone protection to pull LFS as well
|
||||||
GIT_CLONE_PROTECTION_ACTIVE=false git clone --branch $GITHUB_REF_NAME --recurse-submodules $GITHUB_SERVER_URL/$GITHUB_REPOSITORY .
|
GIT_CLONE_PROTECTION_ACTIVE=false git clone --branch $GITHUB_REF_NAME --recurse-submodules $GITHUB_SERVER_URL/$GITHUB_REPOSITORY .
|
||||||
git submodule update --init
|
git submodule update --init --recursive
|
||||||
|
|
||||||
|
- name: Prefetch git submodules in nix store
|
||||||
|
shell: "nix shell nixpkgs#nixVersions.nix_2_26 nixpkgs#git-lfs --command {0}"
|
||||||
|
run: git submodule foreach --recursive 'nix flake prefetch'
|
||||||
|
|
Loading…
Add table
Reference in a new issue