Skip to content

Commit 640769f

Browse files
committed
ci: run CI on self-hosted Apple Silicon macOS runners
Move all jobs (lint, swift-format, python-test) onto the self-hosted Apple Silicon runners [self-hosted, macos, tahoe, ARM64]; the Python deps and tests require macOS on Apple Silicon. Swift comes from Xcode via DEVELOPER_DIR. Pin actions/checkout to a commit SHA and install uv via its official install script instead of third-party setup actions. Guard jobs to apple/coreai-models so forks don't run on the self-hosted runners.
1 parent bffc38f commit 640769f

1 file changed

Lines changed: 23 additions & 12 deletions

File tree

.github/workflows/ci.yml

Lines changed: 23 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,26 +12,37 @@ concurrency:
1212

1313
jobs:
1414
lint:
15-
runs-on: ubuntu-latest
15+
if: github.repository == 'apple/coreai-models'
16+
runs-on: [self-hosted, macos, tahoe, ARM64]
17+
timeout-minutes: 15
1618
steps:
17-
- uses: actions/checkout@v4
18-
- uses: astral-sh/setup-uv@v4
19+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
20+
- name: Ensure uv
21+
run: |
22+
command -v uv >/dev/null 2>&1 || curl -LsSf https://astral.sh/uv/install.sh | sh
23+
echo "$HOME/.local/bin" >> "$GITHUB_PATH"
1924
- run: uv tool install ruff
2025
- run: ruff check python/src/ python/tests/
2126
- run: ruff format --check python/src/ python/tests/
2227

2328
swift-format:
24-
runs-on: ubuntu-latest
29+
if: github.repository == 'apple/coreai-models'
30+
runs-on: [self-hosted, macos, tahoe, ARM64]
31+
timeout-minutes: 15
32+
env:
33+
DEVELOPER_DIR: /Applications/Xcode-latest.app/Contents/Developer
2534
steps:
26-
- uses: actions/checkout@v4
27-
- uses: swift-actions/setup-swift@v2
28-
with:
29-
swift-version: "6.2"
30-
- run: swift-format lint --strict --recursive swift/Sources/ swift/Tests/
35+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
36+
- run: swift format lint --strict --recursive swift/Sources/ swift/Tests/
3137

3238
python-test:
33-
runs-on: ubuntu-latest
39+
if: github.repository == 'apple/coreai-models'
40+
runs-on: [self-hosted, macos, tahoe, ARM64]
41+
timeout-minutes: 60
3442
steps:
35-
- uses: actions/checkout@v4
36-
- uses: astral-sh/setup-uv@v4
43+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
44+
- name: Ensure uv
45+
run: |
46+
command -v uv >/dev/null 2>&1 || curl -LsSf https://astral.sh/uv/install.sh | sh
47+
echo "$HOME/.local/bin" >> "$GITHUB_PATH"
3748
- run: uv run pytest python/tests/test_model_units -x -q

0 commit comments

Comments
 (0)