From 9d60c74c0b36d0d46727cc36587e56c8820cc876 Mon Sep 17 00:00:00 2001 From: Christian Glusa Date: Sun, 26 Nov 2023 18:58:52 -0700 Subject: [PATCH] Use OS variable in workflow --- .github/workflows/build.yml | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a983f705..3ab301ac 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -45,7 +45,7 @@ jobs: uses: actions/cache/restore@v3 with: path: /home/runner/.cache/ccache - key: ccache-${{ matrix.c-compiler }}-${{ matrix.py-version }} + key: ccache-${{ runner.os }}-${{ matrix.c-compiler }}-${{ matrix.py-version }} - uses: actions/setup-python@v4 if: always() @@ -77,7 +77,7 @@ jobs: GH_TOKEN: ${{ github.token }} run: | gh extension install actions/gh-actions-cache - gh actions-cache delete ccache-${{ matrix.c-compiler}}-${{ matrix.py-version }} --confirm + gh actions-cache delete ccache-${{ runner.os }}-${{ matrix.c-compiler}}-${{ matrix.py-version }} --confirm continue-on-error: true - name: Push ccache cache @@ -85,7 +85,7 @@ jobs: uses: actions/cache/save@v3 with: path: /home/runner/.cache/ccache - key: ccache-${{ matrix.c-compiler }}-${{ matrix.py-version }} + key: ccache-${{ runner.os }}-${{ matrix.c-compiler }}-${{ matrix.py-version }} - name: Ccache report if: always() @@ -93,27 +93,27 @@ jobs: - name: Run tests if: always() - run: python3 -m pytest --junit-xml=test-results-${{ matrix.c-compiler }}-${{ matrix.py-version }}.xml tests/ + run: python3 -m pytest --junit-xml=test-results-${{ runner.os }}-${{ matrix.c-compiler }}-${{ matrix.py-version }}.xml tests/ - name: Run flake8 if: always() run: | make flake8 - mv flake8.xml flake8-${{ matrix.c-compiler }}-${{ matrix.py-version }}.xml + mv flake8.xml flake8-${{ runner.os }}-${{ matrix.c-compiler }}-${{ matrix.py-version }}.xml - name: Archive test results uses: actions/upload-artifact@v3 if: always() with: name: Test results - path: test-results-${{ matrix.c-compiler }}-${{ matrix.py-version }}.xml + path: test-results-${{ runner.os }}-${{ matrix.c-compiler }}-${{ matrix.py-version }}.xml - name: Report test results uses: dorny/test-reporter@v1 if: always() with: - name: Test report (${{ matrix.c-compiler }}, Python ${{ matrix.py-version }}) - path: test-results-${{ matrix.c-compiler }}-${{ matrix.py-version }}.xml + name: Test report (${{ runner.os }}, ${{ matrix.c-compiler }}, Python ${{ matrix.py-version }}) + path: test-results-${{ runner.os }}-${{ matrix.c-compiler }}-${{ matrix.py-version }}.xml reporter: java-junit fail-on-error: true @@ -121,8 +121,8 @@ jobs: uses: dorny/test-reporter@v1 if: always() with: - name: Flake8 report (${{ matrix.c-compiler }}, Python ${{ matrix.py-version }}) - path: flake8-${{ matrix.c-compiler }}-${{ matrix.py-version }}.xml + name: Flake8 report (${{ runner.os }}, ${{ matrix.c-compiler }}, Python ${{ matrix.py-version }}) + path: flake8-${{ runner.os }}-${{ matrix.c-compiler }}-${{ matrix.py-version }}.xml reporter: java-junit fail-on-error: false @@ -154,7 +154,7 @@ jobs: uses: actions/cache/restore@v3 with: path: /Users/runner/Library/Caches/ccache - key: ccache-mac-${{ matrix.py-version }} + key: ccache-${{ runner.os }}-${{ matrix.py-version }} - name: Setup GNU Fortran uses: modflowpy/install-gfortran-action@v1 @@ -186,7 +186,7 @@ jobs: GH_TOKEN: ${{ github.token }} run: | gh extension install actions/gh-actions-cache - gh actions-cache delete ccache-mac-${{ matrix.py-version }} --confirm + gh actions-cache delete ccache-${{ runner.os }}-${{ matrix.py-version }} --confirm continue-on-error: true - name: Push ccache cache @@ -194,7 +194,7 @@ jobs: uses: actions/cache/save@v3 with: path: /Users/runner/Library/Caches/ccache - key: ccache-mac-${{ matrix.py-version }} + key: ccache-${{ runner.os }}-${{ matrix.py-version }} - name: Ccache report if: always() @@ -202,20 +202,20 @@ jobs: - name: Run tests if: always() - run: python3 -m pytest --junit-xml=test-results-Mac-${{ matrix.py-version }}.xml tests/ + run: python3 -m pytest --junit-xml=test-results-${{ runner.os }}-${{ matrix.py-version }}.xml tests/ - name: Archive test results uses: actions/upload-artifact@v3 if: always() with: name: Test results - path: test-results-${{ matrix.py-version }}.xml + path: test-results-${{ runner.os }}-${{ matrix.py-version }}.xml - name: Report test results uses: dorny/test-reporter@v1 if: always() with: - name: Test report (Mac, Python ${{ matrix.py-version }}) - path: test-results-Mac-${{ matrix.py-version }}.xml + name: Test report (${{ runner.os }}, Python ${{ matrix.py-version }}) + path: test-results-${{ runner.os }}-${{ matrix.py-version }}.xml reporter: java-junit fail-on-error: true