Full CI
All checks were successful
CI / Check, build and cache Nix flake (push) Successful in 27m6s

This commit is contained in:
Jack O'Sullivan 2023-11-17 15:39:31 +00:00
parent 30d07385e6
commit b231973e93
2 changed files with 15 additions and 8 deletions

View File

@ -6,7 +6,7 @@ on:
jobs: jobs:
check: check:
name: Check Nix flake name: Check, build and cache Nix flake
runs-on: ubuntu-22.04 runs-on: ubuntu-22.04
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
@ -27,10 +27,14 @@ jobs:
nix run .#nixpkgs.mine.x86_64-linux.attic-client -- \ nix run .#nixpkgs.mine.x86_64-linux.attic-client -- \
login --set-default colony https://nix-cache.nul.ie "${{ secrets.NIX_CACHE_TOKEN }}" login --set-default colony https://nix-cache.nul.ie "${{ secrets.NIX_CACHE_TOKEN }}"
# - name: Check flake - name: Check and build flake
# run: nix flake check id: build
run: |
nix flake check
path=$(nix build --no-link .#ci.x86_64-linux --json | jq -r .[0].outputs.out)
echo "path=$path" >> "$GITHUB_OUTPUT"
- name: Push to cache - name: Push to cache
run: | run: |
path=$(nix build --no-link .#nixosConfigurations.middleman.config.system.build.toplevel --json | jq -r .[0].outputs.out)
nix run .#nixpkgs.mine.x86_64-linux.attic-client -- \ nix run .#nixpkgs.mine.x86_64-linux.attic-client -- \
push main $path push main ${{ steps.build.outputs.path }}

View File

@ -51,8 +51,8 @@
... ...
}: }:
let let
inherit (builtins) mapAttrs; inherit (builtins) mapAttrs replaceStrings;
inherit (lib) genAttrs recurseIntoAttrs evalModules; inherit (lib) mapAttrs' nameValuePair recurseIntoAttrs evalModules;
inherit (lib.flake) flattenTree eachDefaultSystem; inherit (lib.flake) flattenTree eachDefaultSystem;
inherit (lib.my) mkDefaultSystemsPkgs flakePackageOverlay; inherit (lib.my) mkDefaultSystemsPkgs flakePackageOverlay;
@ -167,12 +167,15 @@
shell = pkgs.devshell.mkShell ./devshell; shell = pkgs.devshell.mkShell ./devshell;
in in
# Stuff for each platform # Stuff for each platform
{ rec {
checks = flattenTree { checks = flattenTree {
homeConfigurations = recurseIntoAttrs (mapAttrs (_: h: h.activationPackage) homeConfigurations = recurseIntoAttrs (mapAttrs (_: h: h.activationPackage)
(lib.filterAttrs (_: h: h.config.nixpkgs.system == system) self.homeConfigurations)); (lib.filterAttrs (_: h: h.config.nixpkgs.system == system) self.homeConfigurations));
deploy = recurseIntoAttrs (pkgs.deploy-rs.lib.deployChecks self.deploy); deploy = recurseIntoAttrs (pkgs.deploy-rs.lib.deployChecks self.deploy);
}; };
ci =
let drvs = mapAttrs' (n: v: nameValuePair (replaceStrings ["/"] ["-"] n) v) checks; in
pkgs.linkFarm "ci" drvs;
packages = flattenTree (import ./pkgs { inherit lib pkgs; }); packages = flattenTree (import ./pkgs { inherit lib pkgs; });