Skip to content

Commit 37d36da

Browse files
committed
ci: add darwin CLI build check
Build the darwin CLI and formatter on a macOS runner to catch darwin-specific build failures (broken nixpkgs deps, missing platform guards, etc.). The job depends on cli-build so linux dependencies are available in cachix — the macOS runner only builds the darwin-native parts. Make the setup_nix action cross-platform by gating linux-specific steps (apparmor, btrfs) on runner.os == 'Linux'. Signed-off-by: Spyros Seimenis <sse@edgeless.systems>
1 parent 34b6b1a commit 37d36da

File tree

2 files changed

+26
-1
lines changed

2 files changed

+26
-1
lines changed

.github/actions/setup_nix/action.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,15 @@ runs:
1313
using: "composite"
1414
steps:
1515
- name: Allow unrestricted user namespaces
16+
if: runner.os == 'Linux'
1617
# Ubuntu 24.04 ships strict apparmor defaults, so we have to disable them to be able to call
1718
# unshare in the Nix sansbox without beeing root.
1819
shell: bash
1920
run: |
2021
sudo sysctl --ignore --write kernel.apparmor_restrict_unprivileged_unconfined=0
2122
sudo sysctl --ignore --write kernel.apparmor_restrict_unprivileged_userns=0
2223
- name: use btrfs for nix builds
24+
if: runner.os == 'Linux'
2325
shell: bash
2426
run: |
2527
echo "Setting up btrfs /nix volume..."
@@ -33,7 +35,7 @@ runs:
3335
- uses: cachix/install-nix-action@2126ae7fc54c9df00dd18f7f18754393182c73cd # v31.9.1
3436
with:
3537
github_access_token: ${{ inputs.githubToken }}
36-
extra_nix_config: "build-dir = /nix/bld"
38+
extra_nix_config: ${{ runner.os == 'Linux' && 'build-dir = /nix/bld' || '' }}
3739
- uses: cachix/cachix-action@3ba601ff5bbb07c7220846facfa2cd81eeee15a1 # v16
3840
with:
3941
name: edgelesssys

.github/workflows/static.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,3 +158,26 @@ jobs:
158158
- name: Build CLI
159159
run: |
160160
nix build ".#${SET}.contrast.cli"
161+
162+
darwin-cli-build:
163+
needs: cli-build
164+
runs-on: macos-latest
165+
timeout-minutes: 60
166+
permissions:
167+
contents: read
168+
env:
169+
SET: base
170+
steps:
171+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
172+
with:
173+
persist-credentials: false
174+
- uses: ./.github/actions/setup_nix
175+
with:
176+
githubToken: ${{ secrets.GITHUB_TOKEN }}
177+
cachixToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
178+
- name: Build darwin formatter
179+
run: |
180+
nix build .#formatter.aarch64-darwin
181+
- name: Build darwin CLI
182+
run: |
183+
nix build ".#${SET}.contrast.cli"

0 commit comments

Comments
 (0)