1- name : QA and tests
1+ name : QA, tests and publishing
22
33on :
44 pull_request :
55 types : [opened, synchronize, reopened]
66 push :
7- branches : [main, develop]
8-
7+ branches : [main, develop]
8+ tags :
9+ - ' *'
910jobs :
1011 # Checks the style using the pre-commit hooks
1112 qa :
1213 runs-on : ubuntu-latest
1314 steps :
14- - uses : actions/checkout@v2
15- - uses : pre-commit/action@v2 .0.2
15+ - uses : actions/checkout@v4
16+ - uses : pre-commit/action@v3 .0.0
1617
1718 # Only then, normal testing proceeds
1819 unit-tests :
1920 needs : qa
20- runs-on : ubuntu-latest
21+ runs-on : ${{ matrix.os }}
22+
23+
24+ strategy :
25+ fail-fast : false
26+ matrix :
27+ os : [ubuntu-latest, macos-latest, windows-latest]
28+ python-version : ["3.8", "3.9"]
2129
2230 steps :
23- - uses : actions/checkout@v2
24- - name : Set up Python 3.8
25- uses : actions/setup-python@v1
31+ - uses : actions/checkout@v4
32+ - name : Set up Python ${{ matrix.python-version }}
33+ uses : actions/setup-python@v4
2634 with :
27- python-version : 3.8
35+ python-version : ${{ matrix.python-version }}
2836
2937 - name : Install dependencies
3038 run : |
31- python -m pip install --upgrade pip
32- pip install -U setuptools wheel xlrd==1.2.0
39+ python -m pip install --upgrade pip==22.1.2
40+ pip install -U setuptools==62.6.0 wheel xlrd==1.2.0
3341 pip install -e .[all]
3442
3543 # The unit tests, with coverage under linux
3644 - name : Unit tests (linux)
3745 if : (runner.os == 'Linux')
3846 run : |
3947 pip install pytest-cov
40- pytest -m "not regression" --junitxml=junit/pytest.xml \
48+ pytest -m "not regression and not notebook " --junitxml=junit/pytest.xml \
4149 --cov=muse \
4250 --cov-branch \
43- --cov-report=xml:coverage/coverage.xml
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
4456
4557 - name : Unit tests (not linux)
4658 if : (runner.os != 'Linux')
47- run : pytest -m "not regression"
59+ run : pytest -m "not regression and not notebook "
4860
4961 regression-tests :
5062 needs : qa
51- runs-on : ubuntu-latest
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"]
5270
5371 steps :
54- - uses : actions/checkout@v2
55- - name : Set up Python 3.8
56- uses : actions/setup-python@v1
72+ - uses : actions/checkout@v4
73+ - name : Set up Python ${{ matrix.python-version }}
74+ uses : actions/setup-python@v4
5775 with :
58- python-version : 3.8
76+ python-version : ${{ matrix.python-version }}
5977
6078 - name : Install dependencies
6179 run : |
62- python -m pip install --upgrade pip
63- pip install -U setuptools wheel xlrd==1.2.0
80+ python -m pip install --upgrade pip==22.1.2
81+ pip install -U setuptools==62.6.0 wheel xlrd==1.2.0
6482 pip install -e .[all]
6583
6684 # The regression tests (with non coverage)
6785 - name : Regression tests
68- run : pytest -m "regression"
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
95+
96+ - name : Build sdist
97+ run : |
98+ python -m pip install --upgrade build
99+ python -m build
100+
101+ - uses : actions/upload-artifact@v3
102+ 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
113+
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 :
140+
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
156+ runs-on : ${{ matrix.os }}
157+
158+ strategy :
159+ fail-fast : false
160+ matrix :
161+ os : [ windows-latest ]
162+ python-version : [ "3.9" ]
163+
164+ steps :
165+ - uses : actions/checkout@v4
166+ - name : Set up Python ${{ matrix.python-version }}
167+ uses : actions/setup-python@v4
168+ with :
169+ python-version : ${{ matrix.python-version }}
170+
171+ - 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
179+
180+ - uses : actions/upload-artifact@v3
181+ with :
182+ path : standalone/MUSE*
183+ name : MUSE
0 commit comments