-
Notifications
You must be signed in to change notification settings - Fork 12
51 lines (46 loc) · 1.36 KB
/
ci.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: CI
on:
pull_request:
push:
branches:
- main
env:
DEVELOPER_DIR: /Applications/Xcode_15.2.app/Contents/Developer
HOMEBREW_NO_INSTALL_CLEANUP: TRUE
jobs:
lint:
runs-on: macos-14
steps:
- uses: actions/checkout@v4
- name: Install Dependencies
run: brew bundle
- name: "Run Linting"
run: make lint
test:
runs-on: macos-14
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- name: Install Dependencies
run: brew bundle
- name: Run Tests
run: make test
- name: Generate lcov
# https://www.reddit.com/r/swift/comments/hr93xg/code_coverage_for_swiftpm_packages/
run: |
BIN_PATH="$(swift build --show-bin-path)"
XCTEST_PATH="$(find ${BIN_PATH} -name '*.xctest')"
COV_BIN=$XCTEST_PATH
if [[ "$OSTYPE" == "darwin"* ]]; then
f="$(basename $XCTEST_PATH .xctest)"
COV_BIN="${COV_BIN}/Contents/MacOS/$f"
fi
xcrun llvm-cov export -format="lcov" \
"${COV_BIN}" \
-instr-profile=.build/debug/codecov/default.profdata \
-ignore-filename-regex=".build|Tests"\ > info.lcov
- uses: codecov/codecov-action@v4
name: Upload Code Coverage
with:
file: ./info.lcov
token: ${{ secrets.CODECOV_TOKEN }}