CI/CD prototype #1
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: ci | |
on: | |
push: | |
pull_request: | |
branches: [ 'main' ] | |
permissions: | |
contents: read | |
checks: write | |
jobs: | |
build: | |
strategy: | |
fail-fast: false | |
matrix: | |
swift: ['swift6', 'swift5'] | |
include: | |
- swift: 'swift6' | |
xcode-path: '/Applications/Xcode_16.0.0.app' | |
macos: 'macos-15' | |
- swift: 'swift5' | |
xcode-path: '/Applications/Xcode_15.4.0.app' | |
macos: 'macos-14' | |
name: 'build-${{ matrix.swift }}' | |
env: | |
DEVELOPER_DIR: ${{ matrix.xcode-path }} | |
runs-on: ${{ matrix.macos }} | |
steps: | |
- name: checkout | |
uses: actions/checkout@v4 | |
- name: brew bundle | |
run: brew bundle | |
- name: swift version | |
run: swift --version | |
- name: build | |
run: swift build -v | |
- name: run tests | |
continue-on-error: true | |
run: swift test --parallel --xunit-output 'authorization-swift-tests.xml' | |
- name: tests report | |
uses: dorny/test-reporter@31a54ee7ebcacc03a09ea97a7e5465a47b84aea5 # 1.9.1 | |
if: always() | |
id: tests-swift-report | |
with: | |
name: 'tests-${{ matrix.swift }}-report' | |
path: 'authorization-swift-tests.xml' | |
reporter: swift-xunit | |
fail-on-error: true | |
- name: summary | |
if: always() | |
run: | | |
{ | |
echo "# Test Summary Report" | |
echo "" | |
echo "System details" | |
echo "" | |
echo "Swift: \`${{ matrix.swift }}\` " | |
echo "macOS: \`${{ matrix.macos }}\` " | |
echo "Xcode: \`${{ matrix.xcode-path }}\` " | |
echo "" | |
echo "Unit Tests Conclusion: \`${{ steps.tests-swift-report.outputs.conclusion }}\` " | |
echo "Unit Tests Report: <${{ steps.tests-swift-report.outputs.url_html }}>" | |
} >> $GITHUB_STEP_SUMMARY | |
lint: | |
strategy: | |
fail-fast: false | |
matrix: | |
swift: ['swift6', 'swift5'] | |
include: | |
- swift: 'swift6' | |
xcode-path: '/Applications/Xcode_16.0.0.app' | |
macos: 'macos-15' | |
- swift: 'swift5' | |
xcode-path: '/Applications/Xcode_15.4.0.app' | |
macos: 'macos-14' | |
name: 'lint-${{ matrix.swift }}' | |
env: | |
DEVELOPER_DIR: ${{ matrix.xcode-path }} | |
runs-on: ${{ matrix.macos }} | |
steps: | |
- name: checkout | |
uses: actions/checkout@v4 | |
- name: brew bundle | |
run: brew bundle | |
- name: swift version | |
run: swift --version | |
- name: swiftlint version | |
run: swiftlint --version | |
- name: lint | |
run: swiftlint lint --reporter github-actions-logging |