mirror of
https://github.com/Kludex/awesome-fastapi-projects.git
synced 2025-05-15 05:37:05 +00:00
50 lines
1.6 KiB
YAML
50 lines
1.6 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
|
|
run: |
|
|
python -m ruff check --verbose --format=github .
|
|
- name: Lint with black
|
|
run: |
|
|
python -m black --check --verbose .
|
|
- name: Lint with pyproject-fmt
|
|
run: |
|
|
python -m pyproject_fmt --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
|
|
- name: Generate Coverage Report
|
|
run: |
|
|
python -m coverage report -m
|