forked from aio-libs/aiomysql
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
45d241e
commit 3f8227e
Showing
6 changed files
with
254 additions
and
162 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,123 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
branches: | ||
- 'master' | ||
- '[0-9].[0-9]+' # matches to backport branches, e.g. 3.6 | ||
tags: [ 'v*' ] | ||
pull_request: | ||
branches: | ||
- 'master' | ||
- '[0-9].[0-9]+' | ||
schedule: | ||
- cron: '0 6 * * *' # Daily 6AM UTC build | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} | ||
cancel-in-progress: true | ||
|
||
|
||
jobs: | ||
test: | ||
name: Test | ||
strategy: | ||
matrix: | ||
# service containers are only supported on ubuntu currently | ||
os: | ||
- ubuntu | ||
py: | ||
# - '3.5' | ||
# - '3.6' | ||
# - '3.7' | ||
- '3.8' | ||
# - '3.9' | ||
#- '3.10' | ||
# - '3.11' | ||
db: | ||
- "mysql:5.7" | ||
- "mysql:8.0" | ||
- "mariadb:10.2" | ||
- "mariadb:10.3" | ||
- "mariadb:10.5" | ||
#asynciodebug: | ||
# - | ||
# - 1 | ||
|
||
fail-fast: false | ||
runs-on: ${{ matrix.os }}-latest | ||
|
||
services: | ||
mysql: | ||
image: "${{ matrix.db }}" | ||
ports: | ||
- 3306:3306 | ||
env: | ||
MYSQL_ROOT_PASSWORD: rootpw | ||
options: "--name=mysqld" | ||
#volumes: | ||
# - "${{ github.workspace }}/tests/ssl_resources/ssl:/etc/mysql/ssl:ro" | ||
# - "${{ github.workspace }}/tests/ssl_resources/tls.cnf:/etc/mysql/conf.d/tls.cnf:ro" | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2.4.0 | ||
|
||
- name: Setup Python ${{ matrix.py }} | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.py }} | ||
|
||
- name: Get pip cache dir | ||
id: pip-cache | ||
run: | | ||
echo "::set-output name=dir::$(pip cache dir)" # - name: Cache | ||
- name: Cache PyPI | ||
uses: actions/cache@v2.1.7 | ||
with: | ||
key: pip-ci-${{ runner.os }}-${{ matrix.py }} | ||
path: ${{ steps.pip-cache.outputs.dir }} | ||
|
||
- name: Update pip, wheel, setuptools, build, twine, codecov | ||
run: | | ||
python -m pip install -U pip wheel setuptools build twine codecov | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade --requirement requirements-dev.txt | ||
- name: Install aiomysql | ||
run: | | ||
python -m pip install . | ||
- name: Check rst | ||
run: | | ||
python setup.py check --restructuredtext | ||
- name: Run pyroma | ||
run: | | ||
pyroma -d . | ||
- name: Run tests | ||
run: | | ||
export DB="${MATRIX_DB%%:*}" | ||
export DBTAG="${MATRIX_DB##*:}" | ||
py.test --capture=no --verbose 4 --cov-report term --cov-report html --cov aiomysql ./tests | ||
env: | ||
PYTEST_ADDOPTS: --color=yes | ||
MYSQL_ROOT_PASSWORD: rootpw | ||
MATRIX_DB: "${{ matrix.db }}" | ||
|
||
- name: Generate coverage xml | ||
run: | | ||
python -m coverage xml | ||
- name: Upload coverage | ||
uses: codecov/codecov-action@v2.1.0 | ||
with: | ||
file: ./coverage.xml | ||
flags: unit | ||
fail_ci_if_error: false | ||
#if: matrix.os == 'ubuntu' && matrix.py == '3.10' && matrix.db == 'mariadb:10.5' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
name: lint | ||
|
||
on: | ||
push: | ||
pull_request: | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
test: | ||
name: Test | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2.4.0 | ||
|
||
- name: Setup Python 3.10 | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: '3.10' | ||
|
||
- name: Get pip cache dir | ||
id: pip-cache | ||
run: | | ||
echo "::set-output name=dir::$(pip cache dir)" # - name: Cache | ||
- name: Cache PyPI | ||
uses: actions/cache@v2.1.7 | ||
with: | ||
key: pip-lint | ||
path: ${{ steps.pip-cache.outputs.dir }} | ||
|
||
- name: flake8 Lint | ||
uses: py-actions/flake8@v2.0.0 | ||
with: | ||
flake8-version: 3.7.9 | ||
path: aiomysql | ||
args: tests examples |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.