Skip to content

Commit 9967360

Browse files
committed
Add workflow to update coverage on pushes to main
1 parent c0376e0 commit 9967360

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

.github/workflows/main-codecov.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: main codecov
2+
on:
3+
push:
4+
branches:
5+
- main
6+
jobs:
7+
update-main-codecov:
8+
runs-on: ubuntu-latest
9+
container: swift:5.5-focal
10+
steps:
11+
- name: Check out main
12+
uses: actions/checkout@v2
13+
- name: Run unit tests with code coverage and Thread Sanitizer
14+
run: swift test --enable-code-coverage --sanitize=thread --filter=^PostgresNIOTests
15+
- name: Convert profdata to LCOV for upload
16+
run: |
17+
llvm-cov export -format lcov \
18+
-instr-profile="$(dirname $(swift test --show-codecov-path))/default.profdata" \
19+
--ignore-filename-regex='/(\.build|Tests)/' \
20+
"$(swift build --show-bin-path)/postgres-nioPackageTests.xctest" >postgres-nio.lcov
21+
echo "CODECOV_FILE=$(pwd)/postgres-nio.lcov" >>"${GITHUB_ENV}"
22+
- name: Upload LCOV report to Codecov.io
23+
uses: codecov/codecov-action@v2
24+
with:
25+
files: ${{ env.CODECOV_FILE }}
26+
flags: 'unittests'
27+
fail_ci_if_error: true

0 commit comments

Comments
 (0)