Skip to content

Commit ee9fde2

Browse files
authored
restructure CI workflow (#692)
1 parent 6191960 commit ee9fde2

File tree

1 file changed

+13
-24
lines changed

1 file changed

+13
-24
lines changed

.github/workflows/ci.yml

Lines changed: 13 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,14 @@ jobs:
2828
# - '3.10'
2929
# - '3.11.0-alpha.3'
3030
db:
31-
- 'mysql:5.7'
32-
- 'mysql:8.0'
33-
- 'mariadb:10.2'
34-
- 'mariadb:10.3'
35-
- 'mariadb:10.4'
36-
- 'mariadb:10.5'
37-
- 'mariadb:10.6'
38-
- 'mariadb:10.7'
31+
- [mysql, '5.7']
32+
- [mysql, '8.0']
33+
- [mariadb, '10.2']
34+
- [mariadb, '10.3']
35+
- [mariadb, '10.4']
36+
- [mariadb, '10.5']
37+
- [mariadb, '10.6']
38+
- [mariadb, '10.7']
3939

4040
fail-fast: false
4141
runs-on: ${{ matrix.os }}
@@ -46,7 +46,7 @@ jobs:
4646

4747
services:
4848
mysql:
49-
image: '${{ matrix.db }}'
49+
image: "${{ join(matrix.db, ':') }}"
5050
ports:
5151
- 3306:3306
5252
options: '--name=mysqld'
@@ -117,29 +117,18 @@ jobs:
117117
118118
- name: Run tests
119119
run: |
120-
export DB="${MATRIX_DB%%:*}"
121-
export DBTAG="${MATRIX_DB##*:}"
122-
123120
# timeout ensures a more or less clean stop by sending a KeyboardInterrupt which will still provide useful logs
124121
timeout --preserve-status --signal=INT --verbose 5m \
125-
pytest --color=yes --capture=no --verbosity 2 --cov-report term --cov-report xml --cov aiomysql ./tests
122+
pytest --color=yes --capture=no --verbosity 2 --cov-report term --cov-report xml --cov aiomysql ./tests
126123
env:
127124
PYTHONUNBUFFERED: 1
128-
MATRIX_DB: '${{ matrix.db }}'
125+
DB: '${{ matrix.db[0] }}'
126+
DBTAG: '${{ matrix.db[1] }}'
129127
timeout-minutes: 6
130128

131-
- name: Build coverage flag
132-
run: |
133-
COVERAGE_FLAG="${MATRIX_OS}_${MATRIX_PY}_${MATRIX_DB//:/-}"
134-
echo "COVERAGE_FLAG=$COVERAGE_FLAG" | tee -a "$GITHUB_ENV"
135-
env:
136-
MATRIX_OS: '${{ matrix.os }}'
137-
MATRIX_PY: '${{ matrix.py }}'
138-
MATRIX_DB: '${{ matrix.db }}'
139-
140129
- name: Upload coverage
141130
uses: codecov/[email protected]
142131
with:
143132
file: ./coverage.xml
144-
flags: "${{ env.COVERAGE_FLAG }}"
133+
flags: "${{ matrix.os }}_${{ matrix.py }}_${{ join(matrix.db, '-') }}"
145134
fail_ci_if_error: true

0 commit comments

Comments
 (0)