-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6c6f724
commit d973cad
Showing
1 changed file
with
77 additions
and
0 deletions.
There are no files selected for viewing
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
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 |