-
Notifications
You must be signed in to change notification settings - Fork 0
28 lines (27 loc) · 1013 Bytes
/
test-project.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
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.22", "1.23"]
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 ] || (2>&1 echo "failed to establish that files were unchanged before running go-generate check" ; exit 1)
go generate ./...
[ `git status --porcelain=1 | wc -l` -eq 0 ] || (2>&1 echo "files changed after running go-generate" ; exit 1)
- name: test without race
run: go test ./...
- name: test with race
run: go test -race ./...