Skip to content

Commit 7f93907

Browse files
authored
Prefer macos-13 runner over macos-15 by introducing cachix (#1237)
1 parent 6be1f81 commit 7f93907

3 files changed

Lines changed: 15 additions & 21 deletions

File tree

.github/workflows/ci-home.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
matrix:
3737
runner:
3838
- ubuntu-24.04
39-
- macos-15
39+
- macos-13 # Don't use macos-14 or later. macos-13 is the last runner of x86_64-darwin
4040
runs-on: ${{ matrix.runner }}
4141
steps:
4242
- uses: DeterminateSystems/nix-installer-action@v19
@@ -55,8 +55,6 @@ jobs:
5555
with:
5656
name: kachick-dotfiles
5757
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
58-
# I only have Intel Mac. See 'github-actions@macos-*' in flake.nix for the background
59-
skipPush: ${{ runner.os == 'macOS' && runner.arch != 'x86_64' }}
6058

6159
# https://www.reddit.com/r/Nix/comments/1443k3o/comment/jr9ht5g/?utm_source=reddit&utm_medium=web2x&context=3
6260
- run: mkdir -p ~/.local/state/nix/profiles

.github/workflows/ci-nix.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,8 @@ permissions:
2727

2828
jobs:
2929
inspect:
30-
strategy:
31-
fail-fast: false
32-
matrix:
33-
runner:
34-
- ubuntu-24.04
35-
- macos-15
36-
runs-on: ${{ matrix.runner }}
30+
# Only on Linux is enough to check the flake
31+
runs-on: ubuntu-24.04
3732
timeout-minutes: 30
3833
steps:
3934
- uses: actions/checkout@v4
@@ -54,8 +49,6 @@ jobs:
5449
# Required to clarify allowing unfree even in check ... :<
5550
# This does not make problem only here, because this step does not upload any artifacts.
5651
NIXPKGS_ALLOW_UNFREE: '1'
57-
# https://github.com/kachick/dotfiles/pull/718#issuecomment-2266331003
58-
if: runner.os == 'Linux'
5952

6053
tasks:
6154
defaults:
@@ -66,14 +59,21 @@ jobs:
6659
matrix:
6760
runner:
6861
- ubuntu-24.04
69-
- macos-15
62+
- macos-13 # Don't use macos-14 or later. macos-13 is the last runner of x86_64-darwin
7063
runs-on: ${{ matrix.runner }}
7164
timeout-minutes: 30
7265
steps:
7366
- uses: actions/checkout@v4
7467
with:
7568
persist-credentials: false
7669
- uses: DeterminateSystems/nix-installer-action@v19
70+
with:
71+
extra-conf: |
72+
accept-flake-config = true
73+
- uses: cachix/cachix-action@ad2ddac53f961de1989924296a1f236fcfbaa4fc # v15
74+
with:
75+
name: kachick-dotfiles
76+
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
7777
- name: Measure nix shell initialization time
7878
run: echo 'This step should be done before any other "nix develop" steps'
7979
- run: task ci-dev

flake.nix

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -223,14 +223,10 @@
223223
];
224224
};
225225

226-
# macos-13 is the latest x86-64 runner for darwin and technically the right choice for respecting architecture of my old MacBook,
227-
# but it's slow, almost 3x slower than Linux runners - so I prefer macos-14 or later. :<
228-
#
229-
# From another angle, I do keep my MacBook OS up-to-date, so maybe it's actually more appropriate as a CI environment than macos-13.
230-
# Ideally, I guess it would be best to run both macos-13 and "macos-latest or later"(actually not "latest" in GitHub!),
231-
# but I spend less than 1% of my time on macOS compared to Linux, so I don't want to make things more complex here.
232-
"github-actions@macos-15" = home-manager-darwin.lib.homeManagerConfiguration {
233-
pkgs = mkPkgs "aarch64-darwin";
226+
# macos-13 is the latest x86_64-darwin runner for darwin and technically the right choice for respecting architecture of my old MacBook,
227+
# but it's slow, almost 3x slower than Linux runners. So you should use binary cache if use this runner
228+
"github-actions@macos-13" = home-manager-darwin.lib.homeManagerConfiguration {
229+
pkgs = mkPkgs "x86_64-darwin";
234230
# Prefer "kachick" over "common" only here.
235231
# Using values as much as possible as actual values to create a robust CI
236232
modules = [

0 commit comments

Comments
 (0)