-
Notifications
You must be signed in to change notification settings - Fork 0
67 lines (57 loc) · 1.87 KB
/
tests.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
name: Tests
# Controls when the action will run.
on:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
workflow_call:
jobs:
# defining this job separately allows to refer to it later as job.needs dependency
tests:
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
python_arch: ['x64']
python:
- [3, 11]
# os: ['ubuntu', 'windows', 'macos']
os: ['ubuntu']
env:
PYTHON: ${{ join(matrix.python, '.') }} # e.g. '3.11'
TOX_ENV: ${{ format('{0}{1}', 'py', join(matrix.python, '')) }} # e.g. 'py311'
runs-on: ${{ format('{0}-latest', matrix.os) }}
name: "Test py-${{ join(matrix.python, '.') }} (${{ matrix.os }})"
steps:
- name: Checking out the repo
uses: actions/checkout@v4
with:
fetch-depth: 0
# see *py_ver* in ci/update.py
- name: Setting up Python ${{ env.PYTHON }}
uses: actions/setup-python@v5
with:
python-version: '${{ env.PYTHON }}'
architecture: '${{ matrix.python_arch }}'
cache: pip
cache-dependency-path: |
ci/requirements.txt
tests/requirements.txt
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install --progress-bar=off -r ci/requirements.txt
- name: Show installed package details
run: |
virtualenv --version
pip --version
tox --version
pip list --format=freeze
- name: Run tests
run: tox -e ${{ env.TOX_ENV }} -v
- name: Rename coverage data uniquely
run: mv .coverage coverage.${{ env.TOX_ENV }}.${{ matrix.os }}
- name: Upload coverage data for next step
uses: actions/upload-artifact@v4
with:
name: coverage
path: coverage.*