-
-
Notifications
You must be signed in to change notification settings - Fork 4
49 lines (41 loc) · 1.26 KB
/
build-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
name: Build & Test
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build-test:
name: Build & Test
runs-on: macos-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
# Set the fetch-depth > 1 or set to 0 for codecov upload detection
fetch-depth: 2
- name: Enable development dependencies
run: sed -i.bak "s/\/\/dev//g" Package.swift
- name: Build
run: swift build
- name: Run tests
run: swift test --enable-code-coverage
- name: Generate Code Coverage
run: |
mkdir -p coverage
xcrun llvm-cov export \
.build/debug/PostiePackageTests.xctest/Contents/MacOS/PostiePackageTests \
-instr-profile .build/debug/codecov/default.profdata \
--format="lcov" \
--ignore-filename-regex "\\.build" \
--ignore-filename-regex "Tests" > ./coverage/coverage.lcov
- name: Upload code coverage to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage/coverage.lcov
name: codecov-umbrella
flags: unittests
fail_ci_if_error: true