Skip to content

Merge pull request #172 from PDOK/fix-flacky-test #283

Merge pull request #172 from PDOK/fix-flacky-test

Merge pull request #172 from PDOK/fix-flacky-test #283

Workflow file for this run

---
name: test (go)
on:
push:
branches:
- master
pull_request:
permissions:
contents: write
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup cgo dependencies
run: sudo apt-get update && sudo apt-get install libcurl4-openssl-dev libssl-dev libsqlite3-mod-spatialite
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.22'
- name: Download
run: go mod download all
- name: Generate (fail when generated code is not committed)
run: go generate -v ./... && git diff --exit-code ':!go.sum'
- name: Build
run: go build -v ./...
- name: Unit Test
run: |
go test -v -shuffle=on -coverpkg "$(go list || go list -m | head -1)/..." -coverprofile cover.out.tmp ./...
# remove generate code from coverage results
grep -v "zz_generated" cover.out.tmp > cover.out
- name: Test generating example CRD
run: hack/generate-crd.sh
# we don't (yet) fail on benchmark results, these are just to make sure
# the benchmarks keep working
- name: Benchmark
run: go test -v ./... -bench=. -run=^# -benchmem -count=5
- name: Update coverage report
uses: ncruces/go-coverage-report@v0
with:
coverage-file: cover.out
report: true
chart: false
amend: false
reuse-go: true
if: |
github.event_name == 'push'
continue-on-error: false