Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extend selftest workflow to multiple runners #9

Merged
merged 9 commits into from
Nov 4, 2022
52 changes: 21 additions & 31 deletions .github/workflows/selftest.yml
Original file line number Diff line number Diff line change
@@ -1,52 +1,42 @@
on:
pull_request:

name: Self-test
jobs:
self-test-ubuntu:
name: on Ubuntu
runs-on: ubuntu-latest

self-test:
strategy:
fail-fast: false
matrix:
os: ['ubuntu', 'macos'] # TODO: add windows

name: on ${{ matrix.os }}
runs-on: ${{ matrix.os }}-latest
steps:

- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.16

- name: Checkout
uses: actions/checkout@v2

- name: Install gotestfmt
uses: ./
with:
token: ${{ secrets.GH_TOKEN }}
token: ${{ secrets.GITHUB_TOKEN }}

- name: Run gotestfmt
working-directory: testdata
run: go test -json -v ./... 2>&1 | tee /tmp/gotest.log | gotestfmt
shell: bash
run: |
go test -json -v ./... 2>&1 | tee gotest.${{ matrix.os }}.log | gotestfmt

- name: Upload test log
uses: actions/upload-artifact@v3
if: always()
with:
name: test-log-ubuntu
path: /tmp/gotest.log
name: test-log-${{ matrix.os }}
path: testdata/gotest.${{ matrix.os }}.log
if-no-files-found: error
self-test-macos:
name: on MacOS
runs-on: macos-latest
steps:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.16
- name: Checkout
uses: actions/checkout@v2
- name: Install gotestfmt
uses: ./
with:
token: ${{ secrets.GH_TOKEN }}
- name: Run gotestfmt
working-directory: testdata
run: go test -json -v ./... 2>&1 | tee ./gotest.log | gotestfmt
- name: Upload test log
uses: actions/upload-artifact@v3
if: always()
with:
name: test-log-macos
path: ./testdata/gotest.log
if-no-files-found: error