mirror of
https://github.com/Kludex/awesome-fastapi-projects.git
synced 2025-05-14 21:27:04 +00:00
54 lines
1.7 KiB
YAML
54 lines
1.7 KiB
YAML
name: Web application CI
|
|
|
|
on: [push]
|
|
|
|
jobs:
|
|
quality:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- name: Set up Python
|
|
uses: actions/setup-python@v4
|
|
with: # https://github.com/actions/setup-python/blob/main/docs/advanced-usage.md#caching-packages
|
|
python-version: '3.11'
|
|
cache: 'pip'
|
|
cache-dependency-path: 'requirements/dev.txt'
|
|
- name: Install dev dependencies
|
|
run: |
|
|
python -m pip install --upgrade pip
|
|
python -m pip install -r requirements/dev.txt
|
|
- name: Lint with ruff
|
|
uses: chartboost/ruff-action@v1
|
|
with:
|
|
version: 0.0.280
|
|
- name: Lint with isort
|
|
run: |
|
|
python -m isort --check --diff .
|
|
- name: Lint with black
|
|
run: |
|
|
python -m black --check --verbose .
|
|
- name: Lint with pyupgrade
|
|
run: |
|
|
python -m pyupgrade --py311-plus
|
|
- name: Lint with pyproject-fmt
|
|
run: |
|
|
python -m pyproject_fmt --stdout --check --indent=4
|
|
test:
|
|
needs: [quality]
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- name: Set up Python
|
|
uses: actions/setup-python@v4
|
|
with: # https://github.com/actions/setup-python/blob/main/docs/advanced-usage.md#caching-packages
|
|
python-version: '3.11'
|
|
cache: 'pip'
|
|
cache-dependency-path: 'requirements/test.txt'
|
|
- name: Install test dependencies
|
|
run: |
|
|
python -m pip install --upgrade pip
|
|
python -m pip install -r requirements/test.txt
|
|
- name: Test with pytest
|
|
run: |
|
|
python -m pytest -v -s --failed-first --cov=app --cov-report=xml
|