Skip to content

Commit f5f5b1b

Browse files
authored
ci: report coverage data to Codecov (#2486)
* ci: remove previous coverage reporter * ci: check for coverage behavior in MySQL 5.7 * ci(osx): remove unused coverage
1 parent fb9b8ea commit f5f5b1b

File tree

2 files changed

+10
-30
lines changed

2 files changed

+10
-30
lines changed

.github/workflows/ci-coverage.yml

Lines changed: 9 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: CI - Coverage
33
on:
44
pull_request:
55
push:
6-
branches: [ main ]
6+
branches: [ master ]
77

88
workflow_dispatch:
99

@@ -20,9 +20,9 @@ jobs:
2020
fail-fast: false
2121
matrix:
2222
node-version: [20.x]
23-
mysql-version: ["mysql:8.0.33"]
24-
use-compression: [0]
25-
use-tls: [0]
23+
mysql-version: ["mysql:5.7", "mysql:8.0.33"]
24+
use-compression: [0, 1]
25+
use-tls: [0, 1]
2626
mysql_connection_url_key: [""]
2727
env:
2828
MYSQL_CONNECTION_URL: ${{ secrets[matrix.mysql_connection_url_key] }}
@@ -32,13 +32,6 @@ jobs:
3232
steps:
3333
- uses: actions/checkout@v4
3434

35-
- name: Delete artifacts
36-
uses: jimschubert/delete-artifacts-action@v1
37-
with:
38-
log_level: 'debug'
39-
min_bytes: '0'
40-
pattern: '\.xml'
41-
4235
- name: Set up MySQL
4336
if: ${{ matrix.mysql-version }}
4437
run: docker run -d -e MYSQL_ALLOW_EMPTY_PASSWORD=1 -e MYSQL_DATABASE=${{ env.MYSQL_DATABASE }} -v $PWD/mysqldata:/var/lib/mysql/ -v $PWD/test/fixtures/custom-conf:/etc/mysql/conf.d -v $PWD/test/fixtures/ssl/certs:/certs -p ${{ env.MYSQL_PORT }}:3306 ${{ matrix.mysql-version }}
@@ -65,22 +58,9 @@ jobs:
6558
- name: Run tests
6659
run: FILTER=${{matrix.filter}} MYSQL_USE_TLS=${{ matrix.use-tls }} MYSQL_USE_COMPRESSION=${{ matrix.use-compression }} npm run coverage-test
6760

68-
- name: get list of coverage files
69-
run: echo "coverage-files=`find coverage | grep xml | paste -s -d\; -`" >> $GITHUB_ENV
70-
71-
- name: ReportGenerator
72-
uses: danielpalme/[email protected]
73-
with:
74-
reports: "${{ env.coverage-files }}"
75-
targetdir: '.'
76-
reporttypes: 'Cobertura'
77-
78-
- name: Debug
79-
run: cat Cobertura.xml
80-
81-
- name: Display coverage
82-
uses: ewjoachim/coverage-comment-action@v1
83-
continue-on-error: true
61+
- name: Upload coverage reports to Codecov
62+
uses: codecov/codecov-action@v4
8463
with:
85-
COVERAGE_FILE: "Cobertura.xml"
86-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
64+
token: ${{ secrets.CODECOV_TOKEN }}
65+
flags: compression-${{ matrix.use-compression }},tls-${{ matrix.use-tls }}
66+
name: codecov-umbrella-${{ matrix.node-version }}-${{ matrix.mysql-version }}-compression-${{ matrix.use-compression }}-tls-${{ matrix.use-tls }}

.github/workflows/ci-osx.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,4 +58,4 @@ jobs:
5858
mysql -u root -e "CREATE DATABASE IF NOT EXISTS ${MYSQL_DATABASE};"
5959
6060
- name: Run tests
61-
run: FILTER=${{matrix.filter}} MYSQL_USE_TLS=${{ matrix.use-tls }} MYSQL_USE_COMPRESSION=${{ matrix.use-compression }} npm run coverage-test
61+
run: FILTER=${{matrix.filter}} MYSQL_USE_TLS=${{ matrix.use-tls }} MYSQL_USE_COMPRESSION=${{ matrix.use-compression }} npm run test

0 commit comments

Comments
 (0)