@@ -12,46 +12,59 @@ jobs:
1212 strategy :
1313 matrix :
1414 os : [ubuntu-latest, macos-latest, windows-latest]
15- python-version : [3.8, 3.9, "3.10", 3.11, 3.12]
1615
1716 steps :
1817 - uses : actions/checkout@v3
1918
20- - name : Set up Python ${{ matrix.python-version }}
19+ - name : Set up Python versions
2120 uses : actions/setup-python@v4
2221 with :
23- python-version : ${{ matrix.python-version }}
24-
25- - name : Install dependencies
26- run : |
27- python -m pip install --upgrade pip
28- pip install -e .
29- pip install -r requirements-test.txt
30-
31- - name : Run unit tests
22+ python-version : |
23+ 3.8
24+ 3.9
25+ "3.10"
26+ 3.11
27+ 3.12
28+
29+ - name : Install dependencies and run unit tests for each Python version
3230 run : |
33- pytest tests/test_plugin.py tests/test_utils.py tests/test_cli.py tests/test_integration.py tests/test_dash_simple.py
31+ for python_version in 3.8 3.9 3.10 3.11 3.12; do
32+ echo "Setting up Python $python_version"
33+ # Create a virtual environment for each Python version to avoid conflicts
34+ python$python_version -m venv venv_$python_version
35+ source venv_$python_version/bin/activate
36+
37+ echo "Installing dependencies for Python $python_version"
38+ python -m pip install --upgrade pip
39+ python -m pip install -e .
40+ python -m pip install -r requirements-test.txt
41+
42+ echo "Running unit tests for Python $python_version"
43+ python -m pytest tests/test_plugin.py tests/test_utils.py tests/test_cli.py tests/test_integration.py tests/test_dash_simple.py
44+
45+ # Deactivate virtual environment
46+ deactivate
47+ done
48+ shell : bash
3449
3550 test-browser :
3651 runs-on : ${{ matrix.os }}
3752 strategy :
3853 matrix :
3954 os : [ubuntu-latest, macos-latest, windows-latest]
40- python-version : [3.8, 3.9, "3.10", 3.11, 3.12]
4155
4256 steps :
4357 - uses : actions/checkout@v3
4458
45- - name : Set up Python ${{ matrix.python-version }}
59+ - name : Set up Python versions
4660 uses : actions/setup-python@v4
4761 with :
48- python-version : ${{ matrix.python-version }}
49-
50- - name : Install dependencies
51- run : |
52- python -m pip install --upgrade pip
53- pip install -e .
54- pip install -r requirements-test.txt
62+ python-version : |
63+ 3.8
64+ 3.9
65+ "3.10"
66+ 3.11
67+ 3.12
5568
5669 - name : Install browser for testing (Ubuntu)
5770 if : matrix.os == 'ubuntu-latest'
@@ -75,12 +88,29 @@ jobs:
7588 export DISPLAY=:99
7689 Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 &
7790
78- - name : Run browser tests
91+ - name : Install dependencies and run browser tests for each Python version
7992 run : |
80- pytest tests/test_dash_callbacks.py tests/test_dash_integration.py
93+ for python_version in 3.8 3.9 3.10 3.11 3.12; do
94+ echo "Setting up Python $python_version"
95+ # Create a virtual environment for each Python version to avoid conflicts
96+ python$python_version -m venv venv_$python_version
97+ source venv_$python_version/bin/activate
98+
99+ echo "Installing dependencies for Python $python_version"
100+ python -m pip install --upgrade pip
101+ python -m pip install -e .
102+ python -m pip install -r requirements-test.txt
103+
104+ echo "Running browser tests for Python $python_version"
105+ python -m pytest tests/test_dash_callbacks.py tests/test_dash_integration.py
106+
107+ # Deactivate virtual environment
108+ deactivate
109+ done
81110 env :
82111 DISPLAY : :99
83112 continue-on-error : true
113+ shell : bash
84114
85115 lint-format :
86116 runs-on : ubuntu-latest
0 commit comments