1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-08 19:46:02 +01:00

ci: Run sanitizer tests in a separate job

This should speed up the CI somewhat by parallelizing
the work across the matrix of configurations.
This commit is contained in:
Sergei Zimmerman 2025-07-28 23:07:59 +03:00
parent 9c9473aa9b
commit 413f782176
No known key found for this signature in database
4 changed files with 24 additions and 21 deletions

View file

@ -29,9 +29,18 @@ jobs:
- scenario: on ubuntu - scenario: on ubuntu
runs-on: ubuntu-24.04 runs-on: ubuntu-24.04
os: linux os: linux
sanitizers: false
primary: true
- scenario: on macos - scenario: on macos
runs-on: macos-14 runs-on: macos-14
os: darwin os: darwin
sanitizers: false
primary: true
- scenario: on ubuntu (with sanitizers)
runs-on: ubuntu-24.04
os: linux
sanitizers: true
primary: false
name: tests ${{ matrix.scenario }} name: tests ${{ matrix.scenario }}
runs-on: ${{ matrix.runs-on }} runs-on: ${{ matrix.runs-on }}
timeout-minutes: 60 timeout-minutes: 60
@ -52,13 +61,21 @@ jobs:
# https://ubuntu.com/blog/ubuntu-23-10-restricted-unprivileged-user-namespaces # https://ubuntu.com/blog/ubuntu-23-10-restricted-unprivileged-user-namespaces
- run: sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0 - run: sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0
if: matrix.os == 'linux' if: matrix.os == 'linux'
- run: scripts/build-checks - name: Run component tests
- run: scripts/prepare-installer-for-github-actions run: |
nix build --file ci/gha/tests componentTests -L \
--arg withSanitizers ${{ matrix.sanitizers }}
- name: Run flake checks and prepare the installer tarball
run: |
ci/gha/tests/build-checks
ci/gha/tests/prepare-installer-for-github-actions
if: ${{ matrix.primary }}
- name: Upload installer tarball - name: Upload installer tarball
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4
with: with:
name: installer-${{matrix.os}} name: installer-${{matrix.os}}
path: out/* path: out/*
if: ${{ matrix.primary }}
installer_test: installer_test:
needs: [tests] needs: [tests]

View file

@ -337,25 +337,11 @@
# Add "passthru" tests # Add "passthru" tests
// //
flatMapAttrs flatMapAttrs
( {
{ "" = {
"" = { pkgs = nixpkgsFor.${system}.native;
pkgs = nixpkgsFor.${system}.native; };
}; }
}
// lib.optionalAttrs (!nixpkgsFor.${system}.native.stdenv.hostPlatform.isDarwin) {
# TODO: enable static builds for darwin, blocked on:
# https://github.com/NixOS/nixpkgs/issues/320448
# TODO: disabled to speed up GHA CI.
# "static-" = {
# pkgs = nixpkgsFor.${system}.native.pkgsStatic;
# };
"sanitized-" = {
pkgs = nixpkgsFor.${system}.native;
withSanitizers = true;
};
}
)
( (
nixpkgsPrefix: args: nixpkgsPrefix: args:
(import ./ci/gha/tests ( (import ./ci/gha/tests (