Skip to content

ci: detect companion PR changes and conditionally trigger integration tests#2026

Merged
plebhash merged 1 commit into
stratum-mining:mainfrom
lucasbalieiro:add-companion-feature
Dec 13, 2025
Merged

ci: detect companion PR changes and conditionally trigger integration tests#2026
plebhash merged 1 commit into
stratum-mining:mainfrom
lucasbalieiro:add-companion-feature

Conversation

@lucasbalieiro

@lucasbalieiro lucasbalieiro commented Dec 12, 2025

Copy link
Copy Markdown
Collaborator

closes #2022.

This PR updates ./scripts/run-integration-tests.sh and ./.github/workflows/integration-tests.yaml to support the feature described in the issue #2022.

From now on, whenever you open a PR in this repo and realize the changes should also be reflected in the https://github.com/stratum-mining/sv2-apps repo, you can simply add a line to this PR’s description.

Example (as shown in the image below):

<keyword> <pr_link>
image

This will re-trigger the integration tests, but this time they’ll run against the specified PR in sv2-apps.

@lucasbalieiro lucasbalieiro force-pushed the add-companion-feature branch 3 times, most recently from df90d1b to cd5061c Compare December 12, 2025 19:42
@lucasbalieiro lucasbalieiro marked this pull request as ready for review December 12, 2025 19:52
Comment thread .github/workflows/integration-tests.yaml
Comment on lines -10 to -17
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- ubuntu-latest
include:
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are we intentionally removing these?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, its pointless to have a matrix with just one OS.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now that I’m looking at this, it makes me wonder: shouldn’t the integration tests here also run on macOS? That would actually give the matrix some real purpose, since we’d be testing across multiple OSes, similar to what we already do in sv2-apps.

Reference: https://github.com/stratum-mining/sv2-apps/blob/07b594b6cc22e5ac4adb616931b1d59e0ed288da/.github/workflows/integration-tests.yaml#L11-L21

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I would keep testing also on macos.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done, repurposed the matrix, now we run on mac and ubuntu

Comment thread .github/workflows/integration-tests.yaml
@lucasbalieiro lucasbalieiro force-pushed the add-companion-feature branch 4 times, most recently from c425bbb to 9309608 Compare December 13, 2025 15:43
… tests

Adds logic to parse the line
"companion https://github.com/stratum-mining/sv2-apps/pull/<num>"
from the PR description and expose the extracted number as
COMPANION_PR_NUMBER.

The workflow now re-runs integration tests only when:
- the PR is opened, updated, or reopened, or
- the companion line in the PR body is modified.

Also updates `scripts/run-integration-tests.sh` to support a `--pr`
argument which explicitly specifies the companion PR. If the flag is not
provided, the script falls back to COMPANION_PR_NUMBER, and if that is
unset, defaults to `main`.
@plebhash plebhash merged commit 80c7e7f into stratum-mining:main Dec 13, 2025
14 checks passed
@lucasbalieiro lucasbalieiro deleted the add-companion-feature branch December 13, 2025 16:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

need to refine automation around Integration Tests

3 participants