forked from kraina-ai/srai
-
Notifications
You must be signed in to change notification settings - Fork 0
63 lines (62 loc) · 2.13 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
name: tests
on: workflow_call
jobs:
run-tests:
name: Run tests 🛠️ on multiple systems 🖥️ and Python 🐍 versions
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
python-version: ["3.9", "3.10", "3.11"]
include:
- os: macos-latest
python-version: "3.11"
- os: windows-latest
python-version: "3.11"
env:
OS: ${{ matrix.os }}
PYTHON: ${{ matrix.python-version }}
steps:
- uses: actions/checkout@v3
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- uses: pdm-project/setup-pdm@v3
name: Setup PDM (Python ${{ matrix.python-version }})
with:
python-version: ${{ matrix.python-version }}
architecture: x64
enable-pep582: true
cache: true
cache-dependency-path: "**/pdm.lock"
- name: Install dependencies
run: pdm install -d -G test --skip=post_install
- name: Cache Overpass data
uses: actions/cache@v3
with:
path: cache
key: overpass-cache-${{ matrix.os }}-${{ matrix.python-version }}
- name: Cache tox runner
uses: actions/cache@v3
with:
path: .tox
key: tox-cache-${{ matrix.os }}-${{ matrix.python-version }}-${{ hashFiles('**/pdm.lock') }}
restore-keys: |
tox-cache-${{ matrix.os }}-${{ matrix.python-version }}-
- name: Run tests with tox
run: pdm run tox -e python${{ matrix.python-version }}
- name: Upload coverage to Codecov
uses: Wandalen/wretry.action@master
with:
action: codecov/codecov-action@v4
with: |
env_vars: OS,PYTHON
fail_ci_if_error: true
files: ./coverage.python${{ matrix.python-version }}.xml,
flags: ${{ matrix.os }}-python${{ matrix.python-version }}
verbose: true
token: ${{ secrets.CODECOV_TOKEN }}
attempt_limit: 100
attempt_delay: 10000