Repository navigation
feat(pr-size): opt-in exclude_tests so the cap measures production code (BE-6791) #35
Workflow file for this run
This file contains hidden or 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: Test pr-size script | |
| # Runs the Go unit tests (+ gofmt/vet) for the PR-size checker behind | |
| # pr-size.yml. The checker gates every consumer repo's PRs, so a counting | |
| # regression silently blocks (or waves through) PRs org-wide — cheap to guard | |
| # with a unit run on change. | |
| on: | |
| pull_request: | |
| paths: | |
| - 'scripts/check-pr-size/**' | |
| - '.github/workflows/test-pr-size.yml' | |
| push: | |
| branches: [main] | |
| paths: | |
| - 'scripts/check-pr-size/**' | |
| - '.github/workflows/test-pr-size.yml' | |
| permissions: | |
| contents: read | |
| jobs: | |
| test: | |
| name: go test | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: scripts/check-pr-size | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| persist-credentials: false | |
| - name: Set up Go | |
| uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0 | |
| with: | |
| go-version-file: scripts/check-pr-size/go.mod | |
| # The module is dependency-free (no go.sum) — nothing to cache. | |
| cache: false | |
| - name: gofmt | |
| run: | | |
| UNFORMATTED="$(gofmt -l .)" | |
| if [ -n "$UNFORMATTED" ]; then | |
| echo "gofmt needed on:" | |
| echo "$UNFORMATTED" | |
| exit 1 | |
| fi | |
| - name: go vet | |
| run: go vet ./... | |
| - name: go test | |
| run: go test ./... |