Skip to content

Commit f91f23d

Browse files
authored
Switch to our codecov-action wrapper (#202)
* Switch to our codecov-action wrapper * Update the code coverage action for main branch too
1 parent 3931a06 commit f91f23d

File tree

2 files changed

+14
-31
lines changed

2 files changed

+14
-31
lines changed

.github/workflows/main-codecov.yml

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,11 @@ jobs:
1212
uses: actions/checkout@v2
1313
- name: Run unit tests with code coverage and Thread Sanitizer
1414
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
15+
- name: Submit coverage report to Codecov.io
16+
uses: vapor/[email protected]
2417
with:
25-
files: ${{ env.CODECOV_FILE }}
26-
flags: 'unittests'
27-
fail_ci_if_error: true
18+
cc_flags: 'unittests'
19+
cc_env_vars: 'SWIFT_VERSION,SWIFT_PLATFORM,RUNNER_OS,RUNNER_ARCH'
20+
cc_fail_ci_if_error: true
21+
cc_verbose: true
22+
cc_dry_run: false

.github/workflows/test.yml

Lines changed: 7 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
name: test
22
on: [ 'pull_request' ]
3-
env:
4-
LOG_LEVEL: notice
53

64
jobs:
75
linux-unit:
@@ -20,29 +18,19 @@ jobs:
2018
runs-on: ubuntu-latest
2119
env:
2220
LOG_LEVEL: debug
23-
MATRIX_CONFIG: ${{ format('{0}-{1}', matrix.swiftver, matrix.swiftos) }}
2421
steps:
2522
- name: Check out package
2623
uses: actions/checkout@v2
2724
- name: Run unit tests with code coverage and Thread Sanitizer
2825
run: swift test --enable-test-discovery --filter=^PostgresNIOTests --sanitize=thread --enable-code-coverage
29-
- name: Convert code coverage report to most expressive format
30-
run: |
31-
export pkgname="$(swift package dump-package | perl -e 'use JSON::PP; print (decode_json(join("",(<>)))->{name});')" \
32-
subpath="$([ "$(uname -s)" = 'Darwin' ] && echo "/Contents/MacOS/${pkgname}PackageTests" || true)" \
33-
exc_prefix="$(which xcrun || true)" && \
34-
${exc_prefix} llvm-cov export -format lcov \
35-
-instr-profile="$(dirname "$(swift test --show-codecov-path)")/default.profdata" \
36-
--ignore-filename-regex='/(\.build|Tests)/' \
37-
"$(swift build --show-bin-path)/${pkgname}PackageTests.xctest${subpath}" >"${pkgname}.lcov"
38-
echo "CODECOV_FILE=$(pwd)/${pkgname}.lcov" >> "${GITHUB_ENV}"
39-
- name: Send coverage report to codecov.io
40-
uses: codecov/codecov-action@v2
26+
- name: Submit coverage report to Codecov.io
27+
uses: vapor/[email protected]
4128
with:
42-
files: ${{ env.CODECOV_FILE }}
43-
flags: 'unittests'
44-
env_vars: 'MATRIX_CONFIG'
45-
fail_ci_if_error: true
29+
cc_flags: 'unittests'
30+
cc_env_vars: 'SWIFT_VERSION,SWIFT_PLATFORM,RUNNER_OS,RUNNER_ARCH'
31+
cc_fail_ci_if_error: true
32+
cc_verbose: true
33+
cc_dry_run: false
4634

4735
linux-integration-and-dependencies:
4836
strategy:

0 commit comments

Comments
 (0)