diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 07a08ee5..bbfc1c66 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -3,17 +3,23 @@ on: push: branches: [develop] + jobs: - lints: - name: Build - runs-on: ubuntu-22.04 + os-configurations: + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, macos-latest, macos-13] + name: OS configurations + runs-on: ${{ matrix.os }} permissions: id-token: "write" contents: "read" steps: - - uses: actions/checkout@v4 - - uses: DeterminateSystems/nix-installer-action@main - - uses: DeterminateSystems/magic-nix-cache-action@main - - uses: DeterminateSystems/flake-checker-action@main - # - name: Run `nix build` - # run: nix build . + - uses: actions/checkout@v4 + - uses: DeterminateSystems/nix-installer-action@main + - uses: DeterminateSystems/magic-nix-cache-action@main + - uses: DeterminateSystems/flake-checker-action@main + - run: | + nix build .#build-os-configurations + ls -lha result/ diff --git a/flake.nix b/flake.nix index ff1cd810..7bb5499b 100644 --- a/flake.nix +++ b/flake.nix @@ -86,9 +86,7 @@ tx5.url = "github:holochain/tx5/tx5-signal-srv-v0.0.8-alpha"; tx5.flake = false; - sbd.url = - "github:holochain/sbd/sbd-server-v0.0.4-alpha" - ; + sbd.url = "github:holochain/sbd/sbd-server-v0.0.4-alpha"; sbd.flake = false; holochain-versions.url = "github:holochain/holochain?dir=versions/weekly"; @@ -134,6 +132,7 @@ inputs', pkgs, lib, + system, ... }: { # Per-system attributes can be defined here. The self' and inputs' @@ -210,11 +209,36 @@ ''; }; - packages = { - nomad = inputs'.nixpkgs.legacyPackages.nomad_1_6; - - nixos-anywhere = inputs'.nixos-anywhere.packages.default; - }; + packages = + { + # nomad = pkgs.nomad_1_6; + + nixos-anywhere = inputs'.nixos-anywhere.packages.default; + } + // ( + let + mkOsConfigCheck = osConfigs: let + filteredBySystem = lib.filterAttrs (key: value: value.pkgs.system == system) osConfigs; + asStrings = lib.mapAttrsToList (key: value: builtins.trace "evaluating ${key} (${value.pkgs.system})..." "ln -s ${value.config.system.build.toplevel} $out/") filteredBySystem; + in + pkgs.stdenv.mkDerivation { + name = "check-osconfigurations"; + phases = "installPhase"; + installPhase = "mkdir $out;" + builtins.concatStringsSep "\n" asStrings; + }; + in { + build-os-configurations = + if pkgs.stdenv.isLinux + then + mkOsConfigCheck (builtins.removeAttrs self.nixosConfigurations [ + # too big for current CI structure and rarely used + "vm-nixcache" + ]) + else if pkgs.stdenv.isDarwin + then mkOsConfigCheck self.nixosConfigurations + else throw "unexpected case"; + } + ); }; flake = { # The usual flake attributes can be defined here, including system-