implement generate var-file
; wire in to cli
#309
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: Go Tests | |
on: [push] | |
jobs: | |
test: | |
name: Test | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Determine Go version | |
id: get-go-version | |
run: | | |
echo "go-version=$(cat .go-version)" >> $GITHUB_OUTPUT | |
- uses: actions/setup-go@v3 | |
with: | |
go-version: ${{ steps.get-go-version.outputs.go-version }} | |
# Get values for cache paths to be used in later steps | |
- id: go-cache-paths | |
run: | | |
echo "::set-output name=go-build::$(go env GOCACHE)" | |
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@v3 | |
with: | |
path: | | |
${{ steps.go-cache-paths.outputs.go-build }} | |
${{ steps.go-cache-paths.outputs.go-mod }} | |
key: ${{ runner.os }}-go-cache-${{ hashFiles('**/go.sum') }} | |
# install deps using go install | |
- name: Install test dependencies | |
run: | | |
go install gotest.tools/gotestsum@latest | |
make test-certs | |
# Run tests with nice formatting. Save the original log in /tmp/gotest.log | |
- name: Run tests | |
run: | | |
gotestsum -f testname --jsonfile /tmp/test-output.log -- ./... | |
# Upload the original go test log as an artifact for later review. | |
- name: Upload test log | |
uses: actions/upload-artifact@v3 | |
with: | |
name: test-log | |
path: /tmp/test-output.log | |
if-no-files-found: error |