1- name : QA, tests and publishing
1+ name : Tests
22
33on :
4- pull_request :
5- types : [opened, synchronize, reopened]
6- push :
7- branches : [main, develop]
8- tags :
9- - ' *'
10- jobs :
11- # Checks the style using the pre-commit hooks
12- qa :
13- runs-on : ubuntu-latest
14- steps :
15- - uses : actions/checkout@v4
16- - uses : pre-commit/action@v3.0.0
4+ pull_request :
5+ types : [opened, synchronize, reopened]
6+ push :
7+ branches : [main, develop]
8+ workflow_call :
179
18- # Only then, normal testing proceeds
10+ jobs :
1911 unit-tests :
20- needs : qa
2112 runs-on : ${{ matrix.os }}
2213
23-
2414 strategy :
2515 fail-fast : false
2616 matrix :
2717 os : [ubuntu-latest, macos-latest, windows-latest]
28- python-version : ["3.8", "3.9"]
29-
30- steps :
31- - uses : actions/checkout@v4
32- - name : Set up Python ${{ matrix.python-version }}
33- uses : actions/setup-python@v4
34- with :
35- python-version : ${{ matrix.python-version }}
36-
37- - name : Install dependencies
38- run : |
39- python -m pip install --upgrade pip==22.1.2
40- pip install -U setuptools==62.6.0 wheel xlrd==1.2.0
41- pip install -e .[all]
42-
43- # The unit tests, with coverage under linux
44- - name : Unit tests (linux)
45- if : (runner.os == 'Linux')
46- run : |
47- pip install pytest-cov
48- pytest -m "not regression and not notebook" --junitxml=junit/pytest.xml \
49- --cov=muse \
50- --cov-branch \
51- --cov-report=xml
52-
53- - name : Upload coverage to Codecov
54- if : success() && (runner.os == 'Linux' && matrix.python-version == 3.9)
55- uses : codecov/codecov-action@v3
56-
57- - name : Unit tests (not linux)
58- if : (runner.os != 'Linux')
59- run : pytest -m "not regression and not notebook"
60-
61- regression-tests :
62- needs : qa
63- runs-on : ${{ matrix.os }}
64-
65- strategy :
66- fail-fast : false
67- matrix :
68- os : [ubuntu-latest, macos-latest, windows-latest]
69- python-version : ["3.8", "3.9"]
18+ # Test with the earliest and the latest python versions supported
19+ python-version : ["3.9", "3.12"]
7020
7121 steps :
7222 - uses : actions/checkout@v4
7323 - name : Set up Python ${{ matrix.python-version }}
74- uses : actions/setup-python@v4
24+ uses : actions/setup-python@v5
7525 with :
7626 python-version : ${{ matrix.python-version }}
27+ cache : pip
7728
7829 - name : Install dependencies
79- run : |
80- python -m pip install --upgrade pip==22.1.2
81- pip install -U setuptools==62.6.0 wheel xlrd==1.2.0
82- pip install -e .[all]
83-
84- # The regression tests (with non coverage)
85- - name : Regression tests
86- run : pytest tests/test_fullsim_regression.py
87-
88- # If all tests pass, we try to build a wheel
89- build-wheel :
90- # needs: [regression-tests, unit-tests]
91- name : Build source distribution
92- runs-on : ubuntu-latest
93- steps :
94- - uses : actions/checkout@v4
30+ run : pip install -e .[all]
9531
96- - name : Build sdist
32+ # The unit tests, with coverage under linux
33+ - name : Unit tests (linux)
34+ if : (runner.os == 'Linux')
9735 run : |
98- python -m pip install --upgrade build
99- python -m build
100-
101- - uses : actions/upload-artifact@v3
36+ pip install pytest-cov
37+ pytest -m "not regression and not notebook" --junitxml=junit/pytest.xml \
38+ --cov=muse \
39+ --cov-branch \
40+ --cov-report=xml
41+
42+ - name : Upload coverage to Codecov
43+ if : success() && (runner.os == 'Linux' && matrix.python-version == 3.9)
44+ uses : codecov/codecov-action@v4
10245 with :
103- path : dist/MUSE*
104-
105- # And if we are pushing a tag, then we try to publish it
106- publish-TestPyPI :
107- if : github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
108- needs : build-wheel
109- name : Publish MUSE to TestPyPI
110- runs-on : ubuntu-latest
111- permissions :
112- id-token : write
46+ fail_ci_if_error : true
47+ token : ${{ secrets.CODECOV_TOKEN }}
48+ verbose : true
11349
114- steps :
115-
116- - name : Download sdist artifact
117- uses : actions/download-artifact@v3
118- with :
119- name : artifact
120- path : dist
121-
122- - name : Display structure of downloaded files
123- run : ls -R dist
124-
125- - name : Publish package distributions to TestPyPI
126- uses : pypa/gh-action-pypi-publish@release/v1
127- with :
128- repository-url : https://test.pypi.org/legacy/
129- skip-existing : true
130-
131- publish-PyPI :
132- if : github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
133- needs : publish-TestPyPI
134- name : Publish MUSE to PyPI
135- runs-on : ubuntu-latest
136- permissions :
137- id-token : write
138-
139- steps :
50+ - name : Unit tests (not linux)
51+ if : (runner.os != 'Linux')
52+ run : pytest -m "not regression and not notebook"
14053
141- - name : Download sdist artifact
142- uses : actions/download-artifact@v3
143- with :
144- name : artifact
145- path : dist
146-
147- - name : Display structure of downloaded files
148- run : ls -R dist
149-
150- - name : Publish package distributions to PyPI
151- uses : pypa/gh-action-pypi-publish@release/v1
152-
153- build-standalone :
154- needs : publish-PyPI
155- name : Build standalone executables
54+ regression-tests :
15655 runs-on : ${{ matrix.os }}
15756
15857 strategy :
15958 fail-fast : false
16059 matrix :
161- os : [ windows-latest ]
162- python-version : [ "3.9" ]
60+ os : [ubuntu-latest, macos-latest, windows-latest]
61+ # Test with the earliest and the latest python versions supported
62+ python-version : ["3.9", "3.12"]
16363
16464 steps :
16565 - uses : actions/checkout@v4
16666 - name : Set up Python ${{ matrix.python-version }}
167- uses : actions/setup-python@v4
67+ uses : actions/setup-python@v5
16868 with :
16969 python-version : ${{ matrix.python-version }}
17070
17171 - name : Install dependencies
172- run : |
173- python -m pip install --upgrade pip
174- python -m pip install pyinstaller
175- python -m pip install -e .[dev,gui]
176-
177- - name : Build directory-based standalone
178- run : pyinstaller muse_dir.spec --distpath standalone
72+ run : pip install -e .[all]
17973
180- - uses : actions/upload-artifact@v3
181- with :
182- path : standalone/MUSE*
183- name : MUSE
74+ # The regression tests (with non coverage)
75+ - name : Regression tests
76+ run : pytest tests/test_fullsim_regression.py
0 commit comments