Skip to content

tests(gh action): make more llms compatible, test labelling #13

tests(gh action): make more llms compatible, test labelling

tests(gh action): make more llms compatible, test labelling #13

Workflow file for this run

name: nlqs build and test ci
on:
push:
branches: [ "build-test-ci" ]
pull_request:
branches: [ "main" ]
types: [ labeled ]
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
env:
DB_CONFIG: ${{ secrets.DB_CONFIG }}
- name: Run Docker container
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: Execute tests
run: |
docker exec nlqs-tests bash -c "conda run --no-capture-output -n py39 ./run_tests.sh ${{ github.event.label.name }} Synthea"
status=$?
if [ $status -ne 0 ]; then
echo "test failed with status $status"
exit $status
fi
docker exec nlqs-tests bash -c "cat /code/tests/report_url.txt" >> $GITHUB_OUTPUT
- name: Comment on PR
uses: actions/github-script@v6
with:
github-token: ${{ github.token }}
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: process.env.GITHUB_OUTPUT
})`
- name: Cleanup
run: docker rm -f nlqs-tests