-
-
Notifications
You must be signed in to change notification settings - Fork 1
85 lines (72 loc) · 2.4 KB
/
test.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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
name: Test
on:
workflow_run:
workflows: ["Docker build"]
types:
- completed
jobs:
in-docker:
runs-on: ubuntu-latest
container:
image: docker://${{ github.repository }}:sha-${{ github.sha }}
if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- uses: actions/checkout@v3
- name: Install dev dependencies
run: |
poetry install --all-extras
- name: Test
run: poetry run pytest tests/
in-os:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
python-version: ["3.10"]
os: [ubuntu-latest]
steps:
- uses: actions/checkout@v3
- name: Ubuntu cache
uses: actions/cache@v3
if: startsWith(matrix.os, 'ubuntu')
with:
path: ~/.cache/pip
key:
${{ matrix.os }}-${{ matrix.python-version }}-${{ hashFiles('**/pyproject.toml') }}
restore-keys: |
${{ matrix.os }}-${{ matrix.python-version }}-
- name: macOS cache
uses: actions/cache@v3
if: startsWith(matrix.os, 'macOS')
with:
path: ~/Library/Caches/pip
key:
${{ matrix.os }}-${{ matrix.python-version }}-${{ hashFiles('**/pyproject.toml') }}
restore-keys: |
${{ matrix.os }}-${{ matrix.python-version }}-
- name: Windows cache
uses: actions/cache@v3
if: startsWith(matrix.os, 'windows')
with:
path: c:\users\runneradmin\appdata\local\pip\cache
key:
${{ matrix.os }}-${{ matrix.python-version }}-${{ hashFiles('**/pyproject.toml') }}
restore-keys: |
${{ matrix.os }}-${{ matrix.python-version }}-
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dev dependencies
run: |
python -m pip install --upgrade pip
python -m pip install --upgrade poetry==1.3.2
poetry install --all-extras
- name: Test
shell: bash
run: |
poetry run pytest tests/ -s --cov=${{ github.event.repository.name }}/ --cov-report=term-missing ${@-}
poetry run coverage xml
- name: Report Coverage
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.11'
uses: codecov/codecov-action@v3