bump internal dependencies #83
Workflow file for this run
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: Golang Test | |
on: | |
push: | |
pull_request: | |
jobs: | |
golangci-lint: | |
name: golangci-lint | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4 | |
- name: Run golangci-lint | |
uses: golangci/golangci-lint-action@3a919529898de77ec3da873e3063ca4b10e7f5cc # v3 | |
with: | |
# Hard-coding version due to this bug: https://github.com/golangci/golangci-lint-action/issues/535 | |
version: v1.52.2 | |
test: | |
name: go test | |
runs-on: ubuntu-latest | |
env: | |
GITHUB_ACTION: true | |
steps: | |
- name: Checkout | |
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4 | |
- name: Set up Go | |
uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4 | |
with: | |
go-version: 1.19 | |
- uses: actions/setup-python@65d7f2d534ac1bc67fcd62888c5f4f3d2cb2b236 # v4 | |
with: | |
python-version: 'pypy3.9' | |
- name: Set up gotestfmt | |
uses: GoTestTools/gotestfmt-action@v2 | |
- uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 # v3 | |
with: | |
path: | | |
~/go/pkg/mod | |
~/.cache/go-build | |
key: go-test-${{ hashFiles('**/go.sum') }} | |
restore-keys: go-test- | |
- name: Run go test | |
run: | | |
which python | |
set -euo pipefail | |
go generate | |
go test -coverprofile /tmp/coverage.out -json -v ./... 2>&1 | tee /tmp/gotest.log | gotestfmt | |
echo "# Code coverage summary" > /tmp/coverage.md | |
echo "|File|Type|Coverage|" >> /tmp/coverage.md | |
echo "|----|----|--------|" >> /tmp/coverage.md | |
go tool cover -func /tmp/coverage.out | sed -e 's/\s\s*/|/g' -e 's/^/|/g' -e 's/$/|/g' >> /tmp/coverage.md | |
cat /tmp/coverage.md >> $GITHUB_STEP_SUMMARY | |
echo "::group::Code coverage summary" | |
go tool cover -func /tmp/coverage.out | |
echo "::endgroup::" | |
- name: Upload test log | |
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3 | |
if: always() | |
with: | |
name: test-results | |
path: | | |
/tmp/gotest.log | |
/tmp/coverage.out | |
/tmp/coverage.md | |
if-no-files-found: error |