Tests #126
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Swift CI | |
on: | |
pull_request: | |
push: | |
branches: ['main'] | |
jobs: | |
format: | |
runs-on: macos-12 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install swift-format | |
run: brew install swift-format | |
- name: Format | |
run: swift format lint --strict --configuration .swift-format.json --recursive --parallel Sources/ Tests/ Examples/ Package.swift | |
build: | |
strategy: | |
matrix: | |
swift: ["5.7", "5.8"] | |
os: [macos-12, macos-latest] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: swift-actions/setup-swift@v1 | |
with: | |
swift-version: ${{ matrix.swift }} | |
- uses: actions/checkout@v3 | |
- uses: actions/cache@v3 | |
with: | |
path: sdk/swift/.build | |
key: ${{ runner.os }}-${{ matrix.swift }}-spm-${{ github.job }}-${{ hashFiles('**/Package.resolved') }} | |
restore-keys: | | |
${{ runner.os }}-${{ matrix.swift }}-spm- | |
- name: Build | |
run: swift build | |
test: | |
strategy: | |
matrix: | |
swift: ["5.7", "5.8"] | |
os: [macos-12, macos-latest] | |
needs: [build] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: swift-actions/setup-swift@v1 | |
with: | |
swift-version: ${{ matrix.swift }} | |
- uses: actions/checkout@v3 | |
- uses: actions/cache@v3 | |
with: | |
path: sdk/swift/.build | |
key: ${{ runner.os }}-${{ matrix.swift }}-spm-${{ github.job }}-${{ hashFiles('**/Package.resolved') }} | |
restore-keys: | | |
${{ runner.os }}-${{ matrix.swift }}-spm- | |
- name: Test | |
run: swift test |