forked from GoogleCloudPlatform/genai-for-developers
-
Notifications
You must be signed in to change notification settings - Fork 0
58 lines (52 loc) · 2.48 KB
/
devai-review.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
58
# AI enabled code reviews using devai
# - Requires GCP service account stored in GOOGLE_API_CREDENTIALS secret
name: GenAI For Developers
run-name: Reviewing ${{ github.actor }}'s code changes 🚀
on: [push, workflow_dispatch]
env:
LOCATION: us-central1
PROJECT_ID: '${{ secrets.PROJECT_ID }}'
jobs:
DevAI-Reviews:
runs-on: ubuntu-latest
steps:
- name: Check out repository code
uses: actions/checkout@v4
- name: List files in the repository
run: |
ls ${{ github.workspace }}
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11.7'
- run: cd ${{ github.workspace }}/devai-cli
- run: pip install virtualenv
- run: virtualenv venv
- run: source venv/bin/activate
- run: pip install -r ${{ github.workspace }}/devai-cli/src/requirements.txt
- run: pip install --editable ${{ github.workspace }}/devai-cli/src
- name: Authorize. with GCP
uses: 'google-github-actions/auth@v2'
with:
credentials_json: '${{ secrets.GOOGLE_API_CREDENTIALS }}'
project_id: '${{ secrets.PROJECT_ID }}'
- name: Test Coverage Review
run: echo '## Test Coverage Review Results 🚀' >> $GITHUB_STEP_SUMMARY
- run: echo "$(devai review testcoverage -c ${{ github.workspace }}/sample-app/src)" >> $GITHUB_STEP_SUMMARY
shell: bash
- name: Code Review
run: echo '## Code Review Results 🚀' >> $GITHUB_STEP_SUMMARY
- run: echo "$(devai review code -c ${{ github.workspace }}/sample-app/src/main/java/anthos/samples/bankofanthos/balancereader)" >> $GITHUB_STEP_SUMMARY
shell: bash
- name: Performance Review
run: echo '## Performance Review Results 🚀' >> $GITHUB_STEP_SUMMARY
- run: echo "$(devai review performance -c ${{ github.workspace }}/sample-app/src/main/java/anthos/samples/bankofanthos/balancereader)" >> $GITHUB_STEP_SUMMARY
shell: bash
- name: Security Review
run: echo '## Security Review Results 🚀' >> $GITHUB_STEP_SUMMARY
- run: echo "$(devai review security -c ${{ github.workspace }}/sample-app/src/main/java/anthos/samples/bankofanthos/balancereader)" >> $GITHUB_STEP_SUMMARY
shell: bash
- name: Blockers Review
run: echo '## Blockers Review Results 🚀' >> $GITHUB_STEP_SUMMARY
- run: echo "$(devai review blockers -c ${{ github.workspace }}/sample-app/pom.xml)" >> $GITHUB_STEP_SUMMARY
shell: bash