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

ci.yml: Add x86_64-darwin

GHA has previously upgraded us to aarch64 (silently; that was fun),
but we're running into issues with x86_64-darwin, so we really have
to re-enable that as well.
This commit is contained in:
Robert Hensing 2024-07-20 20:56:15 +02:00
parent 0b96c586e0
commit 0010230de4

View file

@ -13,8 +13,22 @@ jobs:
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
os: [ubuntu-latest, macos-latest] # https://github.com/actions/runner-images?tab=readme-ov-file#available-images
runs-on: ${{ matrix.os }} os:
- name: "ubuntu-latest"
image: "ubuntu-latest"
os: "ubuntu"
system: "x86_64-linux"
- name: "macos-latest, aarch64-darwin"
image: "macos-latest"
os: "darwin"
system: "aarch64-darwin"
- name: "macos-14-large, x86_64-darwin"
image: "macos-14-large"
os: "darwin"
system: "x86_64-darwin"
runs-on: ${{ matrix.os.image }}
name: tests (${{ matrix.os.name }})
timeout-minutes: 60 timeout-minutes: 60
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
@ -31,7 +45,8 @@ jobs:
name: '${{ env.CACHIX_NAME }}' name: '${{ env.CACHIX_NAME }}'
signingKey: '${{ secrets.CACHIX_SIGNING_KEY }}' signingKey: '${{ secrets.CACHIX_SIGNING_KEY }}'
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}' authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
- if: matrix.os == 'ubuntu-latest' - name: Configuring swap space
if: matrix.os.os == 'ubuntu'
run: | run: |
free -h free -h
swapon --show swapon --show
@ -48,7 +63,17 @@ jobs:
free -h free -h
done done
) & ) &
- run: nix --experimental-features 'nix-command flakes' flake check -L - name: Checking image `system`
run: |
echo Checking that the image is for the expected system and/or system detection works...
nixSystem="$(nix-instantiate --eval --expr 'builtins.currentSystem' | sed -e 's/"//g')"
echo "system: $nixSystem"
if [ "$nixSystem" != "${{ matrix.os.system }}" ]; then
echo "Expected system: ${{ matrix.os.system }} but got $nixSystem"
exit 1
fi
- name: Checking `nix flake check`
run: nix --experimental-features 'nix-command flakes' flake check -L
# Steps to test CI automation in your own fork. # Steps to test CI automation in your own fork.
# Cachix: # Cachix:
@ -106,8 +131,22 @@ jobs:
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
os: [ubuntu-latest, macos-latest] # See `tests` above
runs-on: ${{ matrix.os }} os:
- name: "ubuntu-latest"
image: "ubuntu-latest"
os: "ubuntu"
system: "x86_64-linux"
- name: "macos-latest, aarch64-darwin"
image: "macos-latest"
os: "darwin"
system: "aarch64-darwin"
- name: "macos-14-large, x86_64-darwin"
image: "macos-14-large"
os: "darwin"
system: "x86_64-darwin"
runs-on: ${{ matrix.os.image }}
name: installer_test (${{ matrix.os.name }})
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- run: echo CACHIX_NAME="$(echo $GITHUB_REPOSITORY-install-tests | tr "[A-Z]/" "[a-z]-")" >> $GITHUB_ENV - run: echo CACHIX_NAME="$(echo $GITHUB_REPOSITORY-install-tests | tr "[A-Z]/" "[a-z]-")" >> $GITHUB_ENV
@ -116,9 +155,9 @@ jobs:
install_url: '${{needs.installer.outputs.installerURL}}' install_url: '${{needs.installer.outputs.installerURL}}'
install_options: "--tarball-url-prefix https://${{ env.CACHIX_NAME }}.cachix.org/serve" install_options: "--tarball-url-prefix https://${{ env.CACHIX_NAME }}.cachix.org/serve"
- run: sudo apt install fish zsh - run: sudo apt install fish zsh
if: matrix.os == 'ubuntu-latest' if: matrix.os.os == 'ubuntu'
- run: brew install fish - run: brew install fish
if: matrix.os == 'macos-latest' if: matrix.os.os == 'darwin'
- run: exec bash -c "nix-instantiate -E 'builtins.currentTime' --eval" - run: exec bash -c "nix-instantiate -E 'builtins.currentTime' --eval"
- run: exec sh -c "nix-instantiate -E 'builtins.currentTime' --eval" - run: exec sh -c "nix-instantiate -E 'builtins.currentTime' --eval"
- run: exec zsh -c "nix-instantiate -E 'builtins.currentTime' --eval" - run: exec zsh -c "nix-instantiate -E 'builtins.currentTime' --eval"
@ -199,8 +238,22 @@ jobs:
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
os: [ubuntu-latest, macos-latest] # See `tests` above
runs-on: ${{ matrix.os }} os:
- name: "ubuntu-latest"
image: "ubuntu-latest"
os: "ubuntu"
system: "x86_64-linux"
- name: "macos-latest, aarch64-darwin"
image: "macos-latest"
os: "darwin"
system: "aarch64-darwin"
- name: "macos-14-large, x86_64-darwin"
image: "macos-14-large"
os: "darwin"
system: "x86_64-darwin"
runs-on: ${{ matrix.os.image }}
name: meson_build (${{ matrix.os.name }})
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- uses: DeterminateSystems/nix-installer-action@main - uses: DeterminateSystems/nix-installer-action@main