-
-
Notifications
You must be signed in to change notification settings - Fork 11
Matrix builds #117
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
Matrix builds #117
Conversation
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. Note
|
| Cohort / File(s) | Summary |
|---|---|
Reusable Build Workflow .github/workflows/build.yml |
New reusable workflow with two jobs: get_default_envs extracts PlatformIO environments as outputs; build job uses matrix strategy over environments with caching for pip and PlatformIO, executes pio run for each environment, and uploads artifacts from build/release/*.bin and build/merged/*.bin. |
CI Pipeline Integration .github/workflows/ci-pio.yaml |
Refactored to invoke the new reusable build.yml workflow via uses: directive. Expanded trigger to run on all branch pushes and pull requests. Removed inline step definitions for checkout, caching, Python setup, and PlatformIO build steps. |
Nightly Release Automation .github/workflows/nightly.yml |
New workflow triggered on 2 AM UTC schedule or manual dispatch. Contains two jobs: wled_build reuses the build.yml workflow; nightly job downloads artifacts, generates changelog from tags (excluding certain labels), and publishes a prerelease using andelf/nightly-release with tag "nightly". |
Sequence Diagram(s)
sequenceDiagram
participant GH as GitHub Events
participant CI as ci-pio.yaml
participant Build as build.yml
participant PIO as PlatformIO
participant Artifact as Artifact Storage
participant Nightly as nightly.yml
participant Release as Release Publisher
GH->>CI: Push to any branch / PR
CI->>Build: Trigger reusable workflow
Build->>Build: get_default_envs: Extract environments
Build->>PIO: Matrix build: pio run -e ENV
PIO->>PIO: Build for each environment
PIO->>Artifact: Upload *.bin artifacts
GH->>Nightly: Scheduled (2 AM UTC) / Manual dispatch
Nightly->>Build: Trigger build.yml
Build->>PIO: Build all environments
PIO->>Artifact: Upload artifacts
Nightly->>Artifact: Download build artifacts
Nightly->>Nightly: Generate changelog from tags
Nightly->>Release: Publish nightly release
Estimated code review effort
🎯 3 (Moderate) | ⏱️ ~22 minutes
Poem
🐰 Workflows reused, like carrots in spring,
Matrix builds now doing their thing,
Nightly releases hop and dance,
CI pipelines in perfect stance!
Artifacts bundled, ready to go,
GitHub Actions steal the show! 🚀
🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
| Check name | Status | Explanation |
|---|---|---|
| Description Check | ✅ Passed | Check skipped - CodeRabbit’s high-level summary is enabled. |
| Title check | ✅ Passed | The title 'Matrix builds' directly reflects the main change: introducing matrix-based parallel builds through new GitHub Actions workflow infrastructure. |
| Docstring Coverage | ✅ Passed | No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. |
✏️ Tip: You can configure your own custom pre-merge checks in the settings.
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.
Comment @coderabbitai help to get the list of available commands and usage tips.
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: 3
🤖 Fix all issues with AI agents
In @.github/workflows/build.yml:
- Around line 23-24: The shell string passed to echo contains unescaped inner
double quotes which break the outer quoting; edit the run command that contains
echo "environments=$(pio project config --json-output | jq -c '[.[] |
select(.[0] | startswith("env:")) | .[0] | sub("^env:"; "")]')" >>
$GITHUB_OUTPUT so that the jq expressions use single quotes (e.g.
startswith('env:') and sub('^env:'; '')) or escape the inner quotes, ensuring
the whole echo argument remains a valid double-quoted shell string.
In @.github/workflows/ci-pio.yaml:
- Around line 3-6: The workflow's push trigger uses branches: - '*' which does
not match branch names containing slashes (e.g., feature/foo); update the push
trigger under the on -> push -> branches section to either use the glob '**'
(branches: - '**') or remove the branches filter entirely so all branches
trigger CI, ensuring branch patterns like feature/* are matched; edit the 'on',
'push', and 'branches' entries to apply the chosen change.
In @.github/workflows/nightly.yml:
- Around line 10-11: The workflow currently sets permissions: contents: write
but lacks read access for issues and pull-requests which the
janheinrichmerker/action-github-changelog-generator@v2.3 action requires; update
the permissions block to explicitly include read scopes for issues and
pull-requests (e.g., add permissions keys for issues: read and pull-requests:
read alongside contents: write) so the changelog generator can access required
data.
| run: | | ||
| echo "environments=$(pio project config --json-output | jq -c '[.[] | select(.[0] | startswith("env:")) | .[0] | sub("^env:"; "")]')" >> $GITHUB_OUTPUT |
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.
Fix the quoting in the jq filter to avoid a shell parse error.
The inner double quotes break the outer double-quoted string, so this step will fail before writing the output.
✅ Suggested fix
- echo "environments=$(pio project config --json-output | jq -c '[.[] | select(.[0] | startswith("env:")) | .[0] | sub("^env:"; "")]')" >> $GITHUB_OUTPUT
+ echo "environments=$(pio project config --json-output | jq -c '[.[] | select(.[0] | startswith(\"env:\")) | .[0] | sub(\"^env:\"; \"\")]')" >> "$GITHUB_OUTPUT"📝 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.
| run: | | |
| echo "environments=$(pio project config --json-output | jq -c '[.[] | select(.[0] | startswith("env:")) | .[0] | sub("^env:"; "")]')" >> $GITHUB_OUTPUT | |
| run: | | |
| echo "environments=$(pio project config --json-output | jq -c '[.[] | select(.[0] | startswith(\"env:\")) | .[0] | sub(\"^env:\"; \"\")]')" >> "$GITHUB_OUTPUT" |
🤖 Prompt for AI Agents
In @.github/workflows/build.yml around lines 23 - 24, The shell string passed to
echo contains unescaped inner double quotes which break the outer quoting; edit
the run command that contains echo "environments=$(pio project config
--json-output | jq -c '[.[] | select(.[0] | startswith("env:")) | .[0] |
sub("^env:"; "")]')" >> $GITHUB_OUTPUT so that the jq expressions use single
quotes (e.g. startswith('env:') and sub('^env:'; '')) or escape the inner
quotes, ensuring the whole echo argument remains a valid double-quoted shell
string.
| on: | ||
| push: | ||
| branches: | ||
| - '*' |
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.
🧩 Analysis chain
🏁 Script executed:
cat .github/workflows/ci-pio.yamlRepository: MoonModules/MoonLight
Length of output: 196
🌐 Web query:
GitHub Actions branch filter pattern matching asterisk vs double asterisk documentation
💡 Result:
In GitHub Actions branches, branches-ignore, tags, and tags-ignore filters use glob patterns. (docs.github.com)
* vs ** (branch/tag filters)
*matches 0+ characters except/. So it will not cross a path segment boundary. Example pattern:feature/*matchesfeature/my-branchbut notfeature/mona/the/octocat. (docs.github.com)**matches 0+ characters including/, so it can span multiple/-separated segments. Example pattern:feature/**matchesfeature/mona/the/octocat. (docs.github.com)
Common gotchas
'*'matches all branch/tag names that don’t contain/, while'**'matches all branch/tag names. (docs.github.com)- If your pattern starts with
*(or!or[), you must quote it in YAML (e.g.,'*','**','!releases/**-alpha'). (docs.github.com)
Citations:
- 1: https://docs.github.com/en/actions/how-tos/writing-workflows/choosing-when-your-workflow-runs/triggering-a-workflow?utm_source=openai
- 2: https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions
- 3: https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions
- 4: https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions
- 5: https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions
'*' doesn't match branches with slashes; consider ** or drop the filter.
This can skip CI on branches like feature/foo.
✅ Suggested fix
push:
branches:
- - '*'
+ - '**'📝 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.
| on: | |
| push: | |
| branches: | |
| - '*' | |
| on: | |
| push: | |
| branches: | |
| - '**' |
🤖 Prompt for AI Agents
In @.github/workflows/ci-pio.yaml around lines 3 - 6, The workflow's push
trigger uses branches: - '*' which does not match branch names containing
slashes (e.g., feature/foo); update the push trigger under the on -> push ->
branches section to either use the glob '**' (branches: - '**') or remove the
branches filter entirely so all branches trigger CI, ensuring branch patterns
like feature/* are matched; edit the 'on', 'push', and 'branches' entries to
apply the chosen change.
| permissions: | ||
| contents: write |
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.
🧩 Analysis chain
🏁 Script executed:
cat -n .github/workflows/nightly.ymlRepository: MoonModules/MoonLight
Length of output: 1725
🌐 Web query:
janheinrichmerker/action-github-changelog-generator permissions required
💡 Result:
For janheinrichmerker/action-github-changelog-generator, the token only needs read access (it reads tags/commits + issues + PRs to build the changelog; it doesn’t write back). (github.com)
Minimal recommended GITHUB_TOKEN permissions:
permissions:
contents: read # tags/commits
issues: read # closed issues
pull-requests: read # merged PRsYou can set permissions at the workflow or job level; anything omitted becomes none. (github.blog)
Citations:
- 1: https://github.com/marketplace/actions/generate-changelog?utm_source=openai
- 2: https://github.blog/changelog/2021-04-20-github-actions-control-permissions-for-github_token/?utm_source=openai
Add read permissions for issues and pull-requests to unblock changelog generation.
The workflow uses janheinrichmerker/action-github-changelog-generator@v2.3, which requires read access to issues and pull requests to build the changelog. Without explicit permissions, these scopes default to none.
✅ Suggested fix
permissions:
contents: write
+ issues: read
+ pull-requests: read📝 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.
| permissions: | |
| contents: write | |
| permissions: | |
| contents: write | |
| issues: read | |
| pull-requests: read |
🤖 Prompt for AI Agents
In @.github/workflows/nightly.yml around lines 10 - 11, The workflow currently
sets permissions: contents: write but lacks read access for issues and
pull-requests which the janheinrichmerker/action-github-changelog-generator@v2.3
action requires; update the permissions block to explicitly include read scopes
for issues and pull-requests (e.g., add permissions keys for issues: read and
pull-requests: read alongside contents: write) so the changelog generator can
access required data.
Summary by CodeRabbit
Release Notes
✏️ Tip: You can customize this high-level summary in your review settings.