Skip to content

Commit

Permalink
update gh actions to account for intel/apple silicon
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathanmorley committed Aug 17, 2024
1 parent 2a90e4b commit 1e0f2a9
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 5 deletions.
17 changes: 13 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,18 @@ jobs:
- name: Check Formatting
run: nix fmt -- --check .

build-macos:
name: Build macOS Nix env
runs-on: macos-latest
build:
strategy:
matrix:
platform:
- x86_64-darwin
- aarch64-darwin
include:
- platform: x86_64-darwin
runner: macos-13 # this is the latest intel runner
- platform: aarch64-darwin
runner: macos-latest
runs-on: ${{ matrix.runner }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
Expand All @@ -37,6 +46,6 @@ jobs:
- name: Switch to nix-darwin ci env
run: |
nix --extra-experimental-features 'nix-command flakes' \
run nix-darwin -- switch --flake .#ci
run nix-darwin -- switch --flake .#ci-${{ matrix.platform }}
env:
NIX_CONFIG: "access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}"
18 changes: 17 additions & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
flake = {
darwinConfigurations = rec {
# GitHub CI
"ci" = darwin.lib.darwinSystem rec {
"ci-x86_64-darwin" = darwin.lib.darwinSystem rec {
system = "x86_64-darwin";
specialArgs.profiles = [];

Expand All @@ -71,6 +71,22 @@
};
};

# GitHub CI
"ci-aarch64-darwin" = darwin.lib.darwinSystem rec {
system = "aarch64-darwin";
specialArgs.profiles = [];

modules =
darwinModules
++ homeModules {
profiles = specialArgs.profiles;
username = "runner";
sshKeys = {
"github.com" = "";
};
};
};

# Cvent MacBook Air
"FVFFT3XKQ6LR" = darwin.lib.darwinSystem rec {
system = "aarch64-darwin";
Expand Down

0 comments on commit 1e0f2a9

Please sign in to comment.