-
Notifications
You must be signed in to change notification settings - Fork 1
45 lines (43 loc) · 1.48 KB
/
Copy pathpython_tests.yml
File metadata and controls
45 lines (43 loc) · 1.48 KB
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
name: Run python tests
on:
workflow_dispatch:
pull_request:
jobs:
test:
name: Test (${{ matrix.python-version }}, ${{ matrix.os }})
runs-on: ${{ matrix.os }}
env:
MPLBACKEND: Agg
strategy:
fail-fast: false
matrix:
os: ["ubuntu-latest", "macos-latest", "windows-latest"]
python-version: ["3.10", "3.11", "3.12", "3.13"]
steps:
- uses: actions/checkout@v3
- name: Setup python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install package and dependencies
run: |
pip install --upgrade pip
pip install ".[test]"
- name: Run the tests (Linux/macOS)
if: runner.os != 'Windows'
shell: bash
run: |
echo -e '## Pytest Results\n\n' >> "$GITHUB_STEP_SUMMARY"
echo -e '```' >> "$GITHUB_STEP_SUMMARY"
pytest -v --cov=paretobench tests 2>&1 | tee -a "$GITHUB_STEP_SUMMARY"
echo -e '```' >> "$GITHUB_STEP_SUMMARY"
- name: Run the tests (Windows)
if: runner.os == 'Windows'
shell: powershell
run: |
"## Pytest Results`n`n" | Add-Content -Path $env:GITHUB_STEP_SUMMARY
'```' | Add-Content -Path $env:GITHUB_STEP_SUMMARY
pytest -v tests 2>&1 | Tee-Object -FilePath temp_output.txt
Get-Content temp_output.txt | Add-Content -Path $env:GITHUB_STEP_SUMMARY
'```' | Add-Content -Path $env:GITHUB_STEP_SUMMARY
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }