treewide: Add tests to all Go packages and cleanup #16
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: Run all Go tests | |
on: | |
pull_request: | |
jobs: | |
go-test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install devbox | |
uses: jetify-com/[email protected] | |
with: | |
enable-cache: 'true' | |
- name: Prepare Go build cache | |
id: go-cache-paths | |
run: | | |
devbox run -- echo "::set-output name=go-build::$(go env GOCACHE)" | |
devbox run -- echo "::set-output name=go-mod::$(go env GOMODCACHE)" | |
# Cache go build cache, used to speedup go test | |
- name: Go Build Cache | |
uses: actions/cache@v2 | |
with: | |
path: ${{ steps.go-cache-paths.outputs.go-build }} | |
key: ${{ runner.os }}-go-build-${{ hashFiles('**/go.sum') }} | |
- name: Run the tests | |
if: success() | |
run: devbox run -- go test -v ./... | |
# Cache go mod cache, used to speedup builds | |
- name: Go Mod Cache | |
uses: actions/cache@v2 | |
with: | |
path: ${{ steps.go-cache-paths.outputs.go-mod }} | |
key: ${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }} |