Testing WIP #28
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
# Workflow for running WIP Behave tests on the GitHub runners | |
# Manual trigger only against the branch you've chosen | |
# Enter the Behave tag name(s) you're testing with at the prompt | |
# Do NOT include the '@', only the tag name(s) (e.g. "estest" not "@estest") | |
name: Testing WIP | |
on: | |
workflow_dispatch: | |
inputs: | |
behave_tags: # Input the Behave tag(s) to run | |
description: 'Behave tag(s) to run' | |
required: true | |
default: 'estest' # Default tag if none specified | |
jobs: | |
wip-tests: | |
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: Create env File for Tests | |
run: | | |
echo "SWIRL_TEST_HOST=localhost" > .env | |
echo "MSAL_HOST=localhost" >> .env | |
echo "MSAL_CB_PORT=8000" > .env | |
echo "MSAL_APP_ID=${{ secrets.QA_MSAL_APP_ID }}" >> .env | |
echo "MSAL_TENANT_ID=${{ secrets.QA_MSAL_TENANT_ID }}" >> .env | |
echo "OPENAI_API_KEY=${{ secrets.QA_OPENAI_KEY }}" >> .env | |
echo "QA_ADMIN_PW=${{ secrets.QA_ADMIN_PW }}" >> .env | |
- name: Build and Start Application | |
run: docker-compose -f docker-compose-build.yml up --build -d | |
- name: Wait for Application to be Ready | |
run: | | |
echo "Waiting for the application to become ready..." | |
max_attempts=10 | |
count=0 | |
until curl --output /dev/null --silent --head --fail http://localhost:8000/galaxy/login; do | |
count=$(($count+1)) | |
if [ $count -ge $max_attempts ]; then | |
echo "Application did not become ready in time." | |
exit 1 | |
fi | |
printf '.' | |
sleep 30 | |
done | |
echo "Application is ready." | |
- name: Run the QA Suite | |
run: docker run --net=host --env-file .env -t swirlai/swirl-search-qa:automated-tests-develop sh -c "behave --tags=${{ github.event.inputs.behave_tags }}" | |
- name: Cleanup Application Environment | |
run: docker-compose -f docker-compose-build.yml down | |
- name: Upload Log Files | |
if: always() | |
uses: actions/upload-artifact@v4 | |
with: | |
name: log-files | |
path: | | |
logs/ | |
/var/log/syslog* |