-
Notifications
You must be signed in to change notification settings - Fork 16
72 lines (61 loc) · 2.2 KB
/
build-test-ci.yaml
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
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_ENV
- 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_ENV
})`
- name: Cleanup
run: docker rm -f nlqs-tests