Skip to content

Add badges to README (tests, Java, LeetCode) – Issue #7#19

Open
HoudaBelhad wants to merge 4 commits intoyamcodes:mainfrom
HoudaBelhad:main
Open

Add badges to README (tests, Java, LeetCode) – Issue #7#19
HoudaBelhad wants to merge 4 commits intoyamcodes:mainfrom
HoudaBelhad:main

Conversation

@HoudaBelhad
Copy link
Contributor

@HoudaBelhad HoudaBelhad commented Feb 9, 2026

This pull request adds the following badges to the README:

  • Test badge to show build/test status
  • Java version badge
  • LeetCode solutions badge

The badges are displayed at the top of the README for better visibility.

This addresses issue #7.

Summary by CodeRabbit

  • Documentation

    • Added project status badges to the README for CI, Java version, and LeetCode visibility.
  • Chores

    • Configured automated continuous integration to run builds and tests on pushes and pull requests, with Java build tooling and caching enabled.

@coderabbitai
Copy link

coderabbitai bot commented Feb 9, 2026

Warning

Rate limit exceeded

@HoudaBelhad has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 18 minutes and 28 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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.

Walkthrough

Adds a GitHub Actions CI workflow that runs on push and PRs to main using JDK 21 and Maven tests, and inserts three status/reference badges (Tests, Java, LeetCode) at the top of the README.

Changes

Cohort / File(s) Summary
CI/CD Setup
​.github/workflows/ci.yml
Adds a GitHub Actions workflow triggered on push and pull_request to main: checks out code, sets up Temurin JDK 21, enables Maven caching, and runs mvn -B test.
Documentation
README.md
Prepends three badges (CI/Tests, Java, LeetCode) to the README header.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Poem

🐰 A tiny hop, a steady build,
Badges gleam atop the hill,
JDK set, tests run true,
Pipelines hum — we’re good to chew! 🥕✨

🚥 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 clearly and concisely summarizes the main change: adding three badges (tests, Java, LeetCode) to the README. It is specific, accurate, and directly reflects the primary objective documented in the PR.
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.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a 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

🤖 Fix all issues with AI agents
In `@README.md`:
- Line 3: Replace the hardcoded static badge image string
("![Tests](https://img.shields.io/badge/tests-passing-brightgreen)") with a
dynamic GitHub Actions workflow status badge: use the actions badge URL pattern
for your repo and workflow file
(https://github.com/<owner>/<repo>/actions/workflows/<workflow_file>.yml/badge.svg)
and update the markdown to link the badge to the workflow run page
(https://github.com/<owner>/<repo>/actions/workflows/<workflow_file>.yml) and
adjust alt text (e.g., "Tests") so the README shows real CI status instead of
always "passing".
🧹 Nitpick comments (1)
.github/workflows/ci.yml (1)

1-24: CI workflow structure looks good overall.

Standard setup with proper checkout, JDK setup, Maven caching, and batch-mode test execution. A couple of observations:

  1. Java version mismatch with project guidelines: The project's build guidelines specify Java 25 (LTS), but this workflow uses JDK 21. If the project has moved to Java 25, update accordingly:

    -        java-version: '21'
    +        java-version: '25'
  2. Consider pinning action versions to full SHAs for supply-chain security (optional for a personal repo).

Based on learnings: "Build project with Java 25 (LTS) version."

README.md Outdated
@@ -1,5 +1,9 @@
# LeetCode Solutions

![Tests](https://img.shields.io/badge/tests-passing-brightgreen)
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Tests badge is static and will always show "passing" regardless of actual CI status.

Since this PR also adds a GitHub Actions CI workflow, use the dynamic workflow status badge instead of a hardcoded static one. The current badge is misleading — it will still show "passing" even when the build is broken.

Proposed fix: use a dynamic GitHub Actions status badge
-![Tests](https://img.shields.io/badge/tests-passing-brightgreen)
+[![Tests](https://github.com/yamcodes/leetcode-solutions-java/actions/workflows/ci.yml/badge.svg)](https://github.com/yamcodes/leetcode-solutions-java/actions/workflows/ci.yml)
📝 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.

Suggested change
![Tests](https://img.shields.io/badge/tests-passing-brightgreen)
[![Tests](https://github.com/yamcodes/leetcode-solutions-java/actions/workflows/ci.yml/badge.svg)](https://github.com/yamcodes/leetcode-solutions-java/actions/workflows/ci.yml)
🤖 Prompt for AI Agents
In `@README.md` at line 3, Replace the hardcoded static badge image string
("![Tests](https://img.shields.io/badge/tests-passing-brightgreen)") with a
dynamic GitHub Actions workflow status badge: use the actions badge URL pattern
for your repo and workflow file
(https://github.com/<owner>/<repo>/actions/workflows/<workflow_file>.yml/badge.svg)
and update the markdown to link the badge to the workflow run page
(https://github.com/<owner>/<repo>/actions/workflows/<workflow_file>.yml) and
adjust alt text (e.g., "Tests") so the README shows real CI status instead of
always "passing".

Copy link
Owner

@yamcodes yamcodes left a comment

Choose a reason for hiding this comment

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

Thanks @HoudaBelhad, Looks generally very good! Couple small notes, and please resolve conflicts so we can get this PR ready to merge!

[![All Contributors](https://img.shields.io/badge/all_contributors-1-orange.svg)](#contributors)
![CI](https://github.com/yamcodes/leetcode-solutions-java/actions/workflows/ci.yml/badge.svg)
![Java](https://img.shields.io/badge/java-21-blue)
![LeetCode](https://img.shields.io/badge/LeetCode-Solutions-orange)
Copy link
Owner

Choose a reason for hiding this comment

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

(Nit) I would use the official LeetCode shields.io logo, either:

Suggested change
![LeetCode](https://img.shields.io/badge/LeetCode-Solutions-orange)
![LeetCode](https://img.shields.io/badge/LeetCode-282828?logo=LeetCode)

or

Suggested change
![LeetCode](https://img.shields.io/badge/LeetCode-Solutions-orange)
![LeetCode Solutions](https://img.shields.io/badge/LeetCode-solutions-31C452?logo=LeetCode&labelColor=282828)

Copy link
Owner

@yamcodes yamcodes Feb 10, 2026

Choose a reason for hiding this comment

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

This file already exists on main, but according to the PR it's being "added".
This usually happens when branching off an outdated branch,

Could you please rebase or merge the latest main into your branch and resolve the conflict? That should remove this file from the diff.


[![All Contributors](https://img.shields.io/badge/all_contributors-1-orange.svg)](#contributors)
![CI](https://github.com/yamcodes/leetcode-solutions-java/actions/workflows/ci.yml/badge.svg)
![Java](https://img.shields.io/badge/java-21-blue)
Copy link
Owner

Choose a reason for hiding this comment

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

Suggested change
![Java](https://img.shields.io/badge/java-21-blue)
![Java](https://img.shields.io/badge/java-25-blue)

We have already updated to Java 25 (latest LTS)

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