2323                    - " 8.1" 
2424                    - " 8.2" 
2525                    - " 8.3" 
26+                     - " 8.4" 
2627        steps :
2728            -   uses : actions/checkout@v4 
2829
6263                    - " 8.1" 
6364                    - " 8.2" 
6465                    - " 8.3" 
66+                     - " 8.4" 
6567        steps :
6668            -   uses : actions/checkout@v4 
6769
@@ -126,8 +128,26 @@ jobs:
126128                with :
127129                    parallel-finished : true 
128130
129-     nix :
131+     nix-matrix  :
130132        runs-on : ubuntu-latest 
133+         outputs :
134+             matrix : ${{ steps.set-matrix.outputs.matrix }} 
135+         steps :
136+             -   uses : actions/checkout@v4 
137+             -   uses : cachix/install-nix-action@v27 
138+             -   id : set-matrix 
139+                 name : Generate Nix Matrix 
140+                 run : | 
141+                     set -Eeu 
142+                     matrix="$(nix eval --json '.#githubActions.matrix')" 
143+                     echo "matrix=$matrix" >> "$GITHUB_OUTPUT" 
144+ 
145+ nix :
146+         name : " nix (${{ matrix.name }})" 
147+         runs-on : ${{ matrix.os }} 
148+         needs : nix-matrix 
149+         strategy :
150+             matrix : ${{fromJSON(needs.nix-matrix.outputs.matrix)}} 
131151        steps :
132152            -   uses : actions/checkout@v4 
133153
@@ -136,34 +156,50 @@ jobs:
136156                id : nix-cache 
137157                with :
138158                    path : /tmp/nix-store.nar 
139-                     key : nix-store.nar-${{ runner.os }}-${{ hashFiles('flake.nix', 'flake.lock') }} 
140-                     restore-keys : nix-store.nar-${{ runner.os }}- 
159+                     key : nix-store.nar-${{ runner.os }}-${{ hashFiles('flake.lock') }}-${{ matrix.attr }} 
160+                     restore-keys : | 
161+                         nix-store.nar-${{ runner.os }}-${{ hashFiles('flake.lock') }}-${{ matrix.attr }} 
162+                         nix-store.nar-${{ runner.os }}-${{ hashFiles('flake.lock') }}- 
163+                         nix-store.nar-${{ runner.os }}- 
141164
142-             -   uses : cachix/install-nix-action@V27  
165+ uses : cachix/install-nix-action@v27  
143166                with :
144-                     nix_path : nixpkgs=channel:nixos-23.11  
167+                     nix_path : nixpkgs=channel:nixos-24.05  
145168
146169            -   name : Import Nix Store Cache 
147170                if : " steps.nix-cache.outputs.cache-hit == 'true'" 
148171                run : | 
149172                    nix-store --import < /tmp/nix-store.nar 
150173
151- name : nix build -L 
152-                 run : | 
153-                     nix eval .#packages --impure --raw --apply '(import ./.github/attrs.nix { prefix = ".#packages"; })' \ 
154-                         | xargs nix build -L 
155- 
156- run : nix flake check -L 
174+ run : nix build -L ".#${{ matrix.attr }}" 
175+ 
176+             -   run : find -L result*; cp result-coverage/coverage.info coverage.info || true 
177+ 
178+ #             -   name: Upload coverage reports to Codecov
179+ #                 if: ${{ hashFiles('coverage.info') != '' }}
180+ #                 uses: codecov/codecov-action@v4
181+ #                 with:
182+ #                     file: coverage.info
183+ #                     token: ${{ secrets.CODECOV_TOKEN }}
184+ #                     slug: jbboehr/php-perfifidous
185+ # 
186+ #             -   name: Coveralls
187+ #                 if: ${{ hashFiles('coverage.info') != '' }}
188+ #                 uses: coverallsapp/github-action@v2
189+ #                 continue-on-error: true
190+ #                 with:
191+ #                     file: coverage.info
192+ #                     format: lcov
193+ #                     parallel: true
157194
158195            -   name : Export Nix Store Cache 
159196                shell : bash 
197+                 #  partially based on https://github.com/NixOS/nix/issues/1245#issuecomment-282586759
160198                run : | 
161-                     packages= 
162-                     packages+=$(nix eval .#packages --impure --raw --apply '(import ./.github/attrs.nix { prefix = ".#packages"; })') 
163-                     packages+=$'\n' 
164-                     packages+=$(nix eval .#checks --impure --raw --apply '(import ./.github/attrs.nix { prefix = ".#checks"; })') 
165-                     echo "$packages" \ 
166-                         | xargs -I{} bash -c 'nix eval --raw {} && echo' \ 
167-                         | grep -v pre-commit-run \ 
168-                         | xargs nix-store -qR \ 
169-                         | xargs nix-store --export > /tmp/nix-store.nar 
199+                     drv="$(nix-store -qd "$(readlink result)")" 
200+                     drvRefs="$( echo "$drv" | xargs nix-store -q --references )" 
201+                     ( echo "$drvRefs" | grep '[.]drv$' | xargs nix-store -q --outputs ; 
202+                       echo "$drvRefs" | grep -v '[.]drv$' ) | \ 
203+                         xargs nix-store -r | \ 
204+                         xargs nix-store -qR | 
205+                         xargs nix-store --export > /tmp/nix-store.nar 
0 commit comments