-
Notifications
You must be signed in to change notification settings - Fork 78
132 lines (114 loc) · 4.14 KB
/
Copy pathtest.yml
File metadata and controls
132 lines (114 loc) · 4.14 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
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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
name: Scilpy test suite
on:
push:
branches:
- master
pull_request:
branches:
- master
merge_group:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
env:
MPLBACKEND: agg
OPENBLAS_NUM_THREADS: 1
PYTEST_XDIST_AUTO_NUM_WORKERS: 8
jobs:
test:
runs-on: scilus-large
if: github.repository == 'scilus/scilpy'
steps:
- name: Checkout repository at merge
uses: actions/checkout@v7
- name: Fetch python version from repository
id: python-selector
run: |
echo "python-version=$(head -1 .python-version)" >> $GITHUB_OUTPUT
echo "C_INCLUDE_PATH=$pythonLocation/include/python$(head -1 .python-version):$C_INCLUDE_PATH" >> $GITHUB_ENV
- name: Set up Python and uv for Scilpy
uses: astral-sh/setup-uv@v8.2.0
with:
python-version: ${{ steps.python-selector.outputs.python-version }}
activate-environment: true
enable-cache: true
- name: Install non-python dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
build-essential \
curl \
git \
libblas-dev \
liblapack-dev \
libfreetype6-dev \
libdrm-dev \
libgl1-mesa-dev \
libosmesa6-dev \
python3-dev \
- name: stdlib checkout
if: ${{ !contains(steps.python-selector.outputs.python-version, '3.12') }}
run: |
echo "SETUPTOOLS_USE_DISTUTILS=stdlib" >> "$GITHUB_ENV"
- name: Install Scilpy
run: |
uv pip install --upgrade pip wheel
uv pip install --upgrade "setuptools<71.0.0"
uv pip install -e .
# TODO: to adapt once Scilpy passes to VTK 9.4.0, which selects OSMesa at runtime
# https://discourse.vtk.org/t/status-update-runtime-opengl-render-window-selection-in-vtk/14583
VTK_VERSION=$(cat pyproject.toml | grep 'vtk==' | sed 's/vtk==//g' | sed 's/\"//g' )
pip install --extra-index-url https://wheels.vtk.org vtk-osmesa==$VTK_VERSION
uv pip install pytest-xdist pytest-cov
scil_data_download
scil_search_keywords test --regenerate_help_files --processes 8
- name: Run unit tests
run: |
uv run --active pytest src/scilpy --cov-report term-missing:skip-covered --dist=loadgroup --ignore=src/scilpy/cli
mv .test_reports unit_test_reports
- name: Run smoke tests
run: |
uv run --active pytest src/scilpy/cli --cov-report term-missing:skip-covered --dist=loadgroup
mv .coverage .coverage.smoke
mv .test_reports smoke_test_reports
- name: Save test results and coverage
uses: actions/upload-artifact@v7
id: test-coverage-results
with:
name: test-coverage-${{ github.run_id }}
retention-days: 1
include-hidden-files: true
path: |
unit_test_reports/
smoke_test_reports/
coverage:
runs-on: ubuntu-latest
if: github.repository == 'scilus/scilpy'
needs: test
steps:
- name: Checkout repository at merge
uses: actions/checkout@v7
- name: Download test results and coverage
uses: actions/download-artifact@v8
with:
name: test-coverage-${{ github.run_id }}
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v7.0.0
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: unit_test_reports/*
disable_search: true
flags: unittests
name: scilpy-tests-${{ github.run_id }}-${{ github.run_attempt }}
verbose: true
fail_ci_if_error: true
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v7.0.0
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: smoke_test_reports/*
disable_search: true
flags: smoketests
name: scilpy-tests-${{ github.run_id }}-${{ github.run_attempt }}
verbose: true
fail_ci_if_error: true