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

ci: Add gotestsum workflow #607

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 0 additions & 12 deletions .github/workflows/cla-check.yaml

This file was deleted.

12 changes: 0 additions & 12 deletions .github/workflows/git.yml

This file was deleted.

52 changes: 52 additions & 0 deletions .github/workflows/gotestfmt.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Run Go tests with gotestfmt

# Run this workflow on pushes to the main branch, on tags, and on pull requests.
on:
push:
branches:
- main
tags:
- "*"
pull_request:

env:
GO_TESTS_TIMEOUT: 20m

jobs:
build:
name: Test
runs-on: ubuntu-latest
steps:
# Checkout your project with git
- name: Checkout
uses: actions/checkout@v4

# Install Go on the VM running the action.
- name: Set up Go
uses: actions/setup-go@v5

# Install gotestfmt on the VM running the action.
- name: Set up gotestfmt
uses: gotesttools/gotestfmt-action@v2
with:
# Optional: pass GITHUB_TOKEN to avoid rate limiting.
token: ${{ secrets.GITHUB_TOKEN }}

# Alternatively, install using go install
- name: Set up gotestfmt
run: go install github.com/gotesttools/gotestfmt/v2/cmd/gotestfmt@latest

# Run tests with nice formatting. Save the original log in /tmp/gotest.log
- name: Run tests
run: |
set -euo pipefail
go test -json -v ./... 2>&1 | tee /tmp/gotest.log | gotestfmt

# Upload the original go test log as an artifact for later review.
- name: Upload test log
uses: actions/upload-artifact@v4
if: always()
with:
name: test-log
path: /tmp/gotest.log
if-no-files-found: error
27 changes: 27 additions & 0 deletions .github/workflows/gotestsum.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Run Go tests with gotestsum

# Run this workflow on pushes to the main branch, on tags, and on pull requests.
on:
push:
branches:
- main
tags:
- "*"
pull_request:

env:
GO_TESTS_TIMEOUT: 20m

jobs:
go-tests:
name: "Go: Tests"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
- name: Install gotestsum
run: go install gotest.tools/gotestsum@latest
- name: Run tests with gotestsum
run: gotestsum --junitfile unit-tests.xml --format github-actions --hide-summary=output
268 changes: 0 additions & 268 deletions .github/workflows/qa.yaml

This file was deleted.

Loading