Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix macOS runner for CI #632

Merged
merged 4 commits into from
Nov 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
131 changes: 35 additions & 96 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,24 @@ concurrency:
cancel-in-progress: true

jobs:
test-on-macos-13:
name: Test on macOS 13
runs-on: macOS-13
test-on-macos:
name: Test on macOS
strategy:
fail-fast: false
matrix:
xcode: ["14.3.1"]
include:
- runner: "macos-13"
xcode: "14.3.1"
- runner: "macos-14"
xcode: "15.4"
- runner: "macos-15"
xcode: "16.1"
runs-on: ${{ matrix.runner }}
steps:
- uses: actions/checkout@v4

- name: Cache dependencies
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: |
.build/artifacts
Expand All @@ -50,57 +56,22 @@ jobs:
if: ${{ github.event_name == 'pull_request' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
test-on-macos-14:
name: Test on macOS 14
runs-on: macOS-14
strategy:
fail-fast: false
matrix:
xcode: ["15.4", "16.0"]
steps:
- uses: actions/checkout@v4

- name: Cache dependencies
uses: actions/cache@v2
with:
path: |
.build/artifacts
.build/checkouts
.build/repositories
key: ${{ runner.os }}-dependencies-${{ matrix.xcode }}-${{ hashFiles('**/Package.resolved') }}
restore-keys: |
${{ runner.os }}-dependencies-${{ matrix.xcode }}-${{ hashFiles('**/Package.resolved') }}
${{ runner.os }}-dependencies-${{ matrix.xcode }}-

- name: Select Xcode
run: |
xcodebuild -version
ls -nt /Applications/ | grep "Xcode*"
sudo xcode-select -switch /Applications/Xcode_${{ matrix.xcode }}.app
xcodebuild -version

- name: Install danger-js
run: brew install danger/tap/danger-js

- run: swift test

- run: swift run danger-swift ci --verbose --failOnErrors
if: ${{ github.event_name == 'pull_request' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

test-dependencies-resolver:
name: Test dependencies resolver
runs-on: macOS-14
strategy:
fail-fast: false
matrix:
xcode: ["15.4", "16.0"]
include:
- runner: "macos-14"
xcode: "15.4"
- runner: "macos-15"
xcode: "16.1"
runs-on: ${{ matrix.runner }}
steps:
- uses: actions/checkout@v4

- name: Cache dependencies
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: |
.build/artifacts
Expand Down Expand Up @@ -139,10 +110,10 @@ jobs:
swift: ["5.9", "5.10", "6.0"]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v2
- uses: actions/setup-node@v4

- name: Cache dependencies
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: |
.build/artifacts
Expand All @@ -169,18 +140,24 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

test-without-spm-on-macos-13:
name: Test without SPM on macOS 13
runs-on: macOS-13
test-without-spm-on-macos:
name: Test without SPM on macOS
strategy:
fail-fast: false
matrix:
xcode: ["14.3.1"]
include:
- runner: "macos-13"
xcode: "14.3.1"
- runner: "macos-14"
xcode: "15.4"
- runner: "macos-15"
xcode: "16.1"
runs-on: ${{ matrix.runner }}
steps:
- uses: actions/checkout@v4

- name: Cache dependencies
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: |
.build/artifacts
Expand All @@ -202,47 +179,9 @@ jobs:
run: brew install danger/tap/danger-js

- run: make install

- run: rm -rf .build && rm -rf Package.swift

- run: danger-swift ci --verbose --failOnErrors
if: ${{ github.event_name == 'pull_request' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

test-without-spm-on-macos-14:
name: Test without SPM on macOS 14
runs-on: macOS-14
strategy:
fail-fast: false
matrix:
xcode: ["15.4", "16.0"]
steps:
- uses: actions/checkout@v4

- name: Cache dependencies
uses: actions/cache@v2
with:
path: |
.build/artifacts
.build/checkouts
.build/repositories
key: ${{ runner.os }}-without-spm-package-${{ matrix.xcode }}-${{ hashFiles('**/Package.resolved') }}
restore-keys: |
${{ runner.os }}-without-spm-package-${{ matrix.xcode }}-${{ hashFiles('**/Package.resolved') }}
${{ runner.os }}-without-spm-package-${{ matrix.xcode }}-

- name: Select Xcode
run: |
xcodebuild -version
ls -nt /Applications/ | grep "Xcode*"
sudo xcode-select -switch /Applications/Xcode_${{ matrix.xcode }}.app
xcodebuild -version

- name: Install danger-js
run: brew install danger/tap/danger-js

if: ${{ matrix.runner == 'macos-13' }}
- run: make install PREFIX='/opt/homebrew'
if: ${{ matrix.runner != 'macos-13' }}

- run: rm -rf .build && rm -rf Package.swift

Expand All @@ -260,10 +199,10 @@ jobs:
swift: ["5.9", "5.10", "6.0"]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v2
- uses: actions/setup-node@v4

- name: Cache dependencies
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: |
.build/artifacts
Expand Down