misc #2751
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 | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
env: | |
GOCACHE: /home/runner/work/omg/.cache/go-build | |
GOMODCACHE: /home/runner/go/pkg/mod | |
# TEST_LOG_LEVEL defines the test log level (default is debug) | |
# TEST_LOG_LEVEL: info | |
name: Go build and test | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-go@v5 | |
with: | |
go-version-file: 'go.mod' | |
cache-dependency-path: go.sum | |
- name: sudo go version | |
run: sudo go version | |
- name: sudo GOCACHE=$GOCACHE GOMODCACHE=$GOMODCACHE go env | |
run: sudo GOCACHE=$GOCACHE GOMODCACHE=$GOMODCACHE go env | |
- name: Build om | |
run: sudo GOCACHE=$GOCACHE GOMODCACHE=$GOMODCACHE go build -v ./cmd/om | |
- name: Build ox | |
run: sudo GOCACHE=$GOCACHE GOMODCACHE=$GOMODCACHE go build -v ./cmd/ox | |
- name: Test root | |
run: sudo TEST_LOG_LEVEL=TEST_LOG_LEVEL GOCACHE=$GOCACHE GOMODCACHE=$GOMODCACHE go test -p 1 -timeout 60s ./... | |
- name: Test root race | |
run: sudo TEST_LOG_LEVEL=TEST_LOG_LEVEL GOCACHE=$GOCACHE GOMODCACHE=$GOMODCACHE go test -p 1 -timeout 600s --race ./... |