From a9d97b67978111cdcfbea4f4c4c31a45fef84911 Mon Sep 17 00:00:00 2001 From: Alejandro Angulo Date: Sun, 18 Sep 2022 21:07:03 -0700 Subject: [PATCH] Build all NixOS configurations --- .github/workflows/test.yml | 38 ++++++++++++++++++++++++++++++++++++-- flake.nix | 2 -- users/alejandro/zsh.nix | 1 + 3 files changed, 37 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c8b2903..f2031aa 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -3,19 +3,53 @@ on: pull_request: push: jobs: - tests: + calculate-matrix: + name: Calculate build matrix runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.set-matrix.outputs.matrix }} steps: - uses: actions/checkout@v2.4.0 + - uses: cachix/install-nix-action@v16 with: nix_path: nixpkgs=channel:nixos-unstable extra_nix_config: | experimental-features = nix-command flakes + + - name: Calculate build matrix + id: set-matrix + run: | + matrix=$(nix flake show --json | jq -c '.nixosConfigurations | keys') + echo "::set-output name=matrix::$matrix" + + tests: + name: Build NixOS configurations + runs-on: ubuntu-latest + needs: + - calculate-matrix + strategy: + fail-fast: false + matrix: + target: "${{ fromJson(needs.calculate-matrix.outputs.matrix) }}" + + + steps: + - uses: actions/checkout@v2.4.0 + + - uses: cachix/install-nix-action@v16 + with: + nix_path: nixpkgs=channel:nixos-unstable + extra_nix_config: | + experimental-features = nix-command flakes + - uses: cachix/cachix-action@v10 with: name: alejandro-dotfiles authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}' + - run: nix-env -i nixos-rebuild -f '' - - run: nixos-rebuild build --flake .#gospel + + - run: nixos-rebuild build --flake ".#${{ matrix.target }}" + - run: echo OK diff --git a/flake.nix b/flake.nix index 360fe45..924b270 100644 --- a/flake.nix +++ b/flake.nix @@ -83,7 +83,5 @@ ''; }; }; - - formatter = pkgs.alejandra; }; } diff --git a/users/alejandro/zsh.nix b/users/alejandro/zsh.nix index 76d5446..a6e05b7 100644 --- a/users/alejandro/zsh.nix +++ b/users/alejandro/zsh.nix @@ -11,6 +11,7 @@ htop ranger lsd + jq ]; programs.direnv = {