46 lines
1.3 KiB
YAML
46 lines
1.3 KiB
YAML
name: CI
|
|
|
|
on:
|
|
pull_request:
|
|
push:
|
|
branches: [main]
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
# Only the latest run per branch/PR matters; cancel older ones so private-repo
|
|
# macOS minutes (billed at 10x) aren't spent on superseded commits.
|
|
concurrency:
|
|
group: ci-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
test:
|
|
name: test
|
|
runs-on: macos-14
|
|
steps:
|
|
- uses: actions/checkout@v5
|
|
|
|
# Package.swift declares swift-tools-version 6.0, which needs Xcode 16+.
|
|
- uses: maxim-lobanov/setup-xcode@v1
|
|
with:
|
|
xcode-version: latest-stable
|
|
|
|
- name: Swift version
|
|
run: swift --version
|
|
|
|
# Cache the SwiftPM build (deps + compiled objects) keyed on the resolved
|
|
# dependency graph, so green runs don't recompile SwiftMath etc. each time.
|
|
- name: Cache .build
|
|
uses: actions/cache@v5
|
|
with:
|
|
path: .build
|
|
# v2: the repo was renamed md -> Edmund, which changed the checkout
|
|
# path and invalidated absolute paths baked into the cached module
|
|
# cache. Bump this token to discard any pre-rename .build cache.
|
|
key: spm-v2-${{ runner.os }}-${{ hashFiles('Package.resolved') }}
|
|
restore-keys: spm-v2-${{ runner.os }}-
|
|
|
|
- name: Test
|
|
run: swift test
|