-
Notifications
You must be signed in to change notification settings - Fork 12
ci: include strategy matrix to test different version #51
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
Conversation
WalkthroughThe CI workflow configuration was updated to run the build job across multiple Go versions (1.21 and 1.24) using a matrix strategy. The Go setup step now dynamically selects the version from the matrix, and the step name reflects the current Go version. No other workflow steps were changed. Changes
Poem
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
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.
Actionable comments posted: 0
🧹 Nitpick comments (2)
.github/workflows/ci.yml (2)
27-30: Refine the matrix definition & double-check the highest Go version
1.24is not released yet. Builds for a non-existent version will make the whole job red unlessfail-fastis disabled.- Using a more descriptive key (e.g.
go-version) improves readability and avoids confusion with tool or module versions.- Setting
fail-fast: falselets the CI keep testing the remaining versions if one entry fails.strategy: - matrix: - version: [1.20, 1.21, 1.22, 1.23, 1.24] + fail-fast: false + matrix: + go-version: [1.20, 1.21, 1.22, 1.23] # add 1.24 once officially releasedAfter renaming the key you’ll need to update the references in the steps below.
Please verify that 1.24 is available onsetup-gobefore re-adding it.
35-39: Pin thesetup-goaction to a commit SHA for supply-chain safetyRelying on a floating tag (
@v4) risks unexpected breakage or malicious code injection.
Pinning to the current commit SHA is the recommended practice.- - name: Set up Go ${{ matrix.version }} - uses: actions/setup-go@v4 + - name: Set up Go ${{ matrix.go-version }} + uses: actions/setup-go@v4 # e.g. @v4.1.0 -> @4b2e0e6f2e1a8e2b7c1d58d9d1e44a4a6c0c9d3a with: - go-version: ${{ matrix.version }} + go-version: ${{ matrix.go-version }} cache: true(Substitute the SHA with the latest commit listed in the action’s release notes.)
This also updates the variable name to align with the previous comment.
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
.github/workflows/ci.yml(1 hunks)
🧰 Additional context used
🪛 actionlint (1.7.7)
.github/workflows/ci.yml
36-36: the runner of "actions/setup-go@v4" action is too old to run on GitHub Actions. update the action's version to fix this issue
(action)
Codecov ReportAll modified and coverable lines are covered by tests ✅ 📢 Thoughts on this report? Let us know! |
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.
Actionable comments posted: 1
🧹 Nitpick comments (1)
.github/workflows/ci.yml (1)
27-30: Addfail-fast: falseand adopt a more descriptive axis keyMinor workflow nit:
- Naming the axis
go-versioninstead of the genericversionmakes job logs and matrix outputs easier to scan.- Setting
fail-fast: falseprevents a single failing version from cancelling the rest of the matrix, which is usually what you want when testing multiple Go releases.- strategy: - matrix: - version: [1.21, 1.22, 1.23, 1.24] + strategy: + fail-fast: false # keep all versions running even if one fails + matrix: + go-version: [1.21, 1.22, 1.23, 1.24](Remember to update
${{ matrix.version }}references to${{ matrix.go-version }}below if you take this change.)
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
.github/workflows/ci.yml(1 hunks)
🧰 Additional context used
🪛 actionlint (1.7.7)
.github/workflows/ci.yml
36-36: the runner of "actions/setup-go@v4" action is too old to run on GitHub Actions. update the action's version to fix this issue
(action)
| - name: Set up Go ${{ matrix.version }} | ||
| uses: actions/setup-go@v4 | ||
| with: | ||
| go-version: "^1.24" | ||
| go-version: ${{ matrix.version }} | ||
| cache: 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.
Bump to actions/setup-go@v5 – v4 is pinned to the deprecated Node-16 runtime
GitHub Actions will remove Node-16 runners shortly; setup-go@v4 will stop working.
@v5 is a drop-in replacement that runs on Node-20 and keeps the workflow future-proof.
- - name: Set up Go ${{ matrix.version }}
- uses: actions/setup-go@v4
+ - name: Set up Go ${{ matrix.version }}
+ uses: actions/setup-go@v5Optional: with v5 you can swap cache: true for the more granular
cache: 'gomod' or cache-dependency-path, but the current flag still works.
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| - name: Set up Go ${{ matrix.version }} | |
| uses: actions/setup-go@v4 | |
| with: | |
| go-version: "^1.24" | |
| go-version: ${{ matrix.version }} | |
| cache: true | |
| - name: Set up Go ${{ matrix.version }} | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: ${{ matrix.version }} | |
| cache: true |
🧰 Tools
🪛 actionlint (1.7.7)
36-36: the runner of "actions/setup-go@v4" action is too old to run on GitHub Actions. update the action's version to fix this issue
(action)
🤖 Prompt for AI Agents
In .github/workflows/ci.yml around lines 35 to 39, update the GitHub Action from
actions/setup-go@v4 to actions/setup-go@v5 to avoid using the deprecated Node-16
runtime. Replace the version tag in the uses field accordingly. Optionally,
replace cache: true with cache: 'gomod' or cache-dependency-path for more
granular caching, but the existing cache flag is still valid.
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.
Actionable comments posted: 0
♻️ Duplicate comments (1)
.github/workflows/ci.yml (1)
35-39: Updateactions/setup-gotov5–v4is pinned to the deprecated Node-16 runtimeThis was flagged earlier and actionlint still reports the same warning.
setup-go@v4will stop receiving runner updates shortly; switching tov5is a drop-in change that runs on Node-20 and keeps the workflow future-proof.- - name: Set up Go ${{ matrix.version }} - uses: actions/setup-go@v4 + - name: Set up Go ${{ matrix.version }} + uses: actions/setup-go@v5Optional:
cache: truecan be replaced with the more explicitcache: 'gomod'.
🧹 Nitpick comments (1)
.github/workflows/ci.yml (1)
27-30: Addfail-fast: falseto run the full matrix even if one job failsBy default the matrix strategy stops remaining jobs after the first failure, which can mask additional compatibility issues (e.g., Go 1.24 passes but Go 1.21 silently never runs).
Appendingfail-fast: falsekeeps all versions executing and surfaces the full picture.strategy: + fail-fast: false matrix: version: [1.21, 1.24]
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
.github/workflows/ci.yml(1 hunks)
🧰 Additional context used
🪛 actionlint (1.7.7)
.github/workflows/ci.yml
36-36: the runner of "actions/setup-go@v4" action is too old to run on GitHub Actions. update the action's version to fix this issue
(action)
Description
Brief description of what this PR does.
Type of Change
Changes Made
Testing
Performance Impact
Checklist
Related Issues
Fixes #(issue number)
Additional Notes
Any additional information that reviewers should know.