generated from daniil-berg/boilerplate-py
👷 Use own Python testing workflow from reusable-workflows
repository
This commit is contained in:
parent
2ca7ccde4a
commit
0e443f08b9
79
.github/workflows/ci.yaml
vendored
79
.github/workflows/ci.yaml
vendored
@ -1,4 +1,4 @@
|
|||||||
name: CI - Tests & Checks
|
name: CI
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
@ -6,65 +6,18 @@ on:
|
|||||||
- master
|
- master
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
unit-tests:
|
test-and-check:
|
||||||
name: Execute unit tests (Python ${{ matrix.python-version }})
|
name: Tests and checks
|
||||||
runs-on: ubuntu-latest
|
uses: daniil-berg/reusable-workflows/.github/workflows/python-test.yaml@v0.0.1
|
||||||
strategy:
|
with:
|
||||||
matrix:
|
versions: '["3.9", "3.10", "3.11"]'
|
||||||
python-version:
|
cache: pip
|
||||||
- '3.9'
|
cache-dependency-path: pyproject.toml
|
||||||
- '3.10'
|
unittest-command: 'scripts/test.sh'
|
||||||
- '3.11'
|
coverage-command: 'scripts/cov.sh'
|
||||||
steps:
|
unittest-requirements: "-e '.[dev]'"
|
||||||
- uses: actions/checkout@v3
|
typecheck-command: 'scripts/typecheck.sh'
|
||||||
|
typecheck-requirements: '-Ur requirements/dev.txt'
|
||||||
- uses: actions/setup-python@v4
|
typecheck-all-versions: true
|
||||||
with:
|
lint-command: 'scripts/lint.sh'
|
||||||
python-version: ${{ matrix.python-version }}
|
lint-requirements: '-Ur requirements/dev.txt'
|
||||||
cache: 'pip'
|
|
||||||
cache-dependency-path: 'requirements/dev.txt'
|
|
||||||
|
|
||||||
- name: Upgrade pip
|
|
||||||
run: pip install -U pip
|
|
||||||
|
|
||||||
- name: Install marshmallow-generic
|
|
||||||
run: pip install -e '.[dev]'
|
|
||||||
|
|
||||||
- name: Run unit tests for Python ${{ matrix.python-version }}
|
|
||||||
if: ${{ matrix.python-version != '3.11' }}
|
|
||||||
run: python -m tests
|
|
||||||
|
|
||||||
- name: Run unit test coverage script for Python 3.11 and save total percentage
|
|
||||||
if: ${{ matrix.python-version == '3.11' }}
|
|
||||||
run: |
|
|
||||||
total=$(./scripts/test.sh)
|
|
||||||
[[ $? -eq 0 ]] && echo "coverage=${total}" >> $GITHUB_ENV
|
|
||||||
outputs:
|
|
||||||
coverage: ${{ env.coverage }}
|
|
||||||
|
|
||||||
lint:
|
|
||||||
name: Run type checker and linters (Python ${{ matrix.python-version }})
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
python-version:
|
|
||||||
- '3.9'
|
|
||||||
- '3.10'
|
|
||||||
- '3.11'
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
|
|
||||||
- uses: actions/setup-python@v4
|
|
||||||
with:
|
|
||||||
python-version: ${{ matrix.python-version }}
|
|
||||||
cache: 'pip'
|
|
||||||
cache-dependency-path: 'requirements/dev.txt'
|
|
||||||
|
|
||||||
- name: Upgrade pip
|
|
||||||
run: pip install -U pip
|
|
||||||
|
|
||||||
- name: Install dependencies
|
|
||||||
run: pip install -Ur requirements/dev.txt
|
|
||||||
|
|
||||||
- name: Run checks
|
|
||||||
run: bash scripts/lint.sh
|
|
||||||
|
Loading…
Reference in New Issue
Block a user