-
-
Notifications
You must be signed in to change notification settings - Fork 0
77 lines (63 loc) · 2.12 KB
/
branch-check.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
name: branch-check
on:
schedule:
- cron: '* * 1 * *'
push:
branches:
- '*'
pull_request:
branches:
- master
jobs:
test:
name: Test ${{ matrix.platform }}
runs-on: macos-latest
strategy:
matrix:
platform: [macosx, iphonesimulator]
include:
- platform: macosx
destination: "arch=x86_64"
- platform: iphonesimulator
destination: "name=iPhone 11,OS=latest"
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Prerequisites
run: |
gem install xcpretty
pod install --project-directory=pod-${{ matrix.platform }}
- name: Test
run: |
xcodebuild clean test -workspace Syntaxis.xcworkspace -scheme Syntaxis -sdk ${{ matrix.platform }} -destination "${{ matrix.destination }}" -derivedDataPath ./build -resultBundlePath ./build/run.xcresult -enableCodeCoverage YES | xcpretty --report junit --output reports/test-report.xml
- name: Archive
uses: actions/upload-artifact@v1
with:
name: test-result-${{ matrix.platform }}
path: ./build/run.xcresult
report:
name: Reports
needs: test
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Download test results
uses: actions/download-artifact@v1
with:
name: test-result-iphonesimulator
path: ./build/run.xcresult
- name: Convert coverage report
run: |
# clone the tool to convert xccov to lcov
git clone https://github.com/trax-retail/xccov2lcov
# extract the coverage information from the result bundle
xcrun xccov view --report --json build/run.xcresult > cov.json
# convert the coverage reports
cd xccov2lcov ; swift run xccov2lcov ../cov.json > ../lcov.info
- name: Codacy
if: github.event_name != 'pull_request'
uses: codacy/codacy-coverage-reporter-action@v1
with:
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
coverage-reports: lcov.info