| 1 |
name: Test |
| 2 |
|
| 3 |
on: [push, pull_request] |
| 4 |
|
| 5 |
jobs: |
| 6 |
test: |
| 7 |
runs-on: ubuntu-latest |
| 8 |
|
| 9 |
strategy: |
| 10 |
fail-fast: false |
| 11 |
max-parallel: 5 |
| 12 |
matrix: |
| 13 |
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13'] |
| 14 |
|
| 15 |
steps: |
| 16 |
- uses: actions/checkout@v4 |
| 17 |
|
| 18 |
- name: Set up Python ${{ matrix.python-version }} |
| 19 |
uses: actions/setup-python@v5 |
| 20 |
with: |
| 21 |
python-version: ${{ matrix.python-version }} |
| 22 |
|
| 23 |
- name: Get pip cache dir |
| 24 |
id: pip-cache |
| 25 |
run: | |
| 26 |
echo "::set-output name=dir::$(pip cache dir)" |
| 27 |
|
| 28 |
- name: Cache |
| 29 |
uses: actions/cache@v4 |
| 30 |
with: |
| 31 |
path: ${{ steps.pip-cache.outputs.dir }} |
| 32 |
key: |
| 33 |
${{ matrix.python-version }}-v1-${{ hashFiles('**/setup.py') }}-${{ hashFiles('**/tox.ini') }} |
| 34 |
restore-keys: | |
| 35 |
${{ matrix.python-version }}-v1- |
| 36 |
|
| 37 |
- name: Install dependencies |
| 38 |
run: | |
| 39 |
python -m pip install --upgrade pip |
| 40 |
python -m pip install --upgrade tox tox-gh-actions |
| 41 |
|
| 42 |
- name: Tox tests |
| 43 |
run: | |
| 44 |
tox -v |
| 45 |
|
| 46 |
- name: Coveralls |
| 47 |
uses: AndreMiras/coveralls-python-action@develop |
| 48 |
with: |
| 49 |
parallel: true |
| 50 |
flag-name: Unit Test |
| 51 |
|
| 52 |
coveralls_finish: |
| 53 |
needs: test |
| 54 |
runs-on: ubuntu-latest |
| 55 |
steps: |
| 56 |
- name: Coveralls Finished |
| 57 |
uses: AndreMiras/coveralls-python-action@develop |
| 58 |
with: |
| 59 |
parallel-finished: true |