-
Notifications
You must be signed in to change notification settings - Fork 2
65 lines (62 loc) · 2.41 KB
/
pytest.yaml
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
name: 🧪 pytest
on:
pull_request:
types: [ opened, reopened, synchronize ]
workflow_call:
jobs:
test:
strategy:
fail-fast: false
matrix:
python-version: [ "3.9","3.10","3.11"]
os: [ ubuntu-latest, macos-14]
runs-on: ${{ matrix.os }}
timeout-minutes: 30
name: 🧪 Run pytests
steps:
- name: ⬇️ Checkout repository
uses: actions/checkout@v3
- name: 🐍Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: 🔨 Setup poetry
uses: abatilo/[email protected]
with:
poetry-version: "1.7.1"
- name: 🔨Install dependencies
run: |
poetry config virtualenvs.create false
pip install --no-build-isolation pendulum==2.1.2
poetry install --no-interaction -E visu -E tensorflow --with dev --no-ansi
- run: mkdir results && touch results/test-results-${{ matrix.python-version }}-${{matrix.os}}-summary.md
- name: 🧪 Run tests
uses: nuhrberg/pytest-summary@main
with:
extensions: pytest-cov
options: --doctest-modules --cov-report term --cov-report xml:results/coverage-${{ matrix.python-version }}-${{matrix.os}}.xml --cov=niceml
paths: tests/**
output: results/test-results-${{ matrix.python-version }}-${{matrix.os}}-summary.md
show: "fail, skip"
- name: ⬆️ Upload pytest results
uses: actions/upload-artifact@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
name: pytest-results-${{ matrix.python-version }}-${{matrix.os}}
path: |
results
.test_report.xml
# Use always() to always run this step to publish test results when there are test failures
if: ${{ always() }}
- name: 🖊️ Write job summary
run: |
echo "# 🧪 Test summary for python ${{ matrix.python-version }}-${{matrix.os}}" >> $GITHUB_STEP_SUMMARY
if [[ "${{matrix.os}}" == "windows-latest" ]]
then
type results/test-results-${{ matrix.python-version }}-${{matrix.os}}-summary.md >> $GITHUB_STEP_SUMMARY
else
cat results/test-results-${{ matrix.python-version }}-${{matrix.os}}-summary.md >> $GITHUB_STEP_SUMMARY
fi
shell: bash
if: ${{ always() }}