fix: message generation stability #50
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and Test | |
on: | |
pull_request: | |
branches: ["master"] | |
paths: | |
- "backend/**" | |
- "!**.md" | |
env: | |
AES_ENCRYPTION_KEY: b90e4648ad699c3bdf62c0860e09eb9efc098ee75f215bf750847ae19d41e4b0 | |
JWT_SECRET_KEY: dbefe42f34473990a3fa903a6a3283acdc3a910beb1ae271a6463ffa5a926bfb | |
permissions: | |
contents: read | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
environment: test | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v3 | |
- name: Set short SHA | |
run: echo "IMAGE_TAG=$(echo ${{ github.sha }} | cut -c 1-7)" >> $GITHUB_ENV | |
- name: Check for git tag version | |
id: get_tag | |
run: | | |
TAG=$(git describe --tags --exact-match 2> /dev/null || echo "") | |
if [[ -n "$TAG" ]]; then | |
echo "IMAGE_TAG=${TAG}" >> $GITHUB_ENV | |
fi | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: "3.10" | |
- name: Checkout Test Repository | |
uses: actions/checkout@v2 | |
with: | |
repository: TaskingAI/TaskingAI-Test | |
ref: master | |
path: TaskingAI-Test | |
token: ${{ secrets.TASKINGAI_TEST_GH_PAT }} | |
- name: Install Dependencies | |
working-directory: backend | |
run: pip install -r requirements.txt | |
- name: Create Docker network | |
run: docker network create taskingai-network | |
- name: Run Docker image - Postgres | |
run: | | |
docker run --network taskingai-network -d --rm \ | |
-e POSTGRES_DB=taskingai \ | |
-e POSTGRES_USER=postgres \ | |
-e POSTGRES_PASSWORD=TaskingAI321 \ | |
--name db ankane/pgvector:v0.5.1 | |
- name: Run Docker image - Redis | |
run: | | |
docker run --network taskingai-network -d --rm \ | |
--name cache redis:7-alpine | |
- name: Run Docker image - Inference | |
run: docker run --network taskingai-network -d --rm -e MODE=PROD --name inference taskingai/taskingai-inference:v0.2.0 | |
- name: Run Docker image - Plugin | |
run: docker run --network taskingai-network -d --rm -e MODE=PROD --name plugin taskingai/taskingai-plugin:v0.2.0 | |
- name: Build Docker image | |
working-directory: backend | |
run: | | |
docker build -t taskingai/taskingai-server:$IMAGE_TAG . | |
echo "Build success: taskingai/taskingai-server:${IMAGE_TAG}" | |
- name: Run Docker image - WEB | |
working-directory: backend | |
env: | |
AES_ENCRYPTION_KEY: ${{ env.AES_ENCRYPTION_KEY }} | |
JWT_SECRET_KEY: ${{ env.JWT_SECRET_KEY }} | |
run: | | |
docker run --network taskingai-network --rm -d -p 8080:8000 \ | |
-e PURPOSE=WEB \ | |
-e POSTGRES_URL="postgres://postgres:TaskingAI321@db:5432/taskingai" \ | |
-e REDIS_URL="redis://cache:6379/0" \ | |
-e TASKINGAI_INFERENCE_URL=http://inference:8000 \ | |
-e TASKINGAI_PLUGIN_URL=http://plugin:8000 \ | |
-e AES_ENCRYPTION_KEY=$AES_ENCRYPTION_KEY \ | |
-e JWT_SECRET_KEY=$JWT_SECRET_KEY \ | |
taskingai/taskingai-server:$IMAGE_TAG | |
- name: Run Docker image - API | |
working-directory: backend | |
env: | |
AES_ENCRYPTION_KEY: ${{ env.AES_ENCRYPTION_KEY }} | |
run: | | |
docker run --network taskingai-network --rm -d -p 8090:8000 \ | |
-e PURPOSE=API \ | |
-e POSTGRES_URL="postgres://postgres:TaskingAI321@db:5432/taskingai" \ | |
-e REDIS_URL="redis://cache:6379/0" \ | |
-e TASKINGAI_INFERENCE_URL=http://inference:8000 \ | |
-e TASKINGAI_PLUGIN_URL=http://plugin:8000 \ | |
-e AES_ENCRYPTION_KEY=$AES_ENCRYPTION_KEY \ | |
taskingai/taskingai-server:$IMAGE_TAG | |
- name: Wait for service to start | |
run: sleep 10 | |
- name: Install Dependencies | |
working-directory: TaskingAI-Test | |
run: pip install -r requirements.txt | |
- name: Run WEB Tests | |
working-directory: TaskingAI-Test | |
run: bash ./community_app/run_test.sh | |
- name: Run API Tests | |
working-directory: TaskingAI-Test | |
run: bash ./community_api/run_test.sh |