Skip to content
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

feat/ci: add build CI workflow #5

Merged
merged 1 commit into from
Feb 28, 2025
Merged

feat/ci: add build CI workflow #5

merged 1 commit into from
Feb 28, 2025

Conversation

Baconing
Copy link
Member

@Baconing Baconing commented Feb 27, 2025

Summary by CodeRabbit

  • Chores
    • Introduced an automated build process that triggers on code updates to streamline compilation and testing, ensuring enhanced quality and consistency in the project.

Signed-off-by: Brenden Freier <iam@baconi.ng>
@Baconing Baconing added Kind/Feature New functionality Kind/Testing Issue or pull request related to testing labels Feb 27, 2025
@Baconing Baconing requested a review from Trip-kun February 27, 2025 14:49
@Baconing Baconing self-assigned this Feb 27, 2025
Copy link

coderabbitai bot commented Feb 27, 2025

Walkthrough

This pull request adds a new GitHub Actions workflow that automates the build process. The workflow is triggered on pushes and pull requests to the master branch. It runs on an Ubuntu 22.04 environment using a specific Docker container, performs a checkout of the repository, configures Git safety settings, sets execute permissions for the build script, and finally runs the build command to compile and test the code.

Changes

File(s) Summary
.github/workflows/build.yml New GitHub Actions workflow added. Defines a build job triggered on pushes/P.R. to master using Ubuntu 22.04 and the wpilib/roborio-cross-ubuntu:2025-22.04 container, including steps to checkout code, configure Git, set execute permissions, and execute ./gradlew build.

Sequence Diagram(s)

sequenceDiagram
    participant Developer as Developer
    participant GH as GitHub Actions
    participant Container as Docker Container
    Developer->>GH: Push/P.R. to master
    GH->>GH: Trigger build workflow
    GH->>GH: Checkout repository (actions/checkout)
    GH->>GH: Configure Git safe directories
    GH->>GH: Set execute permissions for gradlew
    GH->>Container: Run build command (./gradlew build)
    Container-->>GH: Return build/test results
    GH->>Developer: Deliver build results
Loading

Poem

I’m a rabbit, full of cheer,
Watching builds hop in gear.
GitHub Actions join the play,
With Docker and gradlew leading the way.
Hopping through code with carrot delight,
Celebrating each build day!
🥕🐇


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 091cb5f and f696b75.

📒 Files selected for processing (1)
  • .github/workflows/build.yml (1 hunks)
🔇 Additional comments (6)
.github/workflows/build.yml (6)

1-6: Verify Branch Trigger Configuration.
The workflow is configured to trigger on pushes and pull requests to the master branch. Please confirm that the repository’s default branch is indeed master (and not main or another name) to ensure the workflow is triggered as expected.


7-11: CI Job and Container Configuration.
The build job is set to run on ubuntu-22.04 within the Docker container wpilib/roborio-cross-ubuntu:2025-22.04. Ensure that this container image has all the necessary dependencies for the build and test processes.


12-12: Checkout Step.
Using actions/checkout@v4 is a standard and reliable way to retrieve the repository contents.


13-14: Git Safe Directory Configuration.
Adding the repository to git's safe directories with git config --global --add safe.directory $GITHUB_WORKSPACE is a good precaution when working within containers.


15-16: Set Execute Permission for Build Script.
Granting execute permission for the gradlew script using chmod +x gradlew is both necessary and correctly implemented.


17-18: Build and Test Step.
Running ./gradlew build to compile the project and run tests is straightforward. Verify that this command covers all essential build and test tasks for the robot code.


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@Baconing Baconing added this to the Kettering 2 milestone Feb 27, 2025
@Trip-kun
Copy link
Collaborator

@coderabbitai review

Copy link

coderabbitai bot commented Feb 27, 2025

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copy link
Collaborator

@Trip-kun Trip-kun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm. yml still sucks as a format though.

@Trip-kun Trip-kun self-requested a review February 27, 2025 17:30
@Trip-kun
Copy link
Collaborator

Make the build not fail though. Not sure what exactly its issue is. Maybe its expecting something that's being .gitignore'd ?

@Baconing
Copy link
Member Author

there was a breaking change in a new wpilib version (see f411d8a), which was updated by dependabot and never got fixed (proof we need build checks lol)

@Baconing Baconing merged commit 1edf568 into master Feb 28, 2025
1 check failed
@Baconing
Copy link
Member Author

(it was also a problem with 8206cc2 lol)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Kind/Feature New functionality Kind/Testing Issue or pull request related to testing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants