Skip to content

Commit 9d60c74

Browse files
committed
Use OS variable in workflow
1 parent 2465f96 commit 9d60c74

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed

.github/workflows/build.yml

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ jobs:
4545
uses: actions/cache/restore@v3
4646
with:
4747
path: /home/runner/.cache/ccache
48-
key: ccache-${{ matrix.c-compiler }}-${{ matrix.py-version }}
48+
key: ccache-${{ runner.os }}-${{ matrix.c-compiler }}-${{ matrix.py-version }}
4949

5050
- uses: actions/setup-python@v4
5151
if: always()
@@ -77,52 +77,52 @@ jobs:
7777
GH_TOKEN: ${{ github.token }}
7878
run: |
7979
gh extension install actions/gh-actions-cache
80-
gh actions-cache delete ccache-${{ matrix.c-compiler}}-${{ matrix.py-version }} --confirm
80+
gh actions-cache delete ccache-${{ runner.os }}-${{ matrix.c-compiler}}-${{ matrix.py-version }} --confirm
8181
continue-on-error: true
8282

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

9090
- name: Ccache report
9191
if: always()
9292
run: ccache -s
9393

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

9898
- name: Run flake8
9999
if: always()
100100
run: |
101101
make flake8
102-
mv flake8.xml flake8-${{ matrix.c-compiler }}-${{ matrix.py-version }}.xml
102+
mv flake8.xml flake8-${{ runner.os }}-${{ matrix.c-compiler }}-${{ matrix.py-version }}.xml
103103
104104
- name: Archive test results
105105
uses: actions/upload-artifact@v3
106106
if: always()
107107
with:
108108
name: Test results
109-
path: test-results-${{ matrix.c-compiler }}-${{ matrix.py-version }}.xml
109+
path: test-results-${{ runner.os }}-${{ matrix.c-compiler }}-${{ matrix.py-version }}.xml
110110

111111
- name: Report test results
112112
uses: dorny/test-reporter@v1
113113
if: always()
114114
with:
115-
name: Test report (${{ matrix.c-compiler }}, Python ${{ matrix.py-version }})
116-
path: test-results-${{ matrix.c-compiler }}-${{ matrix.py-version }}.xml
115+
name: Test report (${{ runner.os }}, ${{ matrix.c-compiler }}, Python ${{ matrix.py-version }})
116+
path: test-results-${{ runner.os }}-${{ matrix.c-compiler }}-${{ matrix.py-version }}.xml
117117
reporter: java-junit
118118
fail-on-error: true
119119

120120
- name: Report flake8 results
121121
uses: dorny/test-reporter@v1
122122
if: always()
123123
with:
124-
name: Flake8 report (${{ matrix.c-compiler }}, Python ${{ matrix.py-version }})
125-
path: flake8-${{ matrix.c-compiler }}-${{ matrix.py-version }}.xml
124+
name: Flake8 report (${{ runner.os }}, ${{ matrix.c-compiler }}, Python ${{ matrix.py-version }})
125+
path: flake8-${{ runner.os }}-${{ matrix.c-compiler }}-${{ matrix.py-version }}.xml
126126
reporter: java-junit
127127
fail-on-error: false
128128

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

159159
- name: Setup GNU Fortran
160160
uses: modflowpy/install-gfortran-action@v1
@@ -186,36 +186,36 @@ jobs:
186186
GH_TOKEN: ${{ github.token }}
187187
run: |
188188
gh extension install actions/gh-actions-cache
189-
gh actions-cache delete ccache-mac-${{ matrix.py-version }} --confirm
189+
gh actions-cache delete ccache-${{ runner.os }}-${{ matrix.py-version }} --confirm
190190
continue-on-error: true
191191

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

199199
- name: Ccache report
200200
if: always()
201201
run: ccache -s
202202

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

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

214214
- name: Report test results
215215
uses: dorny/test-reporter@v1
216216
if: always()
217217
with:
218-
name: Test report (Mac, Python ${{ matrix.py-version }})
219-
path: test-results-Mac-${{ matrix.py-version }}.xml
218+
name: Test report (${{ runner.os }}, Python ${{ matrix.py-version }})
219+
path: test-results-${{ runner.os }}-${{ matrix.py-version }}.xml
220220
reporter: java-junit
221221
fail-on-error: true

0 commit comments

Comments
 (0)