Skip to content

Commit 976461e

Browse files
committed
chore: update CI rules
1 parent eafa133 commit 976461e

1 file changed

Lines changed: 50 additions & 16 deletions

File tree

.github/workflows/test.yml

Lines changed: 50 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,32 @@ jobs:
2828
2929
- name: Install dependencies and run unit tests for each Python version
3030
run: |
31-
for python_version in 3.8 3.9 3.10 3.11 3.12; do
32-
echo "Setting up Python $python_version"
33-
echo "Installing dependencies for Python $python_version"
34-
python$python_version -m pip install --upgrade pip
35-
python$python_version -m pip install -e .
36-
python$python_version -m pip install -r requirements-test.txt
31+
# Define Python executables for different platforms
32+
if [[ "$RUNNER_OS" == "Windows" ]]; then
33+
PY38="py -3.8"
34+
PY39="py -3.9"
35+
PY310="py -3.10"
36+
PY311="py -3.11"
37+
PY312="py -3.12"
38+
else
39+
PY38="python3.8"
40+
PY39="python3.9"
41+
PY310="python3.10"
42+
PY311="python3.11"
43+
PY312="python3.12"
44+
fi
45+
46+
# Run tests for each Python version
47+
for version in "3.8|$PY38" "3.9|$PY39" "3.10|$PY310" "3.11|$PY311" "3.12|$PY312"; do
48+
IFS='|' read -r version_name python_exe <<< "$version"
49+
echo "Setting up Python $version_name"
50+
echo "Installing dependencies for Python $version_name"
51+
$python_exe -m pip install --upgrade pip
52+
$python_exe -m pip install -e .
53+
$python_exe -m pip install -r requirements-test.txt
3754
38-
echo "Running unit tests for Python $python_version"
39-
python$python_version -m pytest tests/test_plugin.py tests/test_utils.py tests/test_cli.py tests/test_integration.py tests/test_dash_simple.py
55+
echo "Running unit tests for Python $version_name"
56+
$python_exe -m pytest tests/test_plugin.py tests/test_utils.py tests/test_cli.py tests/test_integration.py tests/test_dash_simple.py
4057
done
4158
shell: bash
4259

@@ -83,15 +100,32 @@ jobs:
83100
84101
- name: Install dependencies and run browser tests for each Python version
85102
run: |
86-
for python_version in 3.8 3.9 3.10 3.11 3.12; do
87-
echo "Setting up Python $python_version"
88-
echo "Installing dependencies for Python $python_version"
89-
python$python_version -m pip install --upgrade pip
90-
python$python_version -m pip install -e .
91-
python$python_version -m pip install -r requirements-test.txt
103+
# Define Python executables for different platforms
104+
if [[ "$RUNNER_OS" == "Windows" ]]; then
105+
PY38="py -3.8"
106+
PY39="py -3.9"
107+
PY310="py -3.10"
108+
PY311="py -3.11"
109+
PY312="py -3.12"
110+
else
111+
PY38="python3.8"
112+
PY39="python3.9"
113+
PY310="python3.10"
114+
PY311="python3.11"
115+
PY312="python3.12"
116+
fi
117+
118+
# Run tests for each Python version
119+
for version in "3.8|$PY38" "3.9|$PY39" "3.10|$PY310" "3.11|$PY311" "3.12|$PY312"; do
120+
IFS='|' read -r version_name python_exe <<< "$version"
121+
echo "Setting up Python $version_name"
122+
echo "Installing dependencies for Python $version_name"
123+
$python_exe -m pip install --upgrade pip
124+
$python_exe -m pip install -e .
125+
$python_exe -m pip install -r requirements-test.txt
92126
93-
echo "Running browser tests for Python $python_version"
94-
python$python_version -m pytest tests/test_dash_callbacks.py tests/test_dash_integration.py
127+
echo "Running browser tests for Python $version_name"
128+
$python_exe -m pytest tests/test_dash_callbacks.py tests/test_dash_integration.py
95129
done
96130
env:
97131
DISPLAY: :99

0 commit comments

Comments
 (0)