Skip to content

chore: added test cases for SwiftUI views #12

chore: added test cases for SwiftUI views

chore: added test cases for SwiftUI views #12

Workflow file for this run

name: "Test & Coverage"
on:
push:
branches:
- main
pull_request:
types: [opened, synchronize, reopened]
jobs:
cancel_previous:
name: "Cancel previous Tests & Coverage"
runs-on: ubuntu-latest
steps:
- uses: styfle/[email protected]
with:
workflow_id: ${{ github.event.workflow.id }}
build:
name: 'Tests & Coverage'
needs: cancel_previous
runs-on: macos-latest
env:
BUILD_WRAPPER_OUT_DIR: build_wrapper_output_directory
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install sonar-scanner and build-wrapper
uses: SonarSource/sonarcloud-github-c-cpp@v2
- name: Install xcpretty
run: gem install xcpretty
- name: Run tests(iOS)
run: |
xcodebuild -project FindingFalcon.xcodeproj -scheme FindingFalconTests test -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 14' -enableCodeCoverage YES -derivedDataPath build | xcpretty
- name: Collect coverage into one XML report
run: |
bash xccov-to-generic.sh build/Logs/Test/*.xcresult/ > generic-coverage.xml
- name: SonarCloud Scan
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: |
sonar-scanner -Dsonar.host.url=https://sonarcloud.io
# uses: SonarSource/sonarcloud-github-action@master
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
# SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}