Skip to content

Merge pull request #1393 from swirlai/release-3_6_0-develop #60

Merge pull request #1393 from swirlai/release-3_6_0-develop

Merge pull request #1393 from swirlai/release-3_6_0-develop #60

name: Test and Build Pipeline
on:
push:
branches:
- main
- develop
paths-ignore:
- .github/**
- docs/**
- README.md
workflow_dispatch:
jobs:
unit-tests:
runs-on: ubuntu-latest
steps:
- name: Checkout the Code
uses: actions/checkout@v4
- name: Set Up Python
uses: actions/setup-python@v5
with:
python-version: '3.12.4'
cache: 'pip'
- name: Install Swirl
run: ./install.sh
- name: Install the Unit Tests
run: ./install-test.sh
- name: Run the Unit Tests
run: pytest
qa-suite:
needs: unit-tests
runs-on: ubuntu-latest
services:
redis:
image: redis
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 6379:6379
steps:
- name: Checkout the Code
uses: actions/checkout@v4
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Set Up Python
uses: actions/setup-python@v5
with:
python-version: '3.12.4'
cache: 'pip'
- name: Install Swirl
run: ./install.sh
- name: Setup Swirl
run: python swirl.py setup
- name: Install the Galaxy UI Preview
run: ./install-ui.sh -p
env:
MSAL_CB_PORT: 8000
MSAL_HOST: localhost
- name: Start Swirl
run: |
echo "OPENAI_API_KEY='${{ secrets.QA_OPENAI_KEY }}'" >> .env
cat .env
python swirl.py start
env:
ALLOWED_HOSTS: localhost,host.docker.internal
- name: Run the QA Suite
run: |
echo "SWIRL_TEST_HOST=localhost" > .env.qa
echo "MSAL_HOST=localhost" >> .env.qa
echo "MSAL_CB_PORT=8000" >> .env.qa
echo "QA_ADMIN_PW=${{ secrets.QA_ADMIN_PW }}" >> .env.qa
echo "QA_OPENAI_KEY=${{ secrets.QA_OPENAI_KEY }}" >> .env.qa
echo "========"
cat .env.qa
echo "========"
docker run --net=host --env-file .env.qa -t swirlai/swirl-search-qa:automated-tests-develop sh -c "behave --tags=qa_suite,community"
swirl-docker:
needs: qa-suite
runs-on: ubuntu-latest
steps:
- name: Checkout the Code
uses: actions/checkout@v4
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and Push Swirl Docker Image
run: |
BRANCH_NAME=${GITHUB_REF#refs/heads/}
TAG_NAME=$([ "$BRANCH_NAME" = "main" ] && echo "latest" || echo "$BRANCH_NAME")
docker buildx use devBuilder || docker buildx create --name devBuilder --use
docker buildx build -t swirlai/swirl-search:$TAG_NAME --platform linux/amd64,linux/arm64 --push .
- name: Update the Docker Repo Description
uses: peter-evans/dockerhub-description@v4
with:
username: ${{ secrets.DOCKER_USERNAME_X }}
password: ${{ secrets.DOCKER_PASSWORD_X }}
repository: swirlai/swirl-search
- name: Upload Log Files
if: always()
uses: actions/upload-artifact@v4
with:
name: log-files
path: |
logs/
/var/log/syslog*