13
13
14
14
jobs :
15
15
16
- build :
16
+ build_wheels :
17
+ name : Build wheels
17
18
runs-on : ${{ matrix.os }}
18
19
strategy :
19
20
matrix :
20
21
python-version : ['3.9', '3.10', '3.11', '3.12']
21
22
os : [windows-latest, macOS-latest, ubuntu-latest]
23
+ fail-fast : false
22
24
steps :
23
- - uses : actions/checkout@v2
25
+ - uses : actions/checkout@v4
24
26
- name : Set up Python
25
- uses : actions/setup-python@v4
27
+ uses : actions/setup-python@v5
26
28
with :
27
29
python-version : ${{ matrix.python-version }}
28
30
- name : Install dependencies
@@ -35,47 +37,50 @@ jobs:
35
37
run : |
36
38
python setup.py bdist_wheel
37
39
ls dist/*
38
- - name : Save wheel
39
- uses : actions/upload-artifact@v3
40
+ - name : Upload wheels
41
+ uses : actions/upload-artifact@v4
40
42
with :
41
43
name : pecos_${{ matrix.python-version }}_${{ matrix.os }}.whl
42
44
path : dist/pecos*
43
45
44
- install_import :
45
- needs : build
46
+ test_wheels :
47
+ name : Test wheels
48
+ needs : build_wheels
46
49
runs-on : ${{ matrix.os }}
47
50
strategy :
48
51
matrix :
49
52
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
51
55
steps :
52
56
- name : Set up Python
53
- uses : actions/setup-python@v4
57
+ uses : actions/setup-python@v5
54
58
with :
55
59
python-version : ${{ matrix.python-version }}
56
60
- name : Download wheel
57
- uses : actions/download-artifact@v3
61
+ uses : actions/download-artifact@v4
58
62
with :
59
63
name : pecos_${{ matrix.python-version }}_${{ matrix.os }}.whl
60
64
- name : Install pecos
61
65
run : |
62
66
python -m pip install --upgrade pip
63
67
pip install wheel numpy pandas jinja2 matplotlib pytest
64
68
pip install --no-index --pre --find-links=. pecos
65
- - name : Usage of pecos
69
+ - name : Import pecos
66
70
run : |
67
71
python -c "import pecos"
68
72
69
- pytest_coverage :
73
+ run_coverage :
70
74
runs-on : ${{ matrix.os }}
71
75
strategy :
72
76
matrix :
73
77
python-version : ['3.9', '3.10', '3.11', '3.12']
74
78
os : [windows-latest, macOS-latest, ubuntu-latest]
79
+ fail-fast : false
75
80
steps :
76
- - uses : actions/checkout@v2
81
+ - uses : actions/checkout@v4
77
82
- name : Set up Python ${{ matrix.python-version }}
78
- uses : actions/setup-python@v4
83
+ uses : actions/setup-python@v5
79
84
with :
80
85
python-version : ${{ matrix.python-version }}
81
86
- name : Install dependencies
@@ -85,37 +90,41 @@ jobs:
85
90
pip install -r requirements.txt
86
91
python -m pip install -e .
87
92
- name : Run Tests
88
- run : |
93
+ run : |
89
94
coverage erase
90
95
coverage run --context=${{ matrix.os }}.py${{ matrix.python-version }} --source=pecos --omit="*/tests/*" -m pytest --doctest-modules --doctest-glob="*.rst" pecos
91
96
coverage run --context=${{ matrix.os }}.py${{ matrix.python-version }} --source=pecos --omit="*/tests/*" --append -m pytest --doctest-glob="*.rst" documentation
92
97
env :
93
98
COVERAGE_FILE : .coverage.${{ matrix.python-version }}.${{ matrix.os }}
94
99
- name : Save coverage
95
- uses : actions/upload-artifact@v2
100
+ uses : actions/upload-artifact@v4
96
101
with :
97
- name : coverage
102
+ name : . coverage.${{ matrix.python-version }}.${{ matrix.os }}
98
103
path : .coverage.${{ matrix.python-version }}.${{ matrix.os }}
104
+ include-hidden-files : true
99
105
100
106
combine_reports :
101
- needs : [ pytest_coverage ]
107
+ needs : [ run_coverage ]
102
108
runs-on : ubuntu-latest
103
109
steps :
104
110
- name : Set up Python
105
- uses : actions/setup-python@v4
111
+ uses : actions/setup-python@v5
106
112
with :
107
113
python-version : 3.11
108
- - uses : actions/checkout@v2
114
+ - uses : actions/checkout@v4
109
115
- name : Install coverage
110
116
run : |
111
117
python -m pip install --upgrade pip
112
118
pip install -r requirements.txt
113
119
python -m pip install -e .
120
+ pip install coveralls
114
121
- name : Download coverage artifacts from test matrix
115
- uses : actions/download-artifact@v2
122
+ uses : actions/download-artifact@v4
116
123
with :
117
- name : coverage
124
+ pattern : . coverage.*.ubuntu-latest # coverage from other OS cause problems
118
125
- name : Setup coverage and combine reports
126
+ run : coverage combine .coverage.*.ubuntu-latest
127
+ - name : Create coverage report
119
128
run : |
120
129
echo "[paths]" > .coveragerc
121
130
echo "source = " >> .coveragerc
@@ -124,55 +133,21 @@ jobs:
124
133
echo " D:\\a\\pecos\\pecos\\pecos" >> .coveragerc
125
134
echo " /home/runner/work/pecos/pecos/pecos" >> .coveragerc
126
135
echo " /Users/runner/work/pecos/pecos/pecos" >> .coveragerc
127
- coverage combine
128
- - name : Create coverage report
129
- run : |
136
+ echo " ${{ github.workspace }}/pecos" >> .coveragerc
130
137
coverage report
131
138
coverage json --pretty-print
132
139
coverage html --show-contexts
133
140
- name : Save coverage JSON
134
- uses : actions/upload-artifact@v2
141
+ uses : actions/upload-artifact@v4
135
142
with :
136
- name : coverage
143
+ name : coverage-json
137
144
path : coverage.json
138
145
- name : Save coverage html
139
- uses : actions/upload-artifact@v2
146
+ uses : actions/upload-artifact@v4
140
147
with :
141
- name : coverage
148
+ name : coverage-html
142
149
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
174
150
- name : Push to coveralls
175
- run : |
176
- coveralls --service=github
151
+ run : coveralls --service=github --rcfile=.coveragerc
177
152
env :
178
153
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
0 commit comments