Merge pull request #78 from zunda-pixel/update-library #235
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 ] | |
pull_request: | |
types: [ opened, synchronize, reopened ] | |
branches: [ main ] | |
jobs: | |
check-build-test: | |
runs-on: macos-latest | |
steps: | |
- name: Install Tools | |
run: | | |
brew install swiftlint | |
env: | |
HOMEBREW_NO_INSTALL_CLEANUP: 1 | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Select Xcode | |
run: sudo xcode-select -s /Applications/Xcode_16.2.app/Contents/Developer | |
- name: SwiftLint | |
run: | | |
mkdir .build | |
swiftlint lint --reporter json > .build/swiftlint.json | |
- name: Build/Test | |
run: set -o pipefail && swift test --enable-code-coverage --sanitize undefined | xcbeautify | |
- name: Convert Coverage | |
run: xcrun llvm-cov show -instr-profile=.build/debug/codecov/default.profdata .build/debug/PotentCodablesPackageTests.xctest/Contents/MacOS/PotentCodablesPackageTests > .build/coverage.report | |
build-test: | |
permissions: | |
checks: write | |
contents: read | |
runs-on: macos-latest | |
needs: [check-build-test] | |
strategy: | |
matrix: | |
platform: [macos, ios, tvos, watchos] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Select Xcode | |
run: sudo xcode-select -s /Applications/Xcode_16.2.app/Contents/Developer | |
- name: Build/Test | |
run: make build-test-${{ matrix.platform }} | |
- name: Report Test Results | |
uses: yeosu0107/[email protected] | |
if: success() || failure() | |
with: | |
xcresult-path: ./TestResults/${{ matrix.platform }}.xcresult | |
output-md: test-summary.md | |
- uses: LouisBrunner/[email protected] | |
if: success() || failure() | |
continue-on-error: true | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
name: Test Results (${{ matrix.platform }}) | |
conclusion: ${{ job.status }} | |
output: | | |
{"summary":"Results of the tests for ${{ matrix.platform }}"} | |
output_text_description_file: test-summary.md | |
build-test-linux: | |
permissions: | |
checks: write | |
contents: read | |
runs-on: ubuntu-latest | |
needs: [check-build-test] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Build/Test | |
run: swift test --parallel --xunit-output test-results.xml | |
- name: Report Test Results | |
uses: dorny/test-reporter@v1 | |
if: success() || failure() | |
continue-on-error: true | |
with: | |
name: Test Results (linux) | |
path: test-results.xml | |
reporter: java-junit |