Skip to content

Update ci.yml

Update ci.yml #141

Workflow file for this run

name: ci
on:
pull_request:
branches:
- main
push:
branches:
- main
jobs:
test:
name: test
runs-on: ${{ matrix.os }}
strategy:
matrix:
build: [linux_3.9, windows_3.9, mac_3.9]
include:
- build: linux_3.9
os: ubuntu-latest
python: 3.9
- build: windows_3.9
os: windows-latest
python: 3.9
- build: mac_3.9
os: macos-latest
python: 3.9
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip wheel
pip install -r requirements.txt
# test all the builds apart from linux_3.8...
- name: Test with pytest
if: matrix.build != 'linux_3.9'
run: pytest
# only do the test coverage for linux_3.8
- name: Produce coverage report
if: matrix.build == 'linux_3.9'
run: pytest --cov=fastapi_async_sqlalchemy --cov-report=xml
- name: Upload coverage report
if: matrix.build == 'linux_3.9'
uses: codecov/codecov-action@v1
with:
file: ./coverage.xml
lint:
name: lint
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: 3.9
- name: Install dependencies
run: pip install flake8
- name: Run flake8
run: flake8 --count .
format:
name: format
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: 3.9
- name: Install dependencies
# isort needs all of the packages to be installed so it can
# tell which are third party and which are first party
run: pip install -r requirements.txt
- name: Check formatting of imports
run: isort --check-only --diff --verbose
- name: Check formatting of code
run: black . --check --diff