-
Notifications
You must be signed in to change notification settings - Fork 0
54 lines (48 loc) · 1.66 KB
/
run-tests.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
name: Run Tests
on:
push:
branches: [ develop, main, feature/* ]
pull_request:
branches: [ develop, main, feature/* ]
permissions:
id-token: write
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
run_tests_and_code_coverage:
name: Run Tests and Code Coverage
runs-on: macos-14
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Select Xcode Version
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: '15.4.0'
- name: Build Swift
run: |
swift build
- name: Run Tests
run: |
swift test --enable-code-coverage
- name: Convert To LLVM-COV
run: |
xcrun llvm-cov export -format="lcov" .build/arm64-apple-macosx/debug/LocalizationServicesPackageTests.xctest/Contents/MacOS/LocalizationServicesPackageTests -instr-profile .build/arm64-apple-macosx/debug/codecov/default.profdata > info.lcov
- name: Upload Code Coverage Report to CodeCov
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
run: |
bash <(curl https://codecov.io/bash) -t $CODECOV_TOKEN
# - name: Upload Code Coverage Report to CodeCov
# uses: codecov/codecov-action@v4
# with:
# fail_ci_if_error: true
# files: info.lcov
# token: ${{ secrets.CODECOV_TOKEN }}
# verbose: true
# swift build
# swift test --enable-code-coverage
# llvm-cov export -format="lcov" .build/debug/SwiftLoggerPackageTests.xctest -instr-profile .build/debug/codecov/default.profdata > info.lcov
# bash <(curl https://codecov.io/bash)