CI/CD #992
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/CD | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
schedule: | |
- cron: '0 0 * * *' | |
workflow_dispatch: | |
inputs: | |
release: | |
description: Create release | |
required: false | |
type: boolean | |
version: | |
description: New version to release | |
required: false | |
type: string | |
concurrency: | |
group: ci/cd-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
analyze: | |
name: Analyze | |
if: github.event_name != 'workflow_dispatch' | |
uses: SwiftyLab/ci/.github/workflows/analyze.yml@main | |
permissions: | |
actions: read | |
contents: read | |
security-events: write | |
with: | |
matrix: > | |
{ | |
"include": [ | |
{ | |
"os": "macos-15", | |
"language": "swift", | |
"swift": "latest" | |
} | |
] | |
} | |
spell-check: | |
name: Run spell check | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Spellcheck Action | |
uses: rojopolis/[email protected] | |
with: | |
config_path: .github/config/spellcheck.yaml | |
swift-package-test: | |
name: Swift Package | |
uses: SwiftyLab/ci/.github/workflows/swift-package.yml@main | |
secrets: inherit | |
with: | |
matrix: > | |
{ | |
"include": [ | |
{ | |
"os": "ubuntu-latest", | |
"swift": "5.9", | |
"dependencies": { | |
"swift-syntax": "509.1.1" | |
} | |
}, | |
{ | |
"os": "ubuntu-latest", | |
"swift": "5.9", | |
"dependencies": { | |
"swift-syntax": "510.0.3" | |
} | |
}, | |
{ | |
"os": "ubuntu-latest", | |
"swift": "5.9", | |
"dependencies": { | |
"swift-syntax": "600.0.1" | |
} | |
}, | |
{ | |
"os": "ubuntu-latest", | |
"swift": "5.9", | |
"dependencies": { | |
"swift-syntax": "601.0.1" | |
} | |
}, | |
{ | |
"os": "ubuntu-22.04", | |
"swift": "5.10", | |
"dependencies": { | |
"swift-syntax": "509.1.1" | |
} | |
}, | |
{ | |
"os": "ubuntu-22.04", | |
"swift": "5.10", | |
"dependencies": { | |
"swift-syntax": "510.0.3" | |
} | |
}, | |
{ | |
"os": "ubuntu-22.04", | |
"swift": "5.10", | |
"dependencies": { | |
"swift-syntax": "600.0.1" | |
} | |
}, | |
{ | |
"os": "ubuntu-22.04", | |
"swift": "5.10", | |
"dependencies": { | |
"swift-syntax": "601.0.1" | |
} | |
}, | |
{ | |
"os": "ubuntu-latest", | |
"swift": "6.0", | |
"dependencies": { | |
"swift-syntax": "509.1.1" | |
} | |
}, | |
{ | |
"os": "ubuntu-latest", | |
"swift": "6.0", | |
"dependencies": { | |
"swift-syntax": "510.0.3" | |
} | |
}, | |
{ | |
"os": "ubuntu-latest", | |
"swift": "6.0", | |
"dependencies": { | |
"swift-syntax": "600.0.1" | |
} | |
}, | |
{ | |
"os": "ubuntu-latest", | |
"swift": "6.0", | |
"dependencies": { | |
"swift-syntax": "601.0.1" | |
} | |
}, | |
{ | |
"os": "ubuntu-latest", | |
"swift": "6.1", | |
"dependencies": { | |
"swift-syntax": "509.1.1" | |
} | |
}, | |
{ | |
"os": "ubuntu-latest", | |
"swift": "6.1", | |
"dependencies": { | |
"swift-syntax": "510.0.3" | |
} | |
}, | |
{ | |
"os": "ubuntu-latest", | |
"swift": "6.1", | |
"dependencies": { | |
"swift-syntax": "600.0.1" | |
} | |
}, | |
{ | |
"os": "ubuntu-latest", | |
"swift": "6.1", | |
"dependencies": { | |
"swift-syntax": "601.0.1" | |
} | |
}, | |
{ | |
"os": "ubuntu-latest", | |
"swift": "latest" | |
}, | |
{ | |
"os": "macos-15", | |
"swift": "latest" | |
} | |
] | |
} | |
cocoapods-test: | |
name: CocoaPods | |
uses: SwiftyLab/ci/.github/workflows/cocoapods.yml@main | |
strategy: | |
matrix: | |
platform: ['macOS', 'iOS'] | |
with: | |
os: macos-latest | |
swift: latest | |
platforms: ${{ matrix.platform }} | |
ci: | |
name: CI | |
if: github.event_name == 'push' | |
needs: [analyze, spell-check, swift-package-test, cocoapods-test] | |
uses: SwiftyLab/ci/.github/workflows/ci.yml@main | |
cd: | |
name: CD | |
if: | | |
always() && | |
github.event_name == 'workflow_dispatch' && | |
github.event.inputs.release == 'true' && | |
(needs.ci.result == 'success' || needs.ci.result == 'skipped') && | |
(needs.swift-package-test.result == 'success' || needs.swift-package-test.result == 'skipped') && | |
(needs.cocoapods-test.result == 'success' || needs.cocoapods-test.result == 'skipped') | |
needs: [analyze, spell-check, swift-package-test, cocoapods-test, ci] | |
uses: SwiftyLab/ci/.github/workflows/cd.yml@main | |
with: | |
swift: latest | |
version: ${{ github.event.inputs.version }} | |
secrets: | |
COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }} |