Skip to content

Pre-emptively prevent test fixtures from lingering global state #256

Pre-emptively prevent test fixtures from lingering global state

Pre-emptively prevent test fixtures from lingering global state #256

Workflow file for this run

name: Code Check
on:
workflow_dispatch:
pull_request:
types:
- opened
- synchronize
- reopened
jobs:
build:
name: Build And Test Go code
runs-on: ubuntu-latest
env:
CGO_ENABLED: 0
steps:
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '1.20'
- name: Check out code into the Go module directory
uses: actions/checkout@v4
# https://stackoverflow.com/questions/76269119/github-actions-go-lambda-project-different-sha256sums
- name: Build
run: go build -v -buildvcs=false ./...
- name: Test
# -count=2 ensures that test fixtures cleanup after themselves
# because any leftover state will generally cause the second run to fail.
run: go test -p 1 -v -shuffle=on -count=2 ./...
- name: Linter
uses: golangci/golangci-lint-action@v6
with:
version: latest
env:
GOFLAGS: "-buildvcs=false"