Skip to content

Conversation

@jserv
Copy link
Contributor

@jserv jserv commented Oct 25, 2025

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

    • Added composite action to install rv32emu deps (Linux/macOS) with caching and PATH setup.
    • Enabled caching for APT, RISC-V toolchain, and build artifacts.
    • Set minimal workflow permissions and added concurrency to cancel redundant runs.
    • Applied step/job timeouts and recursive submodule checkout.
  • Refactors

    • Introduced Bash strict mode, color logging, ASSERT, and a cleanup registry in CI scripts.
    • Simplified format checking using clang-format -n --Werror, black --check, and shfmt on tracked files.
    • Fixed shell scripts to use POSIX-friendly syntax and safer checks (case, command -v).
    • Minor reliability fixes in boot tests, gdb detection, and toolchain installer.

Copy link

@cubic-dev-ai cubic-dev-ai bot left a 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.

@jserv jserv force-pushed the improve-cicd branch 11 times, most recently from 6d90a37 to b384f30 Compare October 27, 2025 13:26
@sysprog21 sysprog21 deleted a comment from cubic-dev-ai bot Oct 27, 2025
@sysprog21 sysprog21 deleted a comment from cubic-dev-ai bot Oct 27, 2025
@jserv jserv force-pushed the improve-cicd branch 3 times, most recently from 85de8b0 to 829f2e9 Compare October 27, 2025 13:57
@sysprog21 sysprog21 deleted a comment from cubic-dev-ai bot Oct 27, 2025
@sysprog21 sysprog21 deleted a comment from cubic-dev-ai bot Oct 27, 2025
Copy link

@cubic-dev-ai cubic-dev-ai bot left a 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 ==)
jserv added 2 commits October 27, 2025 23:17
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.
@jserv jserv merged commit 994257a into master Oct 27, 2025
27 of 31 checks passed
@jserv jserv deleted the improve-cicd branch October 27, 2025 17:33
@jserv jserv added this to the release-2025.2 milestone Oct 27, 2025
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.

2 participants