Skip to content

Commit 8ac8729

Browse files
committed
Use OS variable in workflow
1 parent 5e3b65b commit 8ac8729

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed

.github/workflows/build.yml

+17-17
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ jobs:
4848
uses: actions/cache/restore@v3
4949
with:
5050
path: /home/runner/.cache/ccache
51-
key: ccache-${{ matrix.c-compiler }}-${{ matrix.py-version }}
51+
key: ccache-${{ runner.os }}-${{ matrix.c-compiler }}-${{ matrix.py-version }}
5252

5353
- uses: actions/setup-python@v4
5454
if: always()
@@ -80,52 +80,52 @@ jobs:
8080
GH_TOKEN: ${{ github.token }}
8181
run: |
8282
gh extension install actions/gh-actions-cache
83-
gh actions-cache delete ccache-${{ matrix.c-compiler}}-${{ matrix.py-version }} --confirm
83+
gh actions-cache delete ccache-${{ runner.os }}-${{ matrix.c-compiler}}-${{ matrix.py-version }} --confirm
8484
continue-on-error: true
8585

8686
- name: Push ccache cache
8787
if: always()
8888
uses: actions/cache/save@v3
8989
with:
9090
path: /home/runner/.cache/ccache
91-
key: ccache-${{ matrix.c-compiler }}-${{ matrix.py-version }}
91+
key: ccache-${{ runner.os }}-${{ matrix.c-compiler }}-${{ matrix.py-version }}
9292

9393
- name: Ccache report
9494
if: always()
9595
run: ccache -s
9696

9797
- name: Run tests
9898
if: always()
99-
run: python3 -m pytest --junit-xml=test-results-${{ matrix.c-compiler }}-${{ matrix.py-version }}.xml tests/
99+
run: python3 -m pytest --junit-xml=test-results-${{ runner.os }}-${{ matrix.c-compiler }}-${{ matrix.py-version }}.xml tests/
100100

101101
- name: Run flake8
102102
if: always()
103103
run: |
104104
make flake8
105-
mv flake8.xml flake8-${{ matrix.c-compiler }}-${{ matrix.py-version }}.xml
105+
mv flake8.xml flake8-${{ runner.os }}-${{ matrix.c-compiler }}-${{ matrix.py-version }}.xml
106106
107107
- name: Archive test results
108108
uses: actions/upload-artifact@v3
109109
if: always()
110110
with:
111111
name: Test results
112-
path: test-results-${{ matrix.c-compiler }}-${{ matrix.py-version }}.xml
112+
path: test-results-${{ runner.os }}-${{ matrix.c-compiler }}-${{ matrix.py-version }}.xml
113113

114114
- name: Report test results
115115
uses: dorny/test-reporter@v1
116116
if: always()
117117
with:
118-
name: Test report (${{ matrix.c-compiler }}, Python ${{ matrix.py-version }})
119-
path: test-results-${{ matrix.c-compiler }}-${{ matrix.py-version }}.xml
118+
name: Test report (${{ runner.os }}, ${{ matrix.c-compiler }}, Python ${{ matrix.py-version }})
119+
path: test-results-${{ runner.os }}-${{ matrix.c-compiler }}-${{ matrix.py-version }}.xml
120120
reporter: java-junit
121121
fail-on-error: true
122122

123123
- name: Report flake8 results
124124
uses: dorny/test-reporter@v1
125125
if: always()
126126
with:
127-
name: Flake8 report (${{ matrix.c-compiler }}, Python ${{ matrix.py-version }})
128-
path: flake8-${{ matrix.c-compiler }}-${{ matrix.py-version }}.xml
127+
name: Flake8 report (${{ runner.os }}, ${{ matrix.c-compiler }}, Python ${{ matrix.py-version }})
128+
path: flake8-${{ runner.os }}-${{ matrix.c-compiler }}-${{ matrix.py-version }}.xml
129129
reporter: java-junit
130130
fail-on-error: false
131131

@@ -157,7 +157,7 @@ jobs:
157157
uses: actions/cache/restore@v3
158158
with:
159159
path: /Users/runner/Library/Caches/ccache
160-
key: ccache-mac-${{ matrix.py-version }}
160+
key: ccache-${{ runner.os }}-${{ matrix.py-version }}
161161

162162
- name: Setup GNU Fortran
163163
uses: modflowpy/install-gfortran-action@v1
@@ -189,36 +189,36 @@ jobs:
189189
GH_TOKEN: ${{ github.token }}
190190
run: |
191191
gh extension install actions/gh-actions-cache
192-
gh actions-cache delete ccache-mac-${{ matrix.py-version }} --confirm
192+
gh actions-cache delete ccache-${{ runner.os }}-${{ matrix.py-version }} --confirm
193193
continue-on-error: true
194194

195195
- name: Push ccache cache
196196
if: always()
197197
uses: actions/cache/save@v3
198198
with:
199199
path: /Users/runner/Library/Caches/ccache
200-
key: ccache-mac-${{ matrix.py-version }}
200+
key: ccache-${{ runner.os }}-${{ matrix.py-version }}
201201

202202
- name: Ccache report
203203
if: always()
204204
run: ccache -s
205205

206206
- name: Run tests
207207
if: always()
208-
run: python3 -m pytest --junit-xml=test-results-Mac-${{ matrix.py-version }}.xml tests/
208+
run: python3 -m pytest --junit-xml=test-results-${{ runner.os }}-${{ matrix.py-version }}.xml tests/
209209

210210
- name: Archive test results
211211
uses: actions/upload-artifact@v3
212212
if: always()
213213
with:
214214
name: Test results
215-
path: test-results-${{ matrix.py-version }}.xml
215+
path: test-results-${{ runner.os }}-${{ matrix.py-version }}.xml
216216

217217
- name: Report test results
218218
uses: dorny/test-reporter@v1
219219
if: always()
220220
with:
221-
name: Test report (Mac, Python ${{ matrix.py-version }})
222-
path: test-results-Mac-${{ matrix.py-version }}.xml
221+
name: Test report (${{ runner.os }}, Python ${{ matrix.py-version }})
222+
path: test-results-${{ runner.os }}-${{ matrix.py-version }}.xml
223223
reporter: java-junit
224224
fail-on-error: true

0 commit comments

Comments
 (0)