Skip to content

Warm the fanout benchmark graph before its timed window #531

Warm the fanout benchmark graph before its timed window

Warm the fanout benchmark graph before its timed window #531

Workflow file for this run

name: ci
on:
push:
branches: [main]
tags:
- 'v*'
- 'rtpav/v*'
- 'webrtcav/v*'
- 'playoutav/v*'
pull_request:
permissions:
contents: read
jobs:
gate:
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
go: '1.26.x'
full: true
- os: ubuntu-latest
go: stable
full: false
- os: macos-latest
go: '1.26.x'
full: false
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v5
with:
fetch-depth: 50
- uses: actions/setup-go@v6
with:
go-version: ${{ matrix.go }}
# Without check-latest a stale runner image can pin an older patch
# release, and govulncheck then fails on already-fixed stdlib vulns.
check-latest: true
cache: true
- name: Changelog hygiene
if: matrix.full && github.event_name == 'pull_request'
run: |
if jq -e 'any(.pull_request.labels[]?.name; . == "skip-changelog")' "$GITHUB_EVENT_PATH" >/dev/null; then
echo "skip-changelog label present"
exit 0
fi
git fetch --no-tags --depth=1 origin "${{ github.event.pull_request.base.sha }}"
if ! git diff --name-only "${{ github.event.pull_request.base.sha }}"...HEAD | grep -qx 'CHANGELOG.md'; then
echo "CHANGELOG.md must be updated, or apply the skip-changelog label for internal-only changes"
exit 1
fi
- name: Build (pure Go)
run: CGO_ENABLED=0 go build ./...
# The full job collects coverage in the same run instead of executing
# the identical suite twice.
- name: Test
if: ${{ !matrix.full }}
run: CGO_ENABLED=0 go test -count=1 ./...
- name: Test with coverage
if: matrix.full
run: CGO_ENABLED=0 go test -count=1 -covermode=atomic -coverprofile=coverage.out ./...
- name: Upload coverage artifact
if: matrix.full
uses: actions/upload-artifact@v4
with:
name: coverage-${{ matrix.os }}-${{ matrix.go }}
path: coverage.out
- name: Race
if: matrix.full
run: CGO_ENABLED=1 go test -race -count=1 ./...
# One iteration per benchmark: catches bench bit-rot (compile/run errors)
# without asserting timing, which would flake on shared runners.
- name: Bench smoke
if: matrix.full
run: |
mkdir -p bench-results
CGO_ENABLED=0 go test -run '^$' -bench . -benchmem -benchtime=1x ./... | tee bench-results/bench-smoke.txt
- name: PGO profile freshness
if: matrix.full
run: scripts/bench/check-pgo.sh
- name: Benchmark baseline ratchet
if: matrix.full
run: scripts/bench/baseline.sh check
- name: Performance lab smoke
if: matrix.full
run: PERF_BENCHTIME=1x scripts/bench/perf-lab.sh
- name: Benchmark comparison against PR base
if: matrix.full && github.event_name == 'pull_request'
run: |
git fetch --no-tags --depth=1 origin "${{ github.event.pull_request.base.sha }}"
BENCH_COMPARE_COUNT=3 BENCH_COMPARE_TIME=1x scripts/bench/ci-compare.sh FETCH_HEAD
- name: Upload benchmark artifact
if: matrix.full
uses: actions/upload-artifact@v4
with:
name: bench-smoke-${{ matrix.os }}-${{ matrix.go }}
path: |
bench-results/bench-smoke.txt
bench-results/perf-lab-*.txt
bench-results/baseline/**/*.txt
bench-results/latency/*.json
bench-results/rss/*.json
bench-results/soak/*.json
bench-results/pressure/*.json
bench-results/control/*.json
bench-results/fanout/*.json
bench-results/live-sync/*.json
bench-results/container/*.json
bench-results/manifest/*.json
bench-results/pprof/**
bench-results/bench-base.txt
bench-results/bench-current.txt
bench-results/benchstat-pr-vs-base.txt
- name: Fuzz smoke
if: matrix.full
run: |
CGO_ENABLED=0 go test ./container/matroska -run '^$' -fuzz=FuzzDemuxerMalformedInputs -fuzztime=10s
CGO_ENABLED=0 go test ./container/webm -run '^$' -fuzz=FuzzDemuxerMalformedInputs -fuzztime=10s
- name: Vet
run: CGO_ENABLED=0 go vet ./...
- name: Package documentation smoke
if: matrix.full
run: |
missing="$(go list -f '{{if not .Doc}}{{.ImportPath}}{{end}}' ./... | grep -Ev '/internal/|/adapters/|/container/|/adapterproof$' || true)"
if [ -n "$missing" ]; then
echo "public packages without package docs:"
echo "$missing"
exit 1
fi
- name: Staticcheck
if: matrix.full
run: |
go install honnef.co/go/tools/cmd/staticcheck@v0.7.0
staticcheck ./...
- name: Govulncheck
if: matrix.full
run: |
go install golang.org/x/vuln/cmd/govulncheck@latest
govulncheck ./...
- name: Gofmt
run: test -z "$(gofmt -l .)"
- name: goavtest expect module
if: matrix.full
working-directory: goavtest/expect
run: |
CGO_ENABLED=0 go build ./...
CGO_ENABLED=0 go test -count=1 ./...
CGO_ENABLED=0 go vet ./...
staticcheck ./...
govulncheck ./...
# Transport modules stay outside the root module graph
# (TestRootModuleDependencyPurity); each is gated like the root.
- name: rtpav module
if: matrix.full
working-directory: rtpav
run: |
CGO_ENABLED=0 go build ./...
CGO_ENABLED=0 go test -count=1 ./...
CGO_ENABLED=1 go test -race -count=1 ./...
CGO_ENABLED=0 go vet ./...
staticcheck ./...
govulncheck ./...
- name: webrtcav module
if: matrix.full
working-directory: webrtcav
run: |
CGO_ENABLED=0 go build ./...
CGO_ENABLED=0 go test -count=1 ./...
CGO_ENABLED=1 go test -race -count=1 ./...
CGO_ENABLED=0 go vet ./...
staticcheck ./...
govulncheck ./...
- name: playoutav module
if: matrix.full
working-directory: playoutav
run: |
CGO_ENABLED=0 go build ./...
CGO_ENABLED=0 go test -count=1 ./...
CGO_ENABLED=1 go test -race -count=1 ./...
CGO_ENABLED=0 go vet ./...
staticcheck ./...
govulncheck ./...
- name: Examples modules
if: matrix.full
run: |
for mod in examples/*/go.mod; do
dir="$(dirname "$mod")"
echo "::group::$dir"
(cd "$dir" && CGO_ENABLED=0 go build ./... && CGO_ENABLED=0 go test -count=1 ./...)
echo "::endgroup::"
done
- name: Release tag validation
if: startsWith(github.ref, 'refs/tags/')
run: |
case "${GITHUB_REF_NAME}" in
v[0-9]*.[0-9]*.[0-9]*|rtpav/v[0-9]*.[0-9]*.[0-9]*|webrtcav/v[0-9]*.[0-9]*.[0-9]*|playoutav/v[0-9]*.[0-9]*.[0-9]*)
;;
*)
echo "unexpected tag shape: ${GITHUB_REF_NAME}" >&2
exit 1
;;
esac
git verify-tag "${GITHUB_REF_NAME}"
test -s CHANGELOG.md