Skip to content

Commit

Permalink
CI: separate secret workflow (#113)
Browse files Browse the repository at this point in the history
separate secret workflow, fixes #104

Signed-off-by: Jack Luar <[email protected]>
  • Loading branch information
luarss authored Dec 18, 2024
1 parent aefe7d4 commit 423d70e
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 23 deletions.
55 changes: 55 additions & 0 deletions .github/workflows/ci-secret.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: ORAssistant Secret CI
run-name: ${{ github.actor }} started CI

on:
push:
branches:
- master
paths:
- 'backend/**'
- 'frontend/**'
- 'evaluation/**'
- 'Makefile'
- 'docker-compose.yml'

jobs:
build-backend-docker:
runs-on: self-hosted
steps:
- name: Setup python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Checkout code
uses: actions/checkout@v4
- name: Setup prereqs
run: make init-dev
- name: Run formatting checks
run: |
make check
- name: Populate environment variables
run: |
cp backend/.env.example backend/.env
sed -i 's|{{GOOGLE_API_KEY}}|${{ secrets.GOOGLE_API_KEY }}|g' backend/.env
sed -i 's|{{PATH_TO_GOOGLE_APPLICATION_CREDENTIALS}}|src/secret.json|g' backend/.env
cp backend/.env evaluation/.env
cp backend/.env frontend/.env
cp ${{ secrets.PATH_TO_GOOGLE_APPLICATION_CREDENTIALS }} backend/src
cp ${{ secrets.PATH_TO_GOOGLE_APPLICATION_CREDENTIALS }} evaluation/auto_evaluation/src
- name: Build Docker image
run: |
make docker-up
sleep 900 # TODO: Remove this after docker-compose healthcheck timeout restored fixed.
- name: Run LLM CI
working-directory: evaluation
run: |
make llm-tests
- name: Create commit comment
uses: peter-evans/commit-comment@v3
with:
token: ${{ secrets.GH_PAT }}
body-path: evaluation/auto_evaluation/llm_tests_output.txt
- name: Teardown
if: always()
run: |
make docker-down
23 changes: 0 additions & 23 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,6 @@ name: ORAssistant CI
run-name: ${{ github.actor }} started CI

on:
push:
branches:
- master
paths:
- 'backend/**'
- 'frontend/**'
- 'evaluation/**'
- 'Makefile'
- 'docker-compose.yml'
pull_request:
paths:
- 'backend/**'
Expand All @@ -34,15 +25,6 @@ jobs:
- name: Run formatting checks
run: |
make check
- name: Populate environment variables
run: |
cp backend/.env.example backend/.env
sed -i 's|{{GOOGLE_API_KEY}}|${{ secrets.GOOGLE_API_KEY }}|g' backend/.env
sed -i 's|{{PATH_TO_GOOGLE_APPLICATION_CREDENTIALS}}|src/secret.json|g' backend/.env
cp backend/.env evaluation/.env
cp backend/.env frontend/.env
cp ${{ secrets.PATH_TO_GOOGLE_APPLICATION_CREDENTIALS }} backend/src
cp ${{ secrets.PATH_TO_GOOGLE_APPLICATION_CREDENTIALS }} evaluation/auto_evaluation/src
- name: Build Docker image
run: |
make docker-up
Expand All @@ -51,11 +33,6 @@ jobs:
working-directory: evaluation
run: |
make llm-tests
- name: Create commit comment
uses: peter-evans/commit-comment@v3
with:
token: ${{ secrets.GH_PAT }}
body-path: evaluation/auto_evaluation/llm_tests_output.txt
- name: Teardown
if: always()
run: |
Expand Down

0 comments on commit 423d70e

Please sign in to comment.