Merge pull request #17 from josephcopenhaver/jpcope/improved-sampling #143
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: test project | |
on: | |
push: | |
schedule: | |
- cron: "15 12 * * 6" # INIT_CRON_EXPRESSION: echo "$(((RANDOM%60))) $(((RANDOM%24)))"' * * '"$( if [[ $(((RANDOM%2))) -eq 0 ]]; then echo 0; else echo 6; fi )" | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
go: ["1.21"] | |
name: Go ${{ matrix.go }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setup go | |
uses: actions/setup-go@v3 | |
with: | |
go-version: ${{ matrix.go }} | |
- name: verify golang files are consistently formatted and generated | |
run: | | |
[ `git status --porcelain=1 | wc -l` -eq 0 ] || (echo "failed to establish that files were unchanged before running format check" ; exit 1) | |
go generate ./... | |
find . -type f -name '*.go' ! -path './vendor/*' -exec gofmt -l -s -w {} + | |
[ `git status --porcelain=1 | wc -l` -eq 0 ] || (echo "files exist that need to be formatted by gofmt" ; exit 1) | |
- name: test without race | |
run: go test ./... | |
- name: test with race | |
run: go test -race ./... |