Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Build Test CI workflow; #17

Merged
merged 5 commits into from
Jan 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 55 additions & 0 deletions .github/workflows/build-test-ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: nlqs build and test ci

on:
push:
branches: [ "build-test-ci" ]
pull_request:
branches: [ "main" ]
types: [ closed ]
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
env:
DB_CONFIG: ${{ secrets.DB_CONFIG }}
LLM_CONFIG_OPENAI_GPT4: ${{ secrets.LLM_CONFIG_OPENAI_GPT4 }}

- name: Run Docker container
run: |
docker rm -f nlqs-tests || true
docker run -it -v $(pwd)/configs/:/code/configs -e WANDB_API_KEY=${{ secrets.WANDB_API_KEY }} --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 openai_gpt4 all"
status=$?
if [ $status -ne 0 ]; then
echo "test failed with status $status"
exit $status
fi

- name: Cleanup
run: docker rm -f nlqs-tests
Loading