-
Notifications
You must be signed in to change notification settings - Fork 0
61 lines (46 loc) · 1.45 KB
/
swift.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
name: Swift
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
env:
PACKAGE_NAME: CodeQuickKit
jobs:
macos-build:
runs-on: macos-latest
steps:
- name: Checkout Source
uses: actions/checkout@v3
- name: Build (macOS)
run: swift build -v
- name: Run tests
run: swift test --enable-code-coverage -v 2>&1 | xcpretty --report junit
- name: Code Coverage
run: xcrun llvm-cov export -format="lcov" .build/debug/${{ env.PACKAGE_NAME }}PackageTests.xctest/Contents/MacOS/${{ env.PACKAGE_NAME }}PackageTests -instr-profile .build/debug/codecov/default.profdata > build/reports/coverage.lcov
- name: Upload Artifacts
uses: actions/upload-artifact@v3
with:
name: test-results
path: |
build/reports/junit.xml
build/reports/coverage.lcov
- name: Publish Test Results
uses: EnricoMi/publish-unit-test-result-action/composite@v1
with:
files: build/reports/junit.xml
- name: Publish Code Coverage
uses: vebr/jest-lcov-reporter@v0.2.1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
lcov-file: build/reports/coverage.lcov
update-comment: true
ubuntu-build:
runs-on: ubuntu-latest
steps:
- name: Checkout Source
uses: actions/checkout@v3
- name: Build (Ubuntu)
run: swift build -v
- name: Run tests
run: swift test -v