Repository navigation
ci: run the repository's test suites on pull requests #48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
prometheas
wants to merge
14
commits into
main
Choose a base branch
from
40-ci-test-suites
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+950
−2
Open
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
5eefcdd
ci: run the bats suites on pull requests and pushes to main
prometheas a36ba40
docs: describe the CI workflow and the rule for adding suites
prometheas 4451871
test(ci): parse the Running Tests block strictly in the workflow guard
prometheas 6524e68
ci: give each push to main its own concurrency group
prometheas 254194c
test(ci): require every matrix suite to run and fail the job on failure
prometheas 375fd75
test(ci): require the default pull_request activity types
prometheas 175acc5
test(ci): check every parsed action reference for a full SHA pin
prometheas 73f88bc
test(ci): require the workflow to match one exact expected shape
prometheas bbc8157
test(ci): parse both fence styles in the Running Tests section
prometheas 2550836
test(ci): read each pin's version comment from its own source line
prometheas f404685
chore(ci): stop tracking Python bytecode from the checker
prometheas 6cc4ce3
ci: run the workflow guard suite in its own fixed job
prometheas ce5a8ca
test(ci): reject option-like and non-bats suite paths
prometheas eab509d
test(ci): generate fixture suite paths absent from the real suites
prometheas File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,66 @@ | ||
| name: Tests | ||
|
|
||
| # Runs every bats suite listed under "Running Tests" in docs/development.md. | ||
| # The guard job always runs tests/ci-workflow.bats; the bats job runs every | ||
| # other suite from its matrix. Adding a suite means adding it to both that | ||
| # list and the matrix below; tests/ci-workflow.bats fails when they differ. | ||
| # That suite also requires this file to match EXPECTED in | ||
| # tests/ci-workflow-check.py, apart from the suite list and the action commit | ||
| # SHAs. Any other change to this file needs the same change there. | ||
|
|
||
| on: | ||
| # No branch filter: pull requests into any base branch run the suites. | ||
| pull_request: | ||
| push: | ||
| branches: [main] | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| # Runs for one pull request share a group, so a new commit cancels the | ||
| # superseded run. Each push to main gets its own group, keyed by run ID: in a | ||
| # shared group, a later push would cancel a push run still waiting in the queue. | ||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.ref || github.run_id }} | ||
| cancel-in-progress: ${{ github.event_name == 'pull_request' }} | ||
|
|
||
| jobs: | ||
| # A fixed job rather than a matrix entry, so a change to the matrix cannot | ||
| # drop the check that compares the matrix with the docs. | ||
| guard: | ||
| name: bats tests/ci-workflow.bats | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | ||
| with: | ||
| persist-credentials: false | ||
| - uses: cachix/install-nix-action@382a9ed9481c7c1f94f68b72ef105b3417c73877 # v32.1.0 | ||
| with: | ||
| github_access_token: ${{ secrets.GITHUB_TOKEN }} | ||
| - name: Run suite | ||
| run: nix develop -c bats tests/ci-workflow.bats | ||
|
|
||
| bats: | ||
| name: bats ${{ matrix.suite }} | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| suite: | ||
| - tests/marketplace-package.bats | ||
| - plugins/product-development/tests/plugin-package.bats | ||
| - plugins/product-development/skills/product-development/tests/init.bats | ||
| - plugins/delivery-engineering/tests/plugin-package.bats | ||
| - plugins/okf-bundle/tests/plugin-package.bats | ||
| - plugins/branch-guard/tests | ||
| steps: | ||
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | ||
| with: | ||
| persist-credentials: false | ||
| - uses: cachix/install-nix-action@382a9ed9481c7c1f94f68b72ef105b3417c73877 # v32.1.0 | ||
| with: | ||
| github_access_token: ${{ secrets.GITHUB_TOKEN }} | ||
| - name: Run suite | ||
| env: | ||
| SUITE: ${{ matrix.suite }} | ||
| run: nix develop -c bats "$SUITE" | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,3 @@ | ||
| .direnv/ | ||
|
|
||
| __pycache__/ | ||
| *.pyc |
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.