-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (43 loc) · 1.57 KB
/
test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
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 FindingFalcone.xcodeproj -scheme FindingFalconeTests test -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 14' -enableCodeCoverage YES -derivedDataPath build | xcpretty
- name: Collect coverage into one XML report
run: |
bash Scripts/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 }}