-
Notifications
You must be signed in to change notification settings - Fork 3
57 lines (50 loc) · 1.88 KB
/
qodo-cover-php.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
name: Run the qodo-cover action (PHP)
on:
workflow_dispatch:
inputs:
desired_coverage:
description: "Desired coverage percentage"
required: false
default: "70"
permissions:
pull-requests: write
contents: write
jobs:
run-qodo-cover-php:
runs-on: ubuntu-22.04
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
ref: ${{ github.ref }}
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y php-cli php-xml php-mbstring unzip php-xdebug
php -v
composer -V || (php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" \
&& php composer-setup.php \
&& php -r "unlink('composer-setup.php');" \
&& sudo mv composer.phar /usr/local/bin/composer)
- name: Configure Xdebug for coverage
run: |
echo 'zend_extension="xdebug.so"' | sudo tee -a /etc/php/8.1/cli/conf.d/20-xdebug.ini
echo 'xdebug.mode=coverage' | sudo tee -a /etc/php/8.1/cli/conf.d/20-xdebug.ini
php -m | grep xdebug
- name: Install app dependencies
run: |
composer install
working-directory: templated_tests/php/myapp
- name: Qodo Cover
uses: qodo-ai/qodo-ci/.github/actions/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
project_language: php
project_root: templated_tests/php/myapp
code_coverage_report_path: templated_tests/php/myapp/coverage.xml
test_command: "XDEBUG_MODE=coverage vendor/bin/phpunit --coverage-cobertura coverage.xml --disable-coverage-ignore"
model: gpt-4o
desired_coverage: ${{ github.event.inputs.desired_coverage }}
branch: ${{ github.ref_name }}
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}