Skip to content

Commit

Permalink
ci: add lint-test-coverage workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
gromsterus committed Dec 27, 2023
1 parent 6c6f724 commit d973cad
Showing 1 changed file with 77 additions and 0 deletions.
77 changes: 77 additions & 0 deletions .github/workflows/lint-test-coverage.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
name: lint-test-coverage

on: [ push ]

env:
MAX_PYTHON_V: 3.12
EXTRA_DEPS: dev,dev-fastapi,dev-sanic,dev-sqlalchemy

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ env.MAX_PYTHON_V }}
cache: 'pip'
- name: Install deps
run: |
python -m pip install -U pip
python -m pip install -e .[$EXTRA_DEPS]
- name: Lint
run: ./scripts/lint.sh
test:
runs-on: ubuntu-latest
strategy:
matrix:
py-v: [ "3.10", "3.11", "3.12" ]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.py-v }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.py-v }}
cache: 'pip'
- name: Install deps
run: |
python -m pip install -U pip
python -m pip install -e .[$EXTRA_DEPS]
- name: Test
run: ./scripts/cov.sh xml:coverage-${{ matrix.py-v }}.xml
- name: Upload coverage
uses: actions/upload-artifact@v4
with:
name: coverage-${{ matrix.py-v }}
path: coverage-${{ matrix.py-v }}.xml
if-no-files-found: error
retention-days: 14
coverage:
runs-on: ubuntu-latest
needs: test
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ env.MAX_PYTHON_V }}
- name: Download coverage
uses: actions/download-artifact@v4
with:
path: cov
pattern: coverage-*
merge-multiple: true
- name: Merge coverage
run: |
pip install -U coverage
coverage combine --keep ./cov/
coverage xml
coverage report
- name: Upload coverage-total
uses: actions/upload-artifact@v4
with:
name: coverage-total
path: coverage.xml
if-no-files-found: error
retention-days: 14

0 comments on commit d973cad

Please sign in to comment.