mirror of
https://github.com/cachix/install-nix-action.git
synced 2025-09-21 15:49:12 +00:00
tests: refactor tests to run under a single matrix
Add additional os versions for both linux and macos.
This commit is contained in:
parent
7449e8905b
commit
e70da05cd5
2 changed files with 116 additions and 124 deletions
94
.github/workflows/test-per-system.yml
vendored
Normal file
94
.github/workflows/test-per-system.yml
vendored
Normal file
|
@ -0,0 +1,94 @@
|
||||||
|
name: Test Runner
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_call:
|
||||||
|
inputs:
|
||||||
|
runs-on:
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
system:
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
installer_version:
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
|
||||||
|
env:
|
||||||
|
nixpkgs_channel: nixpkgs=channel:nixos-25.05
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
simple-build:
|
||||||
|
runs-on: ${{ inputs.runs-on }}
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
||||||
|
- name: Install Nix
|
||||||
|
uses: ./
|
||||||
|
with:
|
||||||
|
nix_path: ${{ env.nixpkgs_channel }}
|
||||||
|
- name: Test environment variables
|
||||||
|
run: ./tests/test-env.sh
|
||||||
|
- run: nix-env -iA cachix -f https://cachix.org/api/v1/install
|
||||||
|
- run: cat /etc/nix/nix.conf
|
||||||
|
# cachix should be available and be able to configure a cache
|
||||||
|
- run: cachix use cachix
|
||||||
|
- run: nix-build tests/test-build.nix
|
||||||
|
|
||||||
|
custom-nix-path:
|
||||||
|
runs-on: ${{ inputs.runs-on }}
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
||||||
|
- name: Install Nix
|
||||||
|
uses: ./
|
||||||
|
with:
|
||||||
|
nix_path: ${{ env.nixpkgs_channel }}
|
||||||
|
- run: test $NIX_PATH == '${{ env.nixpkgs_channel }}'
|
||||||
|
- run: nix-build tests/test-build.nix
|
||||||
|
|
||||||
|
extra-nix-config:
|
||||||
|
runs-on: ${{ inputs.runs-on }}
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
||||||
|
- name: Install Nix
|
||||||
|
uses: ./
|
||||||
|
with:
|
||||||
|
nix_path: ${{ env.nixpkgs_channel }}
|
||||||
|
extra_nix_config: |
|
||||||
|
sandbox = relaxed
|
||||||
|
- run: cat /etc/nix/nix.conf
|
||||||
|
- run: nix-build tests/test-build.nix --arg noChroot true
|
||||||
|
|
||||||
|
flakes:
|
||||||
|
runs-on: ${{ inputs.runs-on }}
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
||||||
|
- name: Install Nix
|
||||||
|
uses: ./
|
||||||
|
- run: nix flake show github:NixOS/nixpkgs
|
||||||
|
|
||||||
|
latest-installer:
|
||||||
|
runs-on: ${{ inputs.runs-on }}
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
||||||
|
- name: Run NAR server
|
||||||
|
run: |
|
||||||
|
curl --location https://github.com/cachix/nar-toolbox/releases/download/v0.1.0/nar-toolbox-${{ inputs.system }} -O
|
||||||
|
chmod +x ./nar-toolbox-${{ inputs.system }}
|
||||||
|
./nar-toolbox-${{ inputs.system }} serve https://cache.nixos.org &
|
||||||
|
- name: Install Nix
|
||||||
|
uses: ./
|
||||||
|
with:
|
||||||
|
nix_path: ${{ env.nixpkgs_channel }}
|
||||||
|
install_url: https://hydra.nixos.org/job/nix/master/installerScript/latest-finished/download/1/install
|
||||||
|
install_options: "--tarball-url-prefix http://localhost:8080"
|
||||||
|
- run: nix-build tests/test-build.nix
|
||||||
|
|
||||||
|
oldest-supported-installer:
|
||||||
|
runs-on: ${{ inputs.runs-on }}
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
||||||
|
- name: Install Nix
|
||||||
|
uses: ./
|
||||||
|
with:
|
||||||
|
nix_path: ${{ env.nixpkgs_channel }}
|
||||||
|
install_url: https://releases.nixos.org/nix/${{ inputs.installer_version }}/install
|
||||||
|
- run: nix-build tests/test-build.nix
|
146
.github/workflows/test.yml
vendored
146
.github/workflows/test.yml
vendored
|
@ -10,145 +10,43 @@ env:
|
||||||
nixpkgs_channel: nixpkgs=channel:nixos-25.05
|
nixpkgs_channel: nixpkgs=channel:nixos-25.05
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
simple-build:
|
test:
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
os:
|
|
||||||
- ubuntu-latest
|
|
||||||
- ubuntu-24.04-arm
|
|
||||||
- macos-latest
|
|
||||||
- macos-13
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
|
||||||
- name: Install Nix
|
|
||||||
uses: ./
|
|
||||||
with:
|
|
||||||
nix_path: ${{ env.nixpkgs_channel }}
|
|
||||||
- name: Test environment variables
|
|
||||||
run: ./tests/test-env.sh
|
|
||||||
- run: nix-env -iA cachix -f https://cachix.org/api/v1/install
|
|
||||||
- run: cat /etc/nix/nix.conf
|
|
||||||
# cachix should be available and be able to configure a cache
|
|
||||||
- run: cachix use cachix
|
|
||||||
- run: nix-build tests/test-build.nix
|
|
||||||
|
|
||||||
custom-nix-path:
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
os:
|
|
||||||
- ubuntu-latest
|
|
||||||
- ubuntu-24.04-arm
|
|
||||||
- macos-latest
|
|
||||||
- macos-13
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
|
||||||
- name: Install Nix
|
|
||||||
uses: ./
|
|
||||||
with:
|
|
||||||
nix_path: ${{ env.nixpkgs_channel }}
|
|
||||||
- run: test $NIX_PATH == '${{ env.nixpkgs_channel }}'
|
|
||||||
- run: nix-build tests/test-build.nix
|
|
||||||
|
|
||||||
extra-nix-config:
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
os:
|
|
||||||
- ubuntu-latest
|
|
||||||
- ubuntu-24.04-arm
|
|
||||||
- macos-latest
|
|
||||||
- macos-13
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
|
||||||
- name: Install Nix
|
|
||||||
uses: ./
|
|
||||||
with:
|
|
||||||
nix_path: ${{ env.nixpkgs_channel }}
|
|
||||||
extra_nix_config: |
|
|
||||||
sandbox = relaxed
|
|
||||||
- run: cat /etc/nix/nix.conf
|
|
||||||
- run: nix-build tests/test-build.nix --arg noChroot true
|
|
||||||
|
|
||||||
flakes:
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
os:
|
|
||||||
- ubuntu-latest
|
|
||||||
- ubuntu-24.04-arm
|
|
||||||
- macos-latest
|
|
||||||
- macos-13
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
|
||||||
- name: Install Nix
|
|
||||||
uses: ./
|
|
||||||
- run: nix flake show github:NixOS/nixpkgs
|
|
||||||
|
|
||||||
latest-installer:
|
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
include:
|
include:
|
||||||
- os: ubuntu-latest
|
- os: ubuntu-latest
|
||||||
system: x86_64-linux
|
system: x86_64-linux
|
||||||
|
installer_version: nix-2.8.0
|
||||||
- os: ubuntu-24.04-arm
|
- os: ubuntu-24.04-arm
|
||||||
system: aarch64-linux
|
system: aarch64-linux
|
||||||
|
installer_version: nix-2.8.0
|
||||||
|
- os: ubuntu-22.04
|
||||||
|
system: x86_64-linux
|
||||||
|
installer_version: nix-2.8.0
|
||||||
- os: macos-latest
|
- os: macos-latest
|
||||||
system: aarch64-darwin
|
system: aarch64-darwin
|
||||||
|
installer_version: nix-2.18.6
|
||||||
|
- os: macos-26
|
||||||
|
system: aarch64-darwin
|
||||||
|
installer_version: nix-2.18.6
|
||||||
|
- os: macos-15
|
||||||
|
system: aarch64-darwin
|
||||||
|
installer_version: nix-2.18.6
|
||||||
|
- os: macos-14
|
||||||
|
system: aarch64-darwin
|
||||||
|
installer_version: nix-2.8.0
|
||||||
- os: macos-13
|
- os: macos-13
|
||||||
system: x86_64-darwin
|
system: x86_64-darwin
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
|
||||||
- name: Run NAR server
|
|
||||||
run: |
|
|
||||||
curl --location https://github.com/cachix/nar-toolbox/releases/download/v0.1.0/nar-toolbox-${{ matrix.system }} -O
|
|
||||||
chmod +x ./nar-toolbox-${{ matrix.system }}
|
|
||||||
./nar-toolbox-${{ matrix.system }} serve https://cache.nixos.org &
|
|
||||||
- name: Install Nix
|
|
||||||
uses: ./
|
|
||||||
with:
|
|
||||||
nix_path: ${{ env.nixpkgs_channel }}
|
|
||||||
install_url: https://hydra.nixos.org/job/nix/master/installerScript/latest-finished/download/1/install
|
|
||||||
install_options: "--tarball-url-prefix http://localhost:8080"
|
|
||||||
- run: nix-build tests/test-build.nix
|
|
||||||
|
|
||||||
oldest-supported-installer:
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
include:
|
|
||||||
- os: ubuntu-latest
|
|
||||||
installer_version: nix-2.8.0
|
installer_version: nix-2.8.0
|
||||||
- os: ubuntu-24.04-arm
|
uses: ./.github/workflows/test-per-system.yml
|
||||||
installer_version: nix-2.8.0
|
with:
|
||||||
- os: macos-latest
|
runs-on: ${{ matrix.os }}
|
||||||
# macOS 15 Sequoia took over some of the ids previously used for _nixbld
|
system: ${{ matrix.system }}
|
||||||
# 2.18.6 is the oldest version that was patched for this.
|
installer_version: ${{ matrix.installer_version }}
|
||||||
installer_version: nix-2.18.6
|
|
||||||
- os: macos-13
|
|
||||||
installer_version: nix-2.8.0
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
|
||||||
- name: Install Nix
|
|
||||||
uses: ./
|
|
||||||
with:
|
|
||||||
nix_path: ${{ env.nixpkgs_channel }}
|
|
||||||
install_url: https://releases.nixos.org/nix/${{ matrix.installer_version }}/install
|
|
||||||
- run: nix-build tests/test-build.nix
|
|
||||||
|
|
||||||
act-support:
|
act-support:
|
||||||
strategy:
|
runs-on: ubuntu-latest
|
||||||
matrix:
|
|
||||||
os: [ubuntu-latest]
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
||||||
- run: curl https://raw.githubusercontent.com/nektos/act/master/install.sh | sudo bash
|
- run: curl https://raw.githubusercontent.com/nektos/act/master/install.sh | sudo bash
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue