-
Notifications
You must be signed in to change notification settings - Fork 121
Improve CI/CD #626
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
Improve CI/CD #626
Conversation
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.
3 issues found across 7 files
Prompt for AI agents (all 3 issues)
Understand the root cause of the following 3 issues and fix them.
<file name=".github/actions/setup-rv32emu/action.yml">
<violation number="1" location=".github/actions/setup-rv32emu/action.yml:12">
apt-get install needs a non-interactive flag; without -y this step will block waiting for confirmation on GitHub runners, breaking the workflow.</violation>
<violation number="2" location=".github/actions/setup-rv32emu/action.yml:22">
The APT cache restore runs after apt-get install, so the restored packages never benefit the install step; move this caching step before the install to make it effective.</violation>
</file>
<file name=".ci/check-format.sh">
<violation number="1" location=".ci/check-format.sh:25">
`shfmt -d` exits 0 even when it would reformat files, so storing `$?` here keeps SH_FORMAT_EXIT at 0 and the CI will never fail on misformatted shell scripts. Please derive a non-zero value from `shfmt -l` or similar so the exit code reflects formatting problems.</violation>
</file>
React with 👍 or 👎 to teach cubic. Mention @cubic-dev-ai to give feedback, ask questions, or re-run the review.
6d90a37 to
b384f30
Compare
85de8b0 to
829f2e9
Compare
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.
2 issues found across 6 files
Prompt for AI agents (all 2 issues)
Understand the root cause of the following 2 issues and fix them.
<file name=".ci/common.sh">
<violation number="1" location=".ci/common.sh:2">
Setting strict mode here will leak `-euo pipefail` into any shell that sources this helper (for example the workflow steps that do `. .ci/common.sh`), so later commands may now exit unexpectedly on previously tolerated non-zero statuses. Please avoid toggling shell options in a sourced library and move this to the scripts that execute directly, or guard it so it only runs when the file is executed.</violation>
</file>
<file name=".ci/check-format.sh">
<violation number="1" location=".ci/check-format.sh:10">
`mapfile` is only available in Bash 4+, but macOS (and any host that still uses Bash 3.2) will invoke this script with a shell that lacks that builtin. On those machines the format check now fails immediately with “mapfile: command not found”. Please avoid `mapfile` or ensure the script runs under a modern Bash.</violation>
</file>
React with 👍 or 👎 to teach cubic. Mention @cubic-dev-ai to give feedback, ask questions, or re-run the review.
This adds bash strict mode, color output helpers, ASSERT function, and cleanup mechanism to improve CI script reliability and debugging. - Add color output functions (print_success, print_error, print_warning) - Add ASSERT function for test validation - Add cleanup function registry with trap handler - Fix POSIX compliance (use = instead of ==)
This replaces temporary file generation with clang-format's built-in dry-run mode. - Use clang-format -n --Werror instead of diff with temp files - Use git ls-files to filter tracked files only - Use mapfile for bash 4+ compatibility - Capture exit codes properly for each checker
This replaces bash-specific syntax with POSIX-compliant alternatives for better portability across different shell environments.
Summary by cubic
Overhauled CI/CD to be faster, more reliable, and secure. Adds a reusable setup action, caching across dependencies and builds, strict Bash scripts, and workflow concurrency with timeouts.
New Features
Refactors