Patrick/tamper #19
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Run Tests | |
on: | |
push: | |
tags: | |
- v* | |
branches: | |
- main | |
pull_request: | |
jobs: | |
build: | |
name: test | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/setup-go@v3 | |
with: | |
go-version: 1.18 | |
- uses: actions/checkout@v3 | |
# Install gotestfmt on the VM running the action. | |
- name: Set up gotestfmt | |
uses: haveyoudebuggedit/gotestfmt-action@v2 | |
with: | |
# Optional: pass GITHUB_TOKEN to avoid rate limiting. | |
token: ${{ secrets.GITHUB_TOKEN }} | |
# Run tests with nice formatting. Save the original log in /tmp/gotest.log | |
- name: Run tests | |
run: make test-and-cover 2>&1 | tee /tmp/gotest.log | grep '"Time"' | gotestfmt | |
- name: Install goveralls | |
env: | |
GO111MODULE: "off" | |
run: go get github.com/mattn/goveralls | |
- name: Send coverage | |
env: | |
COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: goveralls -coverprofile=profile.cov -service=github |