1313
1414jobs :
1515
16- build :
16+ build_wheels :
17+ name : Build wheels
1718 runs-on : ${{ matrix.os }}
1819 strategy :
1920 matrix :
2021 python-version : ['3.9', '3.10', '3.11', '3.12']
2122 os : [windows-latest, macOS-latest, ubuntu-latest]
23+ fail-fast : false
2224 steps :
23- - uses : actions/checkout@v2
25+ - uses : actions/checkout@v4
2426 - name : Set up Python
25- uses : actions/setup-python@v4
27+ uses : actions/setup-python@v5
2628 with :
2729 python-version : ${{ matrix.python-version }}
2830 - name : Install dependencies
@@ -35,47 +37,50 @@ jobs:
3537 run : |
3638 python setup.py bdist_wheel
3739 ls dist/*
38- - name : Save wheel
39- uses : actions/upload-artifact@v3
40+ - name : Upload wheels
41+ uses : actions/upload-artifact@v4
4042 with :
4143 name : pecos_${{ matrix.python-version }}_${{ matrix.os }}.whl
4244 path : dist/pecos*
4345
44- install_import :
45- needs : build
46+ test_wheels :
47+ name : Test wheels
48+ needs : build_wheels
4649 runs-on : ${{ matrix.os }}
4750 strategy :
4851 matrix :
4952 python-version : ['3.9', '3.10', '3.11', '3.12']
50- os : [windows-latest, macOS-latest, ubuntu-latest]
53+ os : [windows-latest, macOS-latest, ubuntu-latest]
54+ fail-fast : false
5155 steps :
5256 - name : Set up Python
53- uses : actions/setup-python@v4
57+ uses : actions/setup-python@v5
5458 with :
5559 python-version : ${{ matrix.python-version }}
5660 - name : Download wheel
57- uses : actions/download-artifact@v3
61+ uses : actions/download-artifact@v4
5862 with :
5963 name : pecos_${{ matrix.python-version }}_${{ matrix.os }}.whl
6064 - name : Install pecos
6165 run : |
6266 python -m pip install --upgrade pip
6367 pip install wheel numpy pandas jinja2 matplotlib pytest
6468 pip install --no-index --pre --find-links=. pecos
65- - name : Usage of pecos
69+ - name : Import pecos
6670 run : |
6771 python -c "import pecos"
6872
69- pytest_coverage :
73+ run_coverage :
7074 runs-on : ${{ matrix.os }}
7175 strategy :
7276 matrix :
7377 python-version : ['3.9', '3.10', '3.11', '3.12']
7478 os : [windows-latest, macOS-latest, ubuntu-latest]
79+ fail-fast : false
7580 steps :
76- - uses : actions/checkout@v2
81+ - uses : actions/checkout@v4
7782 - name : Set up Python ${{ matrix.python-version }}
78- uses : actions/setup-python@v4
83+ uses : actions/setup-python@v5
7984 with :
8085 python-version : ${{ matrix.python-version }}
8186 - name : Install dependencies
@@ -85,37 +90,41 @@ jobs:
8590 pip install -r requirements.txt
8691 python -m pip install -e .
8792 - name : Run Tests
88- run : |
93+ run : |
8994 coverage erase
9095 coverage run --context=${{ matrix.os }}.py${{ matrix.python-version }} --source=pecos --omit="*/tests/*" -m pytest --doctest-modules --doctest-glob="*.rst" pecos
9196 coverage run --context=${{ matrix.os }}.py${{ matrix.python-version }} --source=pecos --omit="*/tests/*" --append -m pytest --doctest-glob="*.rst" documentation
9297 env :
9398 COVERAGE_FILE : .coverage.${{ matrix.python-version }}.${{ matrix.os }}
9499 - name : Save coverage
95- uses : actions/upload-artifact@v2
100+ uses : actions/upload-artifact@v4
96101 with :
97- name : coverage
102+ name : . coverage.${{ matrix.python-version }}.${{ matrix.os }}
98103 path : .coverage.${{ matrix.python-version }}.${{ matrix.os }}
104+ include-hidden-files : true
99105
100106 combine_reports :
101- needs : [ pytest_coverage ]
107+ needs : [ run_coverage ]
102108 runs-on : ubuntu-latest
103109 steps :
104110 - name : Set up Python
105- uses : actions/setup-python@v4
111+ uses : actions/setup-python@v5
106112 with :
107113 python-version : 3.11
108- - uses : actions/checkout@v2
114+ - uses : actions/checkout@v4
109115 - name : Install coverage
110116 run : |
111117 python -m pip install --upgrade pip
112118 pip install -r requirements.txt
113119 python -m pip install -e .
120+ pip install coveralls
114121 - name : Download coverage artifacts from test matrix
115- uses : actions/download-artifact@v2
122+ uses : actions/download-artifact@v4
116123 with :
117- name : coverage
124+ pattern : . coverage.*.ubuntu-latest # coverage from other OS cause problems
118125 - name : Setup coverage and combine reports
126+ run : coverage combine .coverage.*.ubuntu-latest
127+ - name : Create coverage report
119128 run : |
120129 echo "[paths]" > .coveragerc
121130 echo "source = " >> .coveragerc
@@ -124,55 +133,21 @@ jobs:
124133 echo " D:\\a\\pecos\\pecos\\pecos" >> .coveragerc
125134 echo " /home/runner/work/pecos/pecos/pecos" >> .coveragerc
126135 echo " /Users/runner/work/pecos/pecos/pecos" >> .coveragerc
127- coverage combine
128- - name : Create coverage report
129- run : |
136+ echo " ${{ github.workspace }}/pecos" >> .coveragerc
130137 coverage report
131138 coverage json --pretty-print
132139 coverage html --show-contexts
133140 - name : Save coverage JSON
134- uses : actions/upload-artifact@v2
141+ uses : actions/upload-artifact@v4
135142 with :
136- name : coverage
143+ name : coverage-json
137144 path : coverage.json
138145 - name : Save coverage html
139- uses : actions/upload-artifact@v2
146+ uses : actions/upload-artifact@v4
140147 with :
141- name : coverage
148+ name : coverage-html
142149 path : htmlcov
143-
144- coveralls :
145- needs : [ pytest_coverage ]
146- runs-on : ubuntu-latest
147- continue-on-error : true
148- steps :
149- - name : Set up Python
150- uses : actions/setup-python@v4
151- with :
152- python-version : 3.11
153- - uses : actions/checkout@v2
154- - name : Install coverage
155- run : |
156- python -m pip install --upgrade pip
157- pip install coveralls
158- pip install -r requirements.txt
159- python -m pip install -e .
160- - name : Download coverage artifacts from test matrix
161- uses : actions/download-artifact@v2
162- with :
163- name : coverage
164- - name : Setup coverage and combine reports
165- run : |
166- echo "[paths]" > .coveragerc
167- echo "source = " >> .coveragerc
168- echo " pecos/" >> .coveragerc
169- echo " pecos\\" >> .coveragerc
170- echo " D:\\a\\pecos\\pecos\\pecos" >> .coveragerc
171- echo " /home/runner/work/pecos/pecos/pecos" >> .coveragerc
172- echo " /Users/runner/work/pecos/pecos/pecos" >> .coveragerc
173- coverage combine
174150 - name : Push to coveralls
175- run : |
176- coveralls --service=github
151+ run : coveralls --service=github --rcfile=.coveragerc
177152 env :
178153 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
0 commit comments