Skip to content

Commit

Permalink
Update to nixos 23.11
Browse files Browse the repository at this point in the history
  • Loading branch information
jbboehr committed Apr 7, 2024
1 parent c270cba commit d909c63
Show file tree
Hide file tree
Showing 8 changed files with 455 additions and 299 deletions.
1 change: 1 addition & 0 deletions .envrc
@@ -0,0 +1 @@
use flake
93 changes: 63 additions & 30 deletions .github/workflows/ci.yml
Expand Up @@ -5,8 +5,7 @@ on:
branches:
- master
- dev-1.x
- github-actions
- ci
- develop
pull_request:
branches:
- master
Expand All @@ -18,10 +17,9 @@ jobs:
fail-fast: false
matrix:
PHP_VERSION:
- "7.4"
- "8.0"
- "8.1"
- "8.2"
- "8.3"
COVERAGE: ["true", "false"]
steps:
- uses: actions/checkout@v3
Expand All @@ -45,8 +43,9 @@ jobs:
fail-fast: false
matrix:
PHP_VERSION:
- "8.0"
- "8.1"
- "8.2"
- "8.3"
steps:
- uses: actions/checkout@v3
with:
Expand All @@ -62,10 +61,9 @@ jobs:
fail-fast: false
matrix:
PHP_VERSION:
- "7.4"
- "8.0"
- "8.1"
- "8.2-rc"
- "8.2"
- "8.3"
steps:
- uses: actions/checkout@v3
with:
Expand All @@ -82,10 +80,9 @@ jobs:
fail-fast: false
matrix:
PHP_VERSION:
- "7.4"
- "8.0"
- "8.1"
- "8.2-rc"
- "8.2"
- "8.3"
steps:
- uses: actions/checkout@v3
with:
Expand All @@ -108,26 +105,62 @@ jobs:
TEST_PHP_EXECUTABLE: /usr/bin/php
run: bash ./.github/scripts/docker.sh

nix:
nix-matrix:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- uses: cachix/install-nix-action@v18
with:
nix_path: nixpkgs=channel:nixos-22.05
- run: nix-build
- run: nix-build nix/ci.nix
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v26
- id: set-matrix
name: Generate Nix Matrix
run: |
set -Eeu
matrix="$(nix eval --json '.#githubActions.matrix')"
echo "matrix=$matrix" >> "$GITHUB_OUTPUT"
nix-flake:
runs-on: ubuntu-latest
nix:
name: "nix (${{ matrix.name }})"
runs-on: ${{ matrix.os }}
needs: nix-matrix
strategy:
matrix: ${{fromJSON(needs.nix-matrix.outputs.matrix)}}
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- uses: cachix/install-nix-action@v18
with:
nix_path: nixpkgs=channel:nixos-22.05
- run: nix build
- run: nix flake check
- uses: actions/checkout@v4

- name: Set Up Build Cache
uses: actions/cache@v4
id: nix-cache
with:
path: /tmp/nix-store.nar
key: nix-store.nar-${{ runner.os }}-${{ hashFiles('flake.lock') }}-${{ matrix.attr }}
restore-keys: |
nix-store.nar-${{ runner.os }}-${{ hashFiles('flake.lock') }}-${{ matrix.attr }}
nix-store.nar-${{ runner.os }}-${{ hashFiles('flake.lock') }}-
nix-store.nar-${{ runner.os }}-
- uses: cachix/install-nix-action@v26
with:
nix_path: nixpkgs=channel:nixos-23.11
extra_nix_config: "system-features = nixos-test benchmark big-parallel kvm"

- name: Import Nix Store Cache
if: "steps.nix-cache.outputs.cache-hit == 'true'"
run: |
nix-store --import < /tmp/nix-store.nar
- run: sudo sysctl -w kernel.perf_event_paranoid=1

- run: nix build -L ".#${{ matrix.attr }}"

- name: Export Nix Store Cache
shell: bash
# partially based on https://github.com/NixOS/nix/issues/1245#issuecomment-282586759
run: |
drv="$(nix-store -qd "$(readlink result)")"
drvRefs="$( echo "$drv" | xargs nix-store -q --references )"
( echo "$drvRefs" | grep '[.]drv$' | xargs nix-store -q --outputs ;
echo "$drvRefs" | grep -v '[.]drv$' ) | \
xargs nix-store -r | \
xargs nix-store -qR |
xargs nix-store --export > /tmp/nix-store.nar
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -20,6 +20,7 @@ configure.in
coverage.info
*.dep
.deps
.direnv
.dirstamp
gmon*
.idea
Expand Down
65 changes: 0 additions & 65 deletions default.nix

This file was deleted.

0 comments on commit d909c63

Please sign in to comment.