feat(tms): wire the control-plane tenant syncer into the app lifecycle #57
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: Assay Dogfood | |
| # Dogfooding, deliberately non-blocking: on every Go PR, assay reports which | |
| # tests the diff can actually reach. The selection lands in the job summary | |
| # where reviewers can sanity-check it against their intuition; once it has | |
| # earned trust, `assay run` can replace the run-everything test job. | |
| # | |
| # The Assay Index workflow keeps a coverage index warm in the actions cache on | |
| # every push to the base branches. When the restored index covers the PR's | |
| # merge-base, selection narrows to the individual tests that execute the | |
| # changed lines; packages whose records are stale (or missing after a cache | |
| # miss) fall back to whole-package selection, which is the safe direction. | |
| # | |
| # assay is built with -buildvcs=false so its cache identity matches the index | |
| # job's build; a vcs-stamped binary would reject every cached record. | |
| on: | |
| pull_request: | |
| branches: | |
| - master | |
| - main | |
| - develop | |
| paths: | |
| - "services/**" | |
| - "shared/**" | |
| - "go.work" | |
| - "go.work.sum" | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| permissions: | |
| contents: read | |
| env: | |
| ASSAY_CACHE: /home/runner/.cache/assay | |
| jobs: | |
| select: | |
| name: Report test selection | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 15 | |
| # A defect in assay must never block product work; failures here are | |
| # visible in the summary, not in the merge box. | |
| continue-on-error: true | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| # Selection diffs against the merge-base with the target branch, | |
| # which a shallow clone does not contain. | |
| fetch-depth: 0 | |
| - name: Set up Go | |
| uses: ./.github/actions/setup-go | |
| with: | |
| cache-key: assay | |
| - name: Restore coverage index | |
| uses: actions/cache/restore@v4 | |
| with: | |
| path: /home/runner/.cache/assay | |
| key: assay-index-${{ runner.os }}-${{ github.event.pull_request.base.sha }} | |
| restore-keys: | | |
| assay-index-${{ runner.os }}- | |
| # assay lives in its own repository now; a pinned release version keeps | |
| # runs reproducible, and module builds carry no vcs stamp, so the cache | |
| # identity is stable across runs of the same version. | |
| - name: Install assay | |
| run: | | |
| GOBIN=/tmp go install github.com/emoss08/assay/cmd/assay@v0.7.1 | |
| # The setup-go action's dependency download can rewrite go.work.sum in | |
| # the checkout; a modified module file is a blocking change that would | |
| # degrade narrowing. Restore the tree to exactly what the commit | |
| # describes before selecting. | |
| - name: Restore pristine tree | |
| run: git restore . | |
| - name: Select affected tests | |
| run: | | |
| { | |
| echo "## assay: tests this diff can reach" | |
| echo | |
| echo '```' | |
| /tmp/assay select --since "origin/${GITHUB_BASE_REF}" --verbose --no-color 2>&1 | |
| echo '```' | |
| echo | |
| echo "_Line-level narrowing engages per package when the cached coverage index matches the merge-base; stale or missing records fall back to whole-package selection. See https://github.com/emoss08/assay._" | |
| } | tee -a "$GITHUB_STEP_SUMMARY" |