Separate windows step from *nix runners

This allows `bash` and `pwsh` syntax to be used separately to avoid having to write the test as a polyglot 😬

Also added `secrets.GITHUB_TOKEN` as a fallback in case the repo secret `secrets.GH_TOKEN` is not set up, e.g. in a fork.

Signed-off-by: Yuri Norwood <106889957+norwd@users.noreply.github.com>
This commit is contained in:
Yuri Norwood 2022-10-31 08:43:22 +13:00 committed by GitHub
parent 29de9b49ea
commit 8476589e0d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -24,11 +24,19 @@ jobs:
- name: Install gotestfmt
uses: ./
with:
token: ${{ secrets.GH_TOKEN }}
token: ${{ secrets.GH_TOKEN || secrets.GITHUB_TOKEN }}
- name: Run gotestfmt
if: matrix.os != 'windows'
working-directory: testdata
run: go test -json -v ./... 2>&1 | tee /tmp/gotest.${{ matrix.os }}.log | gotestfmt
run: |
go test -json -v ./... 2>&1 | tee /tmp/gotest.${{ matrix.os }}.log | gotestfmt
- name: Run gotestfmt (Windows)
if: matrix.os == 'windows'
working-directory: testdata
run: |
go test -json -v ./... 2>&1 | Tee-Object /tmp/gotest.${{ matrix.os }}.log | gotestfmt
- name: Upload test log
uses: actions/upload-artifact@v3