-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (40 loc) · 1.24 KB
/
swift-pacakge.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: Swift Package
on: [push, workflow_dispatch]
jobs:
build:
strategy:
matrix:
os: [macOS-latest, ubuntu-latest]
name: Build
runs-on: ${{ matrix.os }}
steps:
- name: Checkout Code
uses: actions/checkout@v2
- name: Build
run: |
swift --version
swift build -v
test:
strategy:
matrix:
os: [macOS-latest, ubuntu-latest]
name: Test
runs-on: ${{ matrix.os }}
needs: build
steps:
- name: Checkout Code
uses: actions/checkout@v2
- name: Test
run: |
swift test -v --enable-code-coverage
- name: Generate Code Coverage File
if: ${{ runner.os == 'macOS' && github.event_name == 'push' && github.ref == 'refs/heads/main' }}
run: |
xcrun llvm-cov export --instr-profile=.build/x86_64-apple-macosx/debug/codecov/default.profdata .build/x86_64-apple-macosx/debug/ComplexPackageTests.xctest/Contents/MacOS/ComplexPackageTests > ./info.lcov
- name: Upload Code Coverage
if: ${{ runner.os == 'macOS' && github.event_name == 'push' && github.ref == 'refs/heads/main' }}
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./info.lcov
verbose: true