Reformat and fix lint errors #165
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
name: CI | |
on: [push] | |
jobs: | |
test-postgres: | |
runs-on: ubuntu-latest | |
env: | |
DATABASE_URL: 'postgres://user:password@localhost:5432/test_atomdb' | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11'] | |
services: | |
postgres: | |
image: postgres | |
ports: | |
- 5432:5432 | |
env: | |
POSTGRES_USER: user | |
POSTGRES_PASSWORD: password | |
POSTGRES_DB: test_atomdb | |
# Set health checks to wait until postgres has started | |
options: >- | |
--health-cmd pg_isready | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setup python ${{ matrix.python-version}} | |
uses: actions/setup-python@v3 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: pip install -U aiopg 'sqlalchemy<1.5' codecov pytest pytest-benchmark pytest-cov pytest-asyncio | |
- name: Install atom-db | |
run: pip install -e ./ | |
- name: Run tests | |
run: pytest -v tests --cov atomdb --cov-report xml --asyncio-mode auto | |
- name: Coverage | |
run: codecov | |
test-mysql: | |
runs-on: ubuntu-latest | |
env: | |
DATABASE_URL: 'mysql://user:password@localhost:3306/test_atomdb' | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11'] | |
services: | |
mariadb: | |
image: mariadb:latest | |
ports: | |
- 3306:3306 | |
env: | |
MYSQL_USER: user | |
MYSQL_PASSWORD: password | |
MYSQL_DATABASE: test_atomdb | |
MYSQL_ROOT_PASSWORD: root | |
options: >- | |
--health-cmd="mysqladmin ping" | |
--health-interval=10s | |
--health-timeout=5s | |
--health-retries=3 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setup python ${{ matrix.python-version}} | |
uses: actions/setup-python@v3 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: pip install -U aiomysql 'sqlalchemy<1.4' codecov pytest pytest-benchmark pytest-cov pytest-asyncio | |
- name: Install atom-db | |
run: pip install -e ./ | |
- name: Run tests | |
run: pytest -v tests --cov atomdb --cov-report xml --asyncio-mode auto | |
- name: Coverage | |
run: codecov | |
test-mongo: | |
runs-on: ubuntu-latest | |
env: | |
MONGO_URL: 'mongodb://localhost:27017' | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11'] | |
services: | |
mongodb: | |
image: mongo | |
ports: | |
- 27017:27017 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setup python ${{ matrix.python-version}} | |
uses: actions/setup-python@v3 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: pip install -U motor codecov pytest pytest-benchmark pytest-cov pytest-asyncio | |
- name: Install atom-db | |
run: pip install -e ./ | |
- name: Run tests | |
run: pytest -v tests --cov atomdb --cov-report xml --asyncio-mode auto | |
- name: Coverage | |
run: codecov | |
check-code: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11'] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setup python ${{ matrix.python-version}} | |
uses: actions/setup-python@v3 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: pip install -U motor aiopg aiomysql 'sqlalchemy<1.5' mypy black isort flake8 | |
- name: Run checks | |
run: | | |
isort atomdb tests --check --diff | |
black atomdb tests --check --diff | |
mypy atomdb --ignore-missing-imports | |
flake8 --ignore=E501,W503 atomdb tests | |