AI-Powered CI/CD with GitHub Actions
Build a CI/CD pipeline with automated testing and AI code review.
Introduction
30 Second Summary
Imagine submitting an assignment and getting instant feedback on every mistake before your teacher even looks at it. Professional development teams have exactly this for their code.
In this project, you will build an automated pipeline that runs tests on your Python code and delivers AI-powered review feedback every time you push changes. You'll end up with a public GitHub repository showcasing the exact DevOps workflow that employers look for.
What You'll Build
A public GitHub repository containing a Python application, automated tests powered by pytest, a GitHub Actions CI/CD workflow, and CodeRabbit AI code review that activates on every pull request.
By the end of this project, you'll have:
- A working CI/CD pipeline that automatically runs tests on every push and pull request.
- An AI-powered code reviewer (CodeRabbit) installed on your repository that gives feedback on every pull request.
- A public GitHub repository showcasing a professional DevOps workflow you can point to on a resume.
- Secret Mission: Add a linting step to your pipeline and fix the issues CodeRabbit finds in your code.
Do I need anything installed before starting?
This project assumes you already have a GitHub account, VS Code, Python, and Git installed on your machine. Step 1 will confirm everything is working before you start building.
Set Up Your Project Repository
Every professional DevOps workflow starts with a well-organized repository. Your repository is the home base for your application code, tests, and pipeline configuration.
In this step, you'll create a public GitHub repository, clone it to your local machine, and set up the file structure for your Python project.
In this step, get ready to:
- Create and clone a public GitHub repository.
- Set up the project file structure in VS Code.
- Install pytest for automated testing.
Create and clone your GitHub repository
A Git repository stores your project's code and its entire change history. Creating it on GitHub gives you a remote backup and enables collaboration features like pull requests.
- Open your browser and go to github.com.
- Click the + icon in the top-right corner of the page.
- Click New repository.
- Enter ai-devops-pipeline in the Repository name field.
- Select Public so anyone can see your repository.
- Check the Add a README file checkbox.
- Click Create repository.
Why a public repository?
GitHub Actions is free and unlimited for public repositories. A public repo also serves as a portfolio piece that employers can view directly.
- On your new repository page, click the green Code button.
- Make sure HTTPS is selected in the dropdown.
- Click the copy icon next to the URL to copy it to your clipboard.
Now you'll clone this repository to your local machine so you can work on it in VS Code.
- In VS Code, open the integrated terminal by pressing Ctrl+` (the backtick key, above Tab on your keyboard).
Windows users: select Git Bash
If your terminal shows PowerShell or Command Prompt, click the dropdown arrow next to the + icon in the terminal panel and select Git Bash. All commands in this project work in Git Bash across both macOS and Windows.
- Move to your Desktop by running this command:
cd ~/Desktop
- Clone your repository by running this command (paste the URL you copied from GitHub):
git clone [[REPO_URL="https://github.com/your-username/ai-devops-pipeline.git"]]
What does this command do?
The git clone command downloads a full copy of your remote repository to your computer. It creates a new folder called ai-devops-pipeline on your Desktop containing the README file you initialized on GitHub.
- Confirm the folder was created by running:
ls
You should see ai-devops-pipeline listed in the output.
Don't see the folder?
- Make sure you ran cd ~/Desktop before cloning. If you skipped that step, the folder may be in your home directory instead.
- Double-check that you pasted the correct HTTPS URL from GitHub. It should end with .git.
- If you see a "repository not found" error, confirm your repository is set to Public on GitHub.
Why can't I clone my repository?
Open your repository and create the project files
Now that the repository is on your machine, you'll open it in VS Code and create the file structure for your Python application and tests.
- In VS Code, click File in the top menu bar.
- Click Open Folder.
- Navigate to your Desktop, select the ai-devops-pipeline folder, and click Open.
VS Code reloads with the project folder as your workspace. You may see a prompt asking if you trust the authors of this folder. Click Yes, I trust the authors.
- Open the terminal again by pressing Ctrl+`.
- Create your project files by running these commands:
macOS
# Create the calculator module
touch calculator.py
# Create the tests directory and test file
mkdir tests
touch tests/test_calculator.py
Windows
# Create the calculator module
New-Item -ItemType File -Path calculator.py
# Create the tests directory and test file
mkdir tests
New-Item -ItemType File -Path tests\test_calculator.py
What are these files for?
- calculator.py is where you'll write your Python application code in the next step.
- tests/test_calculator.py is where you'll write automated tests that verify your application works correctly.
Keeping tests in a separate tests/ directory is a standard Python project convention that keeps your code organized.
- Confirm the files were created by running:
ls
You should see calculator.py, README.md, and tests listed in the output.
Missing files in the output?
- Make sure your terminal is inside the ai-devops-pipeline folder. Run pwd to check your current directory.
- If you see an error about touch not being recognized, make sure you selected Git Bash as your terminal shell (see the tip above).
Help me find my project files
Install pytest for automated testing
pytest is a testing framework that makes it easy to write and run automated tests for Python code. Your CI/CD pipeline will use pytest to verify your code works every time you push changes.
- Verify Python is accessible in your terminal by running:
python --version
You should see a version number like Python 3.13.x (any Python 3 version works).
Seeing command not found?
On some systems, the command is python3 instead of python. Try python3 --version if the first command fails. Use whichever one works for the rest of this project.
- Install pytest by running:
pip install pytest
What does this command do?
pip is Python's package installer. This command downloads and installs the pytest library so you can write and run tests locally before your pipeline runs them in the cloud.
- Confirm pytest is available by running:
pytest --version
You should see output showing the pytest version number, confirming it installed correctly.
pip command not found?
- Try pip3 install pytest instead. Some systems use pip3 for Python 3 packages.
- If you see a permissions error, try pip install --user pytest to install it for your user account only.
Help me install pytest
Your project repository is ready to go. Next up, you'll write the Python application and tests that your CI/CD pipeline will automate.
Write Your Application and Tests
Your project repository is cloned and open in VS Code with the file structure ready to go. Now it's time to fill those empty files with actual code.
Every CI/CD pipeline needs something to test. You'll write a small calculator module and a matching test suite using pytest. Once the tests pass locally, you'll know the code is ready for automation.
In this step, get ready to:
- Write calculator functions with error handling.
- Write test functions that verify each calculator operation.
- Run tests locally to confirm everything passes.
Write your calculator module
Your calculator module will contain four arithmetic functions. Each function takes two numbers and returns a result.
- In VS Code, open calculator.py and add the basic math functions by pasting the following code:
def add(a, b):
"""Add two numbers and return the result."""
return a + b
def subtract(a, b):
"""Subtract b from a and return the result."""
return a - b
def multiply(a, b):
"""Multiply two numbers and return the result."""
return a * b
What does this code do?
Each function takes two parameters (a and b) and returns the result of a single arithmetic operation.
The triple-quoted strings (docstrings) describe what each function does. Python uses these for built-in documentation.
Division needs special treatment. Dividing by zero is mathematically undefined, so your function should raise an error instead of crashing.
- Below the multiply function, add the divide function with error handling:
def divide(a, b):
"""Divide a by b and return the result.
Raises:
ValueError: If b is zero.
"""
if b == 0:
raise ValueError("Cannot divide by zero")
return a / b
What does this code do?
The if b == 0 check catches division by zero before it happens. Instead of letting Python crash with a generic error, the function raises a ValueError with a clear message.
This is defensive programming. Your tests will verify this error handling works correctly.
- Save calculator.py.
Seeing red underlines in VS Code?
If VS Code shows linting warnings, make sure your indentation uses 4 spaces (not tabs) and there are two blank lines between each function.
help me fix Python indentation errors in VS Code
✔️ Awesome, I've got everything!
Great. Double check you've saved your file before moving on.
ⓧ I'd like to double check the full code
def add(a, b):
"""Add two numbers and return the result."""
return a + b
def subtract(a, b):
"""Subtract b from a and return the result."""
return a - b
def multiply(a, b):
"""Multiply two numbers and return the result."""
return a * b
def divide(a, b):
"""Divide a by b and return the result.
Raises:
ValueError: If b is zero.
"""
if b == 0:
raise ValueError("Cannot divide by zero")
return a / b
Write your test functions
Tests prove your code works the way you expect. Each test function calls a calculator function with known inputs and checks the output matches.
- Open tests/test_calculator.py in VS Code and add the imports and basic operation tests by pasting this code:
import pytest
from calculator import add, subtract, multiply, divide
def test_add():
assert add(2, 3) == 5
assert add(-1, 1) == 0
assert add(0, 0) == 0
def test_subtract():
assert subtract(5, 3) == 2
assert subtract(1, 1) == 0
assert subtract(0, 5) == -5
def test_multiply():
assert multiply(3, 4) == 12
assert multiply(-2, 3) == -6
assert multiply(0, 100) == 0
What does this code do?
The import lines bring in pytest and your calculator functions so the test file can use them.
Each test_ function uses assert statements to check that a function returns the expected value. If any assertion fails, pytest reports it as a test failure. Each test covers normal values, negative numbers, and zero to catch edge cases.
Now add the division tests. These are more interesting because you need to test both normal division and the error case.
- Below the test_multiply function, add the division tests:
def test_divide():
assert divide(10, 2) == 5.0
assert divide(7, 2) == 3.5
assert divide(-6, 3) == -2.0
def test_divide_by_zero():
with pytest.raises(ValueError, match="Cannot divide by zero"):
divide(10, 0)
What does this code do?
The test_divide function checks that division returns correct float results.
The test_divide_by_zero function uses pytest.raises to verify that dividing by zero raises a ValueError with the exact message you wrote in calculator.py. This confirms your error handling works as intended.
- Save tests/test_calculator.py.
Seeing import errors in the editor?
If VS Code underlines the from calculator import line, that's okay for now. The import resolves when you run pytest from the project root directory in the next substep.
help me understand why VS Code shows import errors for my calculator module
✔️ Awesome, I've got everything!
Great. Double check you've saved your file before moving on.
ⓧ I'd like to double check the full code
import pytest
from calculator import add, subtract, multiply, divide
def test_add():
assert add(2, 3) == 5
assert add(-1, 1) == 0
assert add(0, 0) == 0
def test_subtract():
assert subtract(5, 3) == 2
assert subtract(1, 1) == 0
assert subtract(0, 5) == -5
def test_multiply():
assert multiply(3, 4) == 12
assert multiply(-2, 3) == -6
assert multiply(0, 100) == 0
def test_divide():
assert divide(10, 2) == 5.0
assert divide(7, 2) == 3.5
assert divide(-6, 3) == -2.0
def test_divide_by_zero():
with pytest.raises(ValueError, match="Cannot divide by zero"):
divide(10, 0)
Run your tests locally
Before pushing code to GitHub, you should always verify tests pass on your own machine. This catches typos and logic errors before they reach the pipeline.
- Run your test suite by entering this command in the VS Code terminal:
pytest
- You should see output ending with a green line that says 5 passed. Each dot in the output represents one passing test.
What should I see?
Pytest collects all functions that start with test_ and runs them one by one. A dot (.) means a test passed. The final line shows the total count in green.
Tests failing or command not found?
- If you see ModuleNotFoundError: make sure you're running pytest from the root of your ai-devops-pipeline folder, not from inside the tests/ directory.
- If you see a SyntaxError: check your code for missing colons, mismatched quotes, or incorrect indentation.
- If pytest is not recognized: reinstall it with pip install pytest.
help me debug why my pytest tests are failing
All five tests are green. Your code works and you have proof. Next up, you'll create a CI/CD pipeline that runs these same tests automatically every time you push to GitHub.
Create Your CI/CD Pipeline
Your tests pass locally, which is great. But relying on every developer to remember to run tests before pushing code is a recipe for bugs slipping through.
A CI/CD pipeline automates this. Every time you push code or open a pull request, GitHub Actions runs your tests automatically in the cloud. In this step, you will create the workflow file that makes this happen.
In this step, get ready to:
- Create the GitHub Actions workflow directory and file.
- Configure the pipeline to automatically run tests on push and pull request.
- Push to GitHub and verify the pipeline runs successfully.
Create the workflow directory and file
GitHub Actions looks for workflow files inside a special .github/workflows/ directory at the root of your repository. You need to create this directory and add a YAML file inside it.
- Switch back to the VS Code terminal you used in the previous step.
- Create the workflow directory by running this command:
macOS
mkdir -p .github/workflows
Windows
New-Item -ItemType Directory -Path ".github\workflows" -Force
- Create the workflow file inside that directory by running:
macOS
touch .github/workflows/ci.yml
Windows
New-Item -ItemType File -Path ".github\workflows\ci.yml"
- Confirm the directory and file were created by running:
ls .github/workflows
You should see ci.yml in the output.
Why this specific directory?
GitHub automatically scans the .github/workflows/ directory for .yml files. Any workflow file placed here is picked up and run by GitHub Actions without any other configuration.
Don't see the file?
Make sure you ran both commands. The directory must exist before you can create a file inside it. If you see a "No such file or directory" error, run the mkdir command first, then retry the file creation command.
Help me troubleshoot
Configure your CI pipeline
The ci.yml file defines exactly what happens when your pipeline runs. You will tell GitHub Actions when to trigger, what environment to use, and which commands to execute.
- Open ci.yml in VS Code by clicking on it in the Explorer sidebar (left panel).
- Paste the following workflow configuration into the file:
name: CI Pipeline
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
permissions:
contents: read
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Set up Python 3.13
uses: actions/setup-python@v5
with:
python-version: "3.13"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pytest
- name: Run tests
run: |
pytest
What does this workflow do?
- name: CI Pipeline gives this workflow a readable name that appears in the GitHub Actions tab.
- on: push / pull_request tells GitHub to run the pipeline every time code is pushed to main or a pull request targets main.
- runs-on: ubuntu-latest spins up a fresh Linux virtual machine in the cloud to run your tests.
- actions/checkout@v6 pulls your repository code into that virtual machine.
- actions/setup-python@v5 installs Python 3.13 so your code can run.
- The final two steps install pytest and run your test suite.
- Save .github/workflows/ci.yml.
Seeing red squiggly lines in the YAML?
YAML is sensitive to indentation. Make sure you are using spaces (not tabs) and that nested keys are indented exactly two spaces from their parent. VS Code may highlight issues if the indentation is off.
Help me fix my YAML
✔️ Awesome, I've got everything!
Great. Double check you have saved the file before moving on.
ⓧ I'd like to double check the full code
name: CI Pipeline
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
permissions:
contents: read
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Set up Python 3.13
uses: actions/setup-python@v5
with:
python-version: "3.13"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pytest
- name: Run tests
run: |
pytest
Push and verify your pipeline
Your workflow file is ready. Now you need to commit everything and push to GitHub so the pipeline can run for the first time.
- Stage, commit, and push all your files by running these commands in the VS Code terminal:
git add .
git commit -m "Add CI pipeline with GitHub Actions"
git push origin main
What do these commands do?
- git add . stages all new and changed files (your calculator, tests, and workflow file).
- git commit saves a snapshot of those changes with a descriptive message.
- git push origin main uploads the commit to your GitHub repository, which triggers the workflow.
- Open your repository on GitHub in your browser.
- Click the Actions tab under your repository name.
- Click the workflow run labeled Add CI pipeline with GitHub Actions (this matches your commit message).
- Wait for the run to finish. You should see a green checkmark indicating all tests passed.
What should I see?
The Actions tab shows a list of workflow runs. Your run should display CI Pipeline as the workflow name and a green checkmark next to it. Clicking into the run shows each step (checkout, setup Python, install dependencies, run tests) with green check icons.
Seeing a red X instead of a green checkmark?
Click on the failed run to see the logs. Common causes:
- Indentation errors in ci.yml prevent the workflow from parsing. Compare your file character-for-character with the code above.
- A test failure means one of your pytest tests is not passing. Run pytest locally to reproduce the issue, fix it, commit, and push again.
- If the Actions tab does not appear at all, confirm your repository is public. GitHub Actions is free and unlimited on public repositories.
Help me debug my failed workflow
Your pipeline is live. Every push to main and every pull request now triggers automated testing in the cloud. Next up, you will add an AI-powered code reviewer that gives you feedback on every pull request.
Add AI-Powered Code Review with CodeRabbit
Your pipeline is running and catching test failures automatically. That solves the "did I break anything?" problem, but there's another challenge on real teams: code quality.
Professional teams use code review to catch bugs, improve readability, and share knowledge. In this step, you'll install CodeRabbit, an AI-powered code reviewer that automatically reads your pull requests and gives feedback like a senior developer would.
In this step, get ready to:
- Sign up for CodeRabbit using your GitHub account.
- Install CodeRabbit on your repository.
- Verify the integration in your GitHub settings.
Sign up for CodeRabbit
CodeRabbit is a free AI code review tool that installs as a GitHub App. Once installed, it automatically reviews every pull request you open. No API keys or YAML configuration needed.
- Open your browser and navigate to coderabbit.ai.
- Click the sign up or login button on the page.
- Select Login with GitHub as your sign-in method.
- When prompted, click Authorize coderabbitai to grant CodeRabbit access to your GitHub account.
Do I need to pay for CodeRabbit?
No. CodeRabbit's free plan includes unlimited reviews on public repositories. No credit card is required to sign up.
Install CodeRabbit on your repository
After signing in, CodeRabbit needs to be installed on the specific repository you want it to review. You'll scope it to just your project repo rather than giving it access to everything.
- On the CodeRabbit dashboard, follow the prompts to add a repository.
- When asked about repository access, select Only select repositories.
- Choose your ai-devops-pipeline repository from the list.
- Click Install & Authorize to complete the setup.
What permissions does CodeRabbit get?
CodeRabbit requests read-only access to your code, metadata, and actions. It also requests read-and-write access to pull requests, issues, and commit statuses so it can post review comments directly on your PRs.
Verify the integration on GitHub
You can confirm CodeRabbit installed successfully by checking your repository's settings on GitHub.
- Switch back to your ai-devops-pipeline repository page on GitHub.
- Click the Settings tab in the top navigation bar of your repository.
- In the left sidebar, click Integrations to expand the section.
- Click GitHub Apps.
- Confirm that CodeRabbit appears in the list of installed apps.
Don't see CodeRabbit listed?
Make sure you selected your personal account (not an organization) during the install step. If you authorized CodeRabbit on a different account, visit coderabbit.ai again and re-run the installation, choosing the correct account and repository.
Also confirm your repository is public. CodeRabbit's free plan works on public repositories.
Help me troubleshoot my CodeRabbit installation on GitHub.
CodeRabbit is now watching your repository. In the next step, you'll trigger the full pipeline by creating a new branch, writing code with an intentional quality issue, and opening a pull request to see both GitHub Actions and CodeRabbit in action.
Trigger Your Full Pipeline
Your CI/CD pipeline is built and CodeRabbit is watching your repository. Now it's time to see both systems work together in real time.
In professional teams, developers never push code directly to the main branch. Instead, they create a feature branch, make changes, and open a pull request. This triggers the full DevOps feedback loop: automated tests run, AI reviews the code, and the team can see everything before merging.
In this step, get ready to:
- Create a feature branch and add new code to your project.
- Push the branch and open a pull request on GitHub.
- Watch GitHub Actions and CodeRabbit activate on your pull request.
Create a feature branch and add the power function
Feature branches let you propose changes without affecting the main branch. Your CI pipeline is configured to run on pull requests targeting main, so creating a branch and opening a PR is exactly what triggers it.
- Switch back to the VS Code terminal and create a new branch by running this command:
git checkout -b feature/add-power-function
What does this command do?
The -b flag creates a new branch and switches to it in one step. Your new branch feature/add-power-function is based on the current state of main.
- In VS Code, open calculator.py and add the following power function at the very bottom of the file, after the divide function:
def power(a, b):
"""Raise a to the power of b and return the result."""
return a ** b
What does this code do?
The power function uses Python's ** operator to raise a to the power of b. Unlike the divide function, it doesn't include input validation. CodeRabbit may pick up on this difference and suggest adding error handling.
- Save calculator.py.
✔️ Awesome, I've got everything!
Great. Double check you've saved your file before moving on.
ⓧ I'd like to double check the full code
def add(a, b):
"""Add two numbers and return the result."""
return a + b
def subtract(a, b):
"""Subtract b from a and return the result."""
return a - b
def multiply(a, b):
"""Multiply two numbers and return the result."""
return a * b
def divide(a, b):
"""Divide a by b and return the result.
Raises:
ValueError: If b is zero.
"""
if b == 0:
raise ValueError("Cannot divide by zero")
return a / b
def power(a, b):
"""Raise a to the power of b and return the result."""
return a ** b
Now you need a test for the new function.
- Open tests/test_calculator.py and find the import line at the top:
from calculator import add, subtract, multiply, divide
- Add power to the end of the import list so the line looks like this:
from calculator import add, subtract, multiply, divide, power
- Scroll to the bottom of the file and add this test function after test_divide_by_zero:
def test_power():
assert power(2, 3) == 8
assert power(5, 0) == 1
assert power(3, 2) == 9
What does this test do?
The three assertions cover the core behavior: a basic exponent (2 cubed is 8), raising to the power of zero (anything to the power of 0 is 1), and another standard case (3 squared is 9).
- Save tests/test_calculator.py.
✔️ Awesome, I've got everything!
Great. Double check you've saved your file before moving on.
ⓧ I'd like to double check the full code
import pytest
from calculator import add, subtract, multiply, divide, power
def test_add():
assert add(2, 3) == 5
assert add(-1, 1) == 0
assert add(0, 0) == 0
def test_subtract():
assert subtract(5, 3) == 2
assert subtract(1, 1) == 0
assert subtract(0, 5) == -5
def test_multiply():
assert multiply(3, 4) == 12
assert multiply(-2, 3) == -6
assert multiply(0, 100) == 0
def test_divide():
assert divide(10, 2) == 5.0
assert divide(7, 2) == 3.5
assert divide(-6, 3) == -2.0
def test_divide_by_zero():
with pytest.raises(ValueError, match="Cannot divide by zero"):
divide(10, 0)
def test_power():
assert power(2, 3) == 8
assert power(5, 0) == 1
assert power(3, 2) == 9
- Confirm everything works locally by running this command:
pytest
- You should see output ending with 6 passed in green. This confirms your new function and test are working correctly.
Seeing a test failure?
- Check that your import line includes power at the end. A missing import causes an ImportError.
- Make sure the power function in calculator.py uses ** (double asterisk), not * (single asterisk).
- Confirm you saved both files before running pytest.
Why are my pytest tests failing?
Push your branch and open a pull request
Your code works locally. Now push it to GitHub so your pipeline can run against it in the cloud.
- Stage and commit your changes by running these commands:
git add .
git commit -m "Add power function and test"
- Push the branch to GitHub by running this command:
git push origin feature/add-power-function
What does this push do?
This creates the feature/add-power-function branch on GitHub's servers. Because your workflow triggers on pull_request events targeting main, pushing alone doesn't trigger the pipeline. You need to open a pull request next.
- Open your ai-devops-pipeline repository on GitHub in your browser.
- You should see a yellow banner near the top of the page saying your branch had recent pushes. Click Compare & pull request.
- Confirm the base branch is set to main and the compare branch is feature/add-power-function.
- Enter a title like Add power function and optionally add a description.
- Click Create Pull Request.
What is a pull request?
A pull request is a proposal to merge code from one branch into another. It gives your team (and your automated tools) a chance to review the changes before they become part of the main codebase.
Opening this PR is what triggers both GitHub Actions (your CI pipeline) and CodeRabbit (your AI reviewer) simultaneously.
Don't see the yellow banner?
- If the banner has disappeared, click the Pull requests tab at the top of your repository page.
- Click New pull request.
- Set the base to main and compare to feature/add-power-function, then click Create Pull Request.
How do I create a pull request on GitHub if the banner isn't showing?
Watch your pipeline in action
This is where everything comes together. Two automated systems are now responding to your pull request at the same time.
- On your pull request page, click the Checks tab.
- Watch your CI Pipeline workflow run. It checks out your code, installs Python and pytest, then runs your tests on an Ubuntu server in the cloud.
- Wait for the green checkmark to appear. This means all 6 tests passed on the remote server, confirming your code works outside your local machine.
What is happening in the Checks tab?
GitHub Actions spun up a fresh ubuntu-latest virtual machine, installed Python 3.13, installed pytest, and ran your test suite. This entire process is defined by your ci.yml file. Every time anyone pushes to this PR, the same process runs automatically.
- Switch back to the Conversation tab on your pull request.
- Look for a review comment posted by CodeRabbit. It typically includes a summary of changes, a walkthrough of your code, and inline suggestions for improvements.
- Read through CodeRabbit's feedback. It may suggest adding input validation to your power function, adding type hints, or other code quality improvements.
What does CodeRabbit's review look like?
CodeRabbit posts a structured review with a summary section describing what changed, a walkthrough section explaining the logic, and inline comments on specific lines where it has suggestions. This is the same kind of feedback a senior developer would leave on your code.
You don't need to act on every suggestion right now. The goal is to see the full feedback loop in action: push code, tests run automatically, AI reviews your code.
CodeRabbit may take a minute
CodeRabbit's review usually appears within 1-2 minutes of opening the PR. If you don't see it immediately, refresh the page after a short wait.
CI check is failing?
- Click the failing check to see the build log. Look for the error message in the test output.
- If you see an ImportError, your test_calculator.py import line is missing power. Fix it locally, commit, and push again.
- If you see a SyntaxError, check for missing colons or indentation issues in your function definitions.
Why is my GitHub Actions CI check failing on my pull request?
Secret mission
Add Linting and Fix AI Feedback
Your pipeline runs tests, but professional workflows also enforce code style. In this secret mission, you will add ruff (a lightning-fast Python linter) to your CI pipeline and respond to CodeRabbit's AI feedback to prove you can iterate on a real DevOps workflow.
Clean Up Your Resources
Clean Up Your Resources
This project runs entirely on GitHub's free tier for public repositories and CodeRabbit's free OSS plan. There are no ongoing costs to worry about.
Decide whether to keep your resources running, pause them to come back later, or delete them entirely.
Resources you used:
- GitHub repository ai-devops-pipeline (cloud).
- CodeRabbit GitHub App installed on your repository (integration).
- Local project folder ai-devops-pipeline on your Desktop (local files).
- pytest Python package installed via pip.
Keep everything running
No action needed. Choose this if you are still actively building on this repository or plan to add more features soon.
- Your GitHub repository stays public and your CI/CD pipeline continues to run on every push.
- CodeRabbit continues reviewing pull requests for free on public repositories.
- Your local files remain on your Desktop for easy access.
Pause - I'll come back to this later
There are no running processes to stop since GitHub Actions only runs when you push code. Choose this if you want to step away without deleting anything.
- Your repository, pipeline, and CodeRabbit integration all remain intact.
- No costs accumulate while the project is idle.
- When you come back, push a commit or open a pull request to trigger the pipeline again.
Delete - I don't want to use this again
Remove all project resources and start fresh. Follow each step below to fully clean up.
- Uninstall CodeRabbit from your GitHub account:
- Delete the GitHub repository:
- Delete the local project folder:
- Uninstall pytest:
Nice Work!
Nice Work!
Nice work! You just built a professional CI/CD pipeline that automatically tests your code and provides AI-powered feedback on every change you make.
You've learned how to:
- Built a Python application with automated tests using pytest, and run them locally to catch bugs before pushing.
- Created a CI/CD pipeline with GitHub Actions that runs your tests automatically on every push and pull request.
- Integrated CodeRabbit for AI-powered code review that posts inline suggestions directly on your pull requests.
- Secret Mission: Added linting with ruff to your pipeline and responded to AI code review feedback, proving you can iterate on a professional DevOps workflow.
Ready to quiz yourself?