test: add coveralls integration #346
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: Build | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: [main] | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
cancel-in-progress: true | |
jobs: | |
lint: | |
name: build | |
runs-on: macos-13 | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v3 | |
- uses: maxim-lobanov/setup-xcode@v1 | |
with: | |
xcode-version: '15.0.1' | |
- name: Install SSH Key | |
uses: shimataro/[email protected] | |
with: | |
key: ${{ secrets.SSH_PRIVATE_KEY }} | |
known_hosts: github.com | |
- name: Adding Known Hosts | |
run: ssh-keyscan -H github.com >> ~/.ssh/known_hosts | |
- name: Build and test | |
env: | |
GITHUB_ACTOR: ${{ github.actor }} | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: xcodebuild -scheme "AtalaPRISMSDK-Package" \ | |
-destination "platform=iOS Simulator,name=IPhone 14" \ | |
-enableCodeCoverage YES \ | |
-resultBundlePath TestResults.xcresult \ | |
-derivedDataPath "derivedData" \ | |
clean build test | xcpretty | |
- name: Generate coverage file | |
run: xcov --scheme "AtalaPRISMSDK-Package"\ | |
--output_directory "build/xcov" \ | |
--derived_data_path "derivedData" \ | |
--is_swift_package true \ | |
--disable_coveralls \ | |
--json_report \ | |
--xccov_file_direct_path TestResults.xcresult | |
- name: Publish tests results | |
uses: kishikawakatsumi/[email protected] | |
with: | |
path: TestResults.xcresult | |
token: ${{ secrets.GITHUB_TOKEN }} | |
show-code-coverage: true | |
if: success() || failure() | |
- name: Publish to Coveralls | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
uses: coverallsapp/github-action@v2 | |
with: | |
file: "build/xcov/report.json" | |
- name: Publish Code Coverage Report | |
uses: actions/upload-artifact@v4 | |
with: | |
name: swift-coverage | |
path: "build/xcov" |