ci: Build and cache CI jobs individually
Some checks failed
CI / Check, build and cache Nix flake (push) Failing after 4m20s
Some checks failed
CI / Check, build and cache Nix flake (push) Failing after 4m20s
This commit is contained in:
parent
6c98ef8944
commit
f2271ec354
@ -25,15 +25,19 @@ jobs:
|
|||||||
extra-trusted-public-keys = nix-cache.nul.ie-1:BzH5yMfF4HbzY1C977XzOxoPhEc9Zbu39ftPkUbH+m4=
|
extra-trusted-public-keys = nix-cache.nul.ie-1:BzH5yMfF4HbzY1C977XzOxoPhEc9Zbu39ftPkUbH+m4=
|
||||||
|
|
||||||
- name: Check flake
|
- name: Check flake
|
||||||
run: nix flake check
|
run: nix flake check --no-build
|
||||||
- name: Build the world
|
- name: Build (and cache) the world
|
||||||
id: build
|
id: build
|
||||||
run: |
|
|
||||||
path=$(nix build --no-link .#ci.x86_64-linux --json | jq -r .[0].outputs.out)
|
|
||||||
echo "path=$path" >> "$GITHUB_OUTPUT"
|
|
||||||
|
|
||||||
- name: Push to cache
|
|
||||||
env:
|
env:
|
||||||
HARMONIA_SSH_KEY: ${{ secrets.HARMONIA_SSH_KEY }}
|
HARMONIA_SSH_KEY: ${{ secrets.HARMONIA_SSH_KEY }}
|
||||||
run: |
|
run: |
|
||||||
ci/push-to-cache.sh "${{ steps.build.outputs.path }}"
|
nix eval --json --apply "builtins.attrNames" | jq -cr '.[]' | while read job; do
|
||||||
|
echo "Building $job"
|
||||||
|
path="$(nix build --no-link .#ci.x86_64-linux."$job" --json | jq -r .[0].outputs.out)"
|
||||||
|
echo "Caching $job"
|
||||||
|
ci/push-to-cache.sh "$path"
|
||||||
|
done
|
||||||
|
|
||||||
|
echo "Building and caching CI derivation"
|
||||||
|
path="$(nix build --no-link .#ciDrv.x86_64-linux --json | jq -r .[0].outputs.out)"
|
||||||
|
UPDATE_PROFILE=1 ci/push-to-cache.sh "$path"
|
||||||
|
@ -22,8 +22,10 @@ path="$1"
|
|||||||
echo "Pushing $path to cache..."
|
echo "Pushing $path to cache..."
|
||||||
nix copy --no-check-sigs --to "$STORE_URI" "$path"
|
nix copy --no-check-sigs --to "$STORE_URI" "$path"
|
||||||
|
|
||||||
echo "Updating profile..."
|
if [ -n "$UPDATE_PROFILE" ]; then
|
||||||
remote_cmd nix-env -p "$REMOTE_STORE"/nix/var/nix/profiles/nixfiles --set "$path"
|
echo "Updating profile..."
|
||||||
|
remote_cmd nix-env -p "$REMOTE_STORE"/nix/var/nix/profiles/nixfiles --set "$path"
|
||||||
|
|
||||||
echo "Collecting garbage..."
|
echo "Collecting garbage..."
|
||||||
remote_cmd nix-collect-garbage --delete-older-than 30d
|
remote_cmd nix-collect-garbage --delete-older-than 60d
|
||||||
|
fi
|
||||||
|
@ -204,8 +204,9 @@
|
|||||||
systems' = mapAttrs' (n: v: nameValuePair "system-${n}" v) systems;
|
systems' = mapAttrs' (n: v: nameValuePair "system-${n}" v) systems;
|
||||||
packages' = mapAttrs' (n: v: nameValuePair "package-${n}" v) packages;
|
packages' = mapAttrs' (n: v: nameValuePair "package-${n}" v) packages;
|
||||||
in
|
in
|
||||||
pkgs.linkFarm "ci" (homes' // systems' // packages' // {
|
homes' // systems' // packages' // {
|
||||||
inherit shell;
|
inherit shell;
|
||||||
});
|
};
|
||||||
|
ciDrv = pkgs.linkFarm "ci" ci;
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user