-
Notifications
You must be signed in to change notification settings - Fork 1
Bootstrap CI: test matrix and AI code review workflows #2
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,109 @@ | ||||||||||||||||||||||||||||||
| name: CI | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| on: | ||||||||||||||||||||||||||||||
| push: | ||||||||||||||||||||||||||||||
| branches: [main] | ||||||||||||||||||||||||||||||
| paths-ignore: [".github/**"] | ||||||||||||||||||||||||||||||
| pull_request: | ||||||||||||||||||||||||||||||
| branches: [main] | ||||||||||||||||||||||||||||||
| paths-ignore: [".github/**"] | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| # The crate jobs never need more than read access. | ||||||||||||||||||||||||||||||
| permissions: | ||||||||||||||||||||||||||||||
| contents: read | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| env: | ||||||||||||||||||||||||||||||
| CARGO_TERM_COLOR: always | ||||||||||||||||||||||||||||||
|
Comment on lines
+7
to
+16
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggestion:
Suggested change
|
||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| jobs: | ||||||||||||||||||||||||||||||
|
Comment on lines
+15
to
+18
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggestion:
Suggested change
|
||||||||||||||||||||||||||||||
| fmt: | ||||||||||||||||||||||||||||||
| name: Format | ||||||||||||||||||||||||||||||
| runs-on: ubuntu-latest | ||||||||||||||||||||||||||||||
| timeout-minutes: 15 | ||||||||||||||||||||||||||||||
| steps: | ||||||||||||||||||||||||||||||
|
Comment on lines
+19
to
+23
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggestion:
Suggested change
|
||||||||||||||||||||||||||||||
| - uses: actions/checkout@v4 | ||||||||||||||||||||||||||||||
| # Pinned to the MSRV so rustfmt matches the version clippy/test use. | ||||||||||||||||||||||||||||||
| - uses: dtolnay/rust-toolchain@ffaa7fb73f2b6e3c49bc425913220fa3d71c3ee5 # 1.92.0 | ||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||
| components: rustfmt | ||||||||||||||||||||||||||||||
| - run: cargo fmt --all --check | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| clippy: | ||||||||||||||||||||||||||||||
| name: Clippy (${{ matrix.features }}) | ||||||||||||||||||||||||||||||
| runs-on: ubuntu-latest | ||||||||||||||||||||||||||||||
| timeout-minutes: 45 | ||||||||||||||||||||||||||||||
| strategy: | ||||||||||||||||||||||||||||||
| fail-fast: false | ||||||||||||||||||||||||||||||
| matrix: | ||||||||||||||||||||||||||||||
| features: ["--no-default-features", "--no-default-features --features node", "--no-default-features --features indexer", "--no-default-features --features wallet", "--no-default-features --features crypto", "--all-features"] | ||||||||||||||||||||||||||||||
| steps: | ||||||||||||||||||||||||||||||
| - uses: actions/checkout@v4 | ||||||||||||||||||||||||||||||
| - uses: dtolnay/rust-toolchain@ffaa7fb73f2b6e3c49bc425913220fa3d71c3ee5 # 1.92.0 | ||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||
| components: clippy | ||||||||||||||||||||||||||||||
| - uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2 | ||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||
| key: ${{ matrix.features }} | ||||||||||||||||||||||||||||||
| - run: cargo clippy ${{ matrix.features }} --all-targets --locked -- -D warnings | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| test: | ||||||||||||||||||||||||||||||
| name: Test (${{ matrix.features }}) | ||||||||||||||||||||||||||||||
| runs-on: ubuntu-latest | ||||||||||||||||||||||||||||||
| timeout-minutes: 45 | ||||||||||||||||||||||||||||||
| strategy: | ||||||||||||||||||||||||||||||
| fail-fast: false | ||||||||||||||||||||||||||||||
| matrix: | ||||||||||||||||||||||||||||||
| features: ["--no-default-features", "--no-default-features --features node", "--no-default-features --features indexer", "--no-default-features --features wallet", "--no-default-features --features crypto", "--all-features"] | ||||||||||||||||||||||||||||||
| steps: | ||||||||||||||||||||||||||||||
| - uses: actions/checkout@v4 | ||||||||||||||||||||||||||||||
| - uses: dtolnay/rust-toolchain@ffaa7fb73f2b6e3c49bc425913220fa3d71c3ee5 # 1.92.0 | ||||||||||||||||||||||||||||||
| - uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2 | ||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||
| key: ${{ matrix.features }} | ||||||||||||||||||||||||||||||
| - run: cargo test ${{ matrix.features }} --locked | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| # Cross-platform test gate, mirroring mintlayer-core's build.yml: the full | ||||||||||||||||||||||||||||||
| # suite runs on every supported OS with the lockfile held fixed. | ||||||||||||||||||||||||||||||
| platform-tests: | ||||||||||||||||||||||||||||||
| name: Test (${{ matrix.os }}) | ||||||||||||||||||||||||||||||
| strategy: | ||||||||||||||||||||||||||||||
| fail-fast: false | ||||||||||||||||||||||||||||||
| matrix: | ||||||||||||||||||||||||||||||
| os: [ubuntu-latest, macos-latest, windows-latest] | ||||||||||||||||||||||||||||||
| runs-on: ${{ matrix.os }} | ||||||||||||||||||||||||||||||
| timeout-minutes: 60 | ||||||||||||||||||||||||||||||
| steps: | ||||||||||||||||||||||||||||||
| - name: Shorten CARGO_HOME on Windows | ||||||||||||||||||||||||||||||
| if: runner.os == 'Windows' | ||||||||||||||||||||||||||||||
| shell: bash | ||||||||||||||||||||||||||||||
| # The default path blows past the Windows MAX_PATH limit inside the | ||||||||||||||||||||||||||||||
| # mintlayer-core git checkouts (same reason mintlayer-core's own | ||||||||||||||||||||||||||||||
| # build.yml does this). | ||||||||||||||||||||||||||||||
| run: echo "CARGO_HOME=C:\crg" >> "$GITHUB_ENV" | ||||||||||||||||||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Intentional: the override is set for all subsequent steps precisely so that rust-cache and cargo resolve the same short CARGO_HOME on Windows (registry/target under C:\crg), keeping the cache path consistent across runs. rust-cache v2 derives the cargo home from the effective environment, so caching is active — just relocated. If we ever see silent cache misses on the Windows leg we can pin |
||||||||||||||||||||||||||||||
| - uses: actions/checkout@v4 | ||||||||||||||||||||||||||||||
| - uses: dtolnay/rust-toolchain@ffaa7fb73f2b6e3c49bc425913220fa3d71c3ee5 # 1.92.0 | ||||||||||||||||||||||||||||||
| - uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2 | ||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||
| key: ${{ matrix.os }} | ||||||||||||||||||||||||||||||
| - run: cargo build --all-features --locked --examples | ||||||||||||||||||||||||||||||
| - run: cargo test --all-features --locked | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| doc: | ||||||||||||||||||||||||||||||
| name: Documentation | ||||||||||||||||||||||||||||||
| runs-on: ubuntu-latest | ||||||||||||||||||||||||||||||
| timeout-minutes: 30 | ||||||||||||||||||||||||||||||
| steps: | ||||||||||||||||||||||||||||||
| - uses: actions/checkout@v4 | ||||||||||||||||||||||||||||||
| - uses: dtolnay/rust-toolchain@ffaa7fb73f2b6e3c49bc425913220fa3d71c3ee5 # 1.92.0 | ||||||||||||||||||||||||||||||
| - uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2 | ||||||||||||||||||||||||||||||
| - run: cargo doc --all-features --locked --no-deps | ||||||||||||||||||||||||||||||
| env: | ||||||||||||||||||||||||||||||
| RUSTDOCFLAGS: -D warnings | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| license: | ||||||||||||||||||||||||||||||
| name: License headers | ||||||||||||||||||||||||||||||
| runs-on: ubuntu-latest | ||||||||||||||||||||||||||||||
| timeout-minutes: 15 | ||||||||||||||||||||||||||||||
| steps: | ||||||||||||||||||||||||||||||
| - uses: actions/checkout@v4 | ||||||||||||||||||||||||||||||
| - run: ./scripts/check-license.sh | ||||||||||||||||||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggestion:
Suggested change
|
||||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| name: AI Code Review | ||
|
|
||
| on: | ||
| pull_request: | ||
| types: [opened, synchronize, reopened] | ||
|
|
||
| permissions: | ||
| contents: read | ||
| pull-requests: write | ||
|
|
||
| concurrency: | ||
| group: ocr-${{ github.event.pull_request.number }} | ||
| cancel-in-progress: true | ||
|
|
||
| jobs: | ||
| review: | ||
| # Fork PRs cannot read secrets; skip them cleanly. | ||
| if: github.event.pull_request.head.repo.fork == false | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 40 | ||
| steps: | ||
| - uses: alibaba/open-code-review@494bf1c8d7a19196ab166960a06fef38d69a1d16 # v1.12.0 | ||
| with: | ||
| llm_url: https://api.z.ai/api/coding/paas/v4 | ||
| llm_auth_token: ${{ secrets.OCR_LLM_TOKEN }} | ||
| llm_model: glm-5.3-flash | ||
| llm_use_anthropic: false | ||
| # GLM-5.3 family rejects thinking.type=disabled, which is the | ||
| # action's default extra_body — this override is required. | ||
| llm_extra_body: '{"thinking": {"type": "enabled"}}' | ||
| llm_reasoning_effort: low | ||
| incremental: 'true' | ||
| route_severity_below: 'low' | ||
| max_tokens_budget: '500000' | ||
| review_task_timeout: '15' | ||
| stream_progress: 'true' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
paths-ignore: [".github/**"]on bothpushandpull_requestexcludes the workflow's own file, so changes toci.yml(or other CI configuration) will never trigger CI. A broken or misconfigured workflow would go unnoticed until an unrelated code change happens. Consider removing.github/**from the ignore list, or at least keepingci.ymlitself in scope.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Acknowledged tradeoff: workflow-only PRs would previously have failed all 18 crate jobs with "could not find Cargo.toml" (there is no crate on the bootstrap branch this PR touches). The workflows themselves are exercised on every code-touching PR, and a broken
ci.ymlsurfaces on the next code change. If we want workflow-only changes validated too, the options are a dorny/paths-filter job-level setup or accepting a full 3-platform matrix run on CI-only PRs — happy to switch if preferred.