Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 47 additions & 0 deletions .github/workflows/qodo-cover-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Run the qodo-cover-pr action

on:
pull_request:
branches:
- main
types:
- opened # Trigger only when a pull request is opened

permissions:
pull-requests: write # Allows commenting on pull requests
contents: write # Allows reading and writing files

jobs:
run-qodo-cover:
if: ${{ github.actor != 'github-actions[bot]' }}
runs-on: ubuntu-22.04
steps:
- name: Checkout PR branch
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.ref }}

- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y python3 python3-dev python3-pip
python3 --version

- name: Install app dependencies
run: |
python -m pip install --upgrade pip
pip install -r templated_tests/python_fastapi/requirements.txt

- name: Qodo Cover
uses: qodo-ai/qodo-ci/.github/actions/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
project_language: python
project_root: templated_tests/python_fastapi
code_coverage_report_path: templated_tests/python_fastapi/coverage.xml
test_command: "pytest --cov=. --cov-report=xml --cov-report=term"
model: gpt-4o
desired_coverage: 70
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
27 changes: 17 additions & 10 deletions .github/workflows/qodo-cover.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,30 @@
name: Run the qodo-cover action

on:
pull_request:
branches:
- main
types:
- opened # Trigger only when a pull request is opened
workflow_dispatch:
inputs:
branch:
description: "Branch to run on"
required: false
default: "main"
desired_coverage:
description: "Desired coverage percentage"
required: false
default: "70"

permissions:
pull-requests: write # Allows commenting on pull requests
contents: write # Allows reading and writing files
pull-requests: write
contents: write

jobs:
run-qodo-cover:
runs-on: ubuntu-22.04
steps:
- name: Checkout PR branch
- name: Checkout specified branch
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.ref }}
ref: ${{ github.event.inputs.branch }}

- name: Install system dependencies
run: |
Expand All @@ -33,13 +38,15 @@ jobs:
pip install -r templated_tests/python_fastapi/requirements.txt

- name: Qodo Cover
uses: qodo-ai/qodo-ci/.github/actions/qodo-cover-pr@v0.1.2
uses: qodo-ai/qodo-ci/.github/actions/[email protected].3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
project_language: python
project_root: templated_tests/python_fastapi
code_coverage_report_path: templated_tests/python_fastapi/coverage.xml
test_command: "pytest --cov=. --cov-report=xml --cov-report=term"
model: gpt-4o
desired_coverage: ${{ github.event.inputs.desired_coverage }}
branch: ${{ github.event.inputs.branch }}
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}