Merge pull request #7 from lemo-nade-room/migrate-swift6 #2
This file contains hidden or 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: ci | |
on: | |
push: | |
branches: [ main ] | |
paths: | |
- ".github/workflows/ci.yaml" | |
- "**.swift" | |
- ".swift-format" | |
- "Package.resolved" | |
pull_request: | |
branches: [ main ] | |
paths: | |
- ".github/workflows/ci.yaml" | |
- "**.swift" | |
- ".swift-format" | |
- "Package.resolved" | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
lint: | |
timeout-minutes: 5 | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: Homebrew/actions/setup-homebrew@master | |
- run: brew install swift-format | |
- run: swift format lint -s --configuration .swift-format -r Sources Tests Package.swift | |
build: | |
timeout-minutes: 10 | |
runs-on: ubuntu-latest | |
needs: lint | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/cache@v4 | |
with: | |
key: swift-build-package-resolved-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('Package.resolved') }} | |
path: .build | |
- uses: swift-actions/setup-swift@v2 | |
with: | |
swift-version: "6.0" | |
- run: swift build | |
test: | |
timeout-minutes: 10 | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/cache@v4 | |
with: | |
key: swift-build-package-resolved-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('Package.resolved') }} | |
path: .build | |
- uses: swift-actions/setup-swift@v2 | |
with: | |
swift-version: "6.0" | |
- run: swift test |