Merge branch 'main' into service-engine-enhance #6608
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: PKG Build and Test | |
on: [push] | |
jobs: | |
build-test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 | |
- name: Set up Go | |
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0 | |
with: | |
go-version-file: "go.mod" | |
- name: Build | |
run: go build -v ./... | |
- name: Unit Tests | |
run: GORACE="log_path=$PWD/race" go test -race ./... -coverpkg=./... -coverprofile=coverage.txt | |
- name: Print Races | |
if: failure() | |
id: print-races | |
run: | | |
find race.* | xargs cat > race.txt | |
if [[ -s race.txt ]]; then | |
cat race.txt | |
fi | |
- name: Fuzz Tests | |
# the amount of --seconds here is subject to change based on how long the CI job takes in the future | |
# as we add more fuzz tests, we should take into consideration increasing this timelapse, so we can have enough coverage. | |
# We are timing out after ~10mins in case the tests hang. (Current CI duration is ~7m, modify if needed) | |
# See https://github.com/golang/go/issues/52569 there's a bug that causes fuzz tests to fail if they run too long. | |
# 12s was working for a long time in core, and always ran successfully for > 12 s for this repo before failing too. | |
# Note: Users in a linked issue said that it took hours to fail on a mac, vs seconds or minutes on linux. | |
run: cd fuzz && timeout 10m ./fuzz_all_native.py --ci --seconds 12 | |
- name: Log Fuzz Tests Failing Inputs | |
if: failure() | |
run: find . -type f|fgrep '/testdata/fuzz/'|while read f; do echo $f; cat $f; done | |
- name: Upload Go test results | |
if: always() | |
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3 | |
with: | |
name: go-test-results | |
path: | | |
./coverage.txt | |
./race.* | |
check-tidy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 | |
- name: Set up Go | |
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0 | |
with: | |
go-version-file: "go.mod" | |
- name: Ensure "make gomodtidy" has been run | |
run: | | |
make gomodtidy | |
git diff --minimal --exit-code | |
- name: Ensure "make generate" has been run | |
run: | | |
make rm-mocked | |
make rm-builders | |
make generate | |
git diff --stat --exit-code |