diff --git a/.github/workflows/nixpkgs-ci.yml b/.github/workflows/nixpkgs-ci.yml index de233df..c0fefc1 100644 --- a/.github/workflows/nixpkgs-ci.yml +++ b/.github/workflows/nixpkgs-ci.yml @@ -8,12 +8,35 @@ on: branches: [ master ] jobs: - nix-build: + get-ghc-versions: + name: Determine GHC versions to test runs-on: ubuntu-latest + outputs: + versions: ${{ steps.get-ghc-versions-step.outputs.versions }} + steps: - uses: actions/checkout@v4.2.2 - uses: cachix/install-nix-action@v30 with: nix_path: nixpkgs=channel:nixos-unstable - - name: ci.nix - run: nix-build ci.nix + - name: Get GHC Versions from ci.nix + id: get-ghc-versions-step + run: | + echo -n "versions=" >> "$GITHUB_OUTPUT" + nix-instantiate --eval --strict --json -E 'builtins.attrNames (import ./ci.nix { })' >> "$GITHUB_OUTPUT" + + nix-build: + runs-on: ubuntu-latest + needs: + - get-ghc-versions + strategy: + matrix: + version: ${{ fromJSON(needs.get-ghc-versions.outputs.versions) }} + - uses: actions/checkout@v4.2.2 + - uses: cachix/install-nix-action@v30 + with: + nix_path: nixpkgs=channel:nixos-unstable + - name: nix-build ci.nix -A ${{ matrix.version }} + run: | + nix-build -A ${{ matrix.version }} + nix-store --gc