ci: Add codecov #119
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: ci | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: '*' | |
merge_group: | |
branches: [ main ] | |
env: | |
CI_XCODE_LATEST: '/Applications/Xcode_15.4.app/Contents/Developer' | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
test: | |
timeout-minutes: 15 | |
runs-on: macos-14 | |
strategy: | |
matrix: | |
destination: ['platform=iOS\ Simulator,OS=17.5,name=iPhone\ 15\ Pro\ Max', 'platform=watchOS\ Simulator,name=Apple\ Watch\ Series\ 9\ \(41mm\)', 'platform=macOS CODE_SIGN_IDENTITY=""', 'platform=visionOS\ Simulator,OS=1.2,name=Apple\ Vision\ Pro CODE_SIGN_IDENTITY=""'] | |
action: ['test', 'build'] | |
exclude: | |
- destination: 'platform=iOS\ Simulator,OS=17.5,name=iPhone\ 15\ Pro\ Max' | |
action: 'build' | |
- destination: 'platform=macOS CODE_SIGN_IDENTITY=""' | |
action: 'build' | |
- destination: 'platform=visionOS\ Simulator,OS=1.2,name=Apple\ Vision\ Pro CODE_SIGN_IDENTITY=""' | |
action: 'test' | |
- destination: 'platform=watchOS\ Simulator,name=Apple\ Watch\ Series\ 9\ \(41mm\)' | |
action: 'test' | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install Swiftlint | |
run: brew install swiftlint | |
- name: Build-Test | |
run: set -o pipefail && env NSUnbufferedIO=YES xcodebuild -scheme CareKitEssentials -derivedDataPath DerivedData -destination ${{ matrix.destination }} ${{ matrix.action }} | xcpretty -c | |
env: | |
DEVELOPER_DIR: ${{ env.CI_XCODE_LATEST }} | |
- name: Upload codecov yml | |
run: | | |
cat .codecov.yml | curl --data-binary @- https://codecov.io/validate | |
- name: Prepare codecov | |
uses: sersoft-gmbh/swift-coverage-action@v4 | |
id: coverage-files | |
with: | |
format: lcov | |
search-paths: ./DerivedData | |
env: | |
DEVELOPER_DIR: ${{ env.CI_XCODE_LATEST }} | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@v4 | |
with: | |
files: ${{join(fromJSON(steps.coverage-files.outputs.files), ',')}} | |
fail_ci_if_error: false | |
token: ${{ secrets.CODECOV_TOKEN }} | |
env: | |
DEVELOPER_DIR: ${{ env.CI_XCODE_LATEST }} | |