Skip to content

feat(generate function): structure output and include reasoning #53

feat(generate function): structure output and include reasoning

feat(generate function): structure output and include reasoning #53

Workflow file for this run

name: nlqs build and test ci
on:
push:
branches: [ "build-test-ci" ]
pull_request:
branches: [ "main" ]
types: [ labeled ]
schedule:
- cron: '45 22 * * *'
workflow_dispatch:
jobs:
build-and-test:
runs-on: [ self-hosted, dind ]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile.tests
push: false
load: true
tags: nlqs/tests:0.1
- name: Create db config
run: |
mkdir configs
echo "$DB_CONFIG" > configs/db_config.json
echo "$LLM_CONFIG_OPENAI_GPT4" > configs/openai_gpt4_config.json
echo "$LLM_CONFIG_AZURE_GPT35" > configs/azure_llm_config.json
echo "$LLM_CONFIG_OPENAI_GPT35" > configs/openai_gpt3.5-turbo_config.json
echo "$LLM_CONFIG_GCP_TEXT_BISON" > configs/gcp_text-bison_config.json
echo "$GCP_CREDS_CONFIG" > configs/GCP_CREDS.json
echo "$LLM_TEST_EVALUATOR" > configs/test_evaluation_model_config.json
env:
DB_CONFIG: ${{ secrets.DB_CONFIG }}
LLM_CONFIG_OPENAI_GPT4: ${{ secrets.LLM_CONFIG_OPENAI_GPT4 }}
LLM_CONFIG_AZURE_GPT35: ${{ secrets.LLM_CONFIG_AZURE_GPT35 }}
LLM_CONFIG_GCP_TEXT_BISON: ${{ secrets.LLM_CONFIG_GCP_TEXT_BISON }}
LLM_CONFIG_OPENAI_GPT35: ${{ secrets.LLM_CONFIG_OPENAI_GPT35 }}
GCP_CREDS_CONFIG: ${{ secrets.GCP_CREDS_CONFIG }}
LLM_TEST_EVALUATOR: ${{ secrets.LLM_TEST_EVALUATOR }}
- name: Run Docker Container for PR
if: ${{ github.event_name }} == 'pull_request'
run: |
docker rm -f nlqs-tests || true
docker run -it -v $(pwd)/configs/:/code/configs -e GOOGLE_APPLICATION_CREDENTIALS=/code/configs/GCP_CREDS.json -e WANDB_API_KEY=${{ secrets.WANDB_API_KEY }} -e PR_NUMBER=${{ github.event.number }} --name nlqs-tests -d nlqs/tests:0.1
- name: Run Docker Container for Regress
if: ${{ (github.event_name == 'schedule') || (github.event_name == 'workflow_dispatch')}}
run: |
docker rm -f nlqs-tests || true
docker run -it -v $(pwd)/configs/:/code/configs -e GOOGLE_APPLICATION_CREDENTIALS=/code/configs/GCP_CREDS.json -e WANDB_API_KEY=${{ secrets.WANDB_API_KEY }} -e PR_NUMBER="DailyRegression" --name nlqs-tests -d nlqs/tests:0.1
- name: Execute PR Tests
if: ${{ github.event_name }} == 'pull_request'
run: |
docker exec nlqs-tests bash -c "conda run --no-capture-output -n py39 ./run_tests.sh ${{ github.event.label.name }} all"
status=$?
if [ $status -ne 0 ]; then
echo "test failed with status $status"
exit $status
fi
url=$(docker exec nlqs-tests bash -c "cat /code/tests/report_url.txt")
echo "REPORT_URL=${url}" >> $GITHUB_ENV
- name: Execute Regress Tests
if: ${{ (github.event_name == 'schedule') || (github.event_name == 'workflow_dispatch')}}
run: |
docker exec nlqs-tests bash -c "conda run --no-capture-output -n py39 ./run_tests.sh all all"
status=$?
if [ $status -ne 0 ]; then
echo "test failed with status $status"
exit $status
fi
url=$(docker exec nlqs-tests bash -c "cat /code/tests/report_url.txt")
echo "REPORT_URL=${url}" >> $GITHUB_ENV
- name: Add PR Comment
if: ${{ github.event_name }} == 'pull_request'
uses: mshick/[email protected]
with:
message: |
Test Report: ${{ env.REPORT_URL }}
- name: Cleanup
run: |
docker rm -f nlqs-tests
echo ${{ env.REPORT_URL }}