Skip to content

QA Suite

QA Suite #54

Workflow file for this run

name: QA Suite
on:
workflow_run:
workflows: [Unit Tests]
types:
- completed
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
build:
if: (github.event_name == 'workflow_dispatch') || (github.event_name == 'workflow_run' && github.event.workflow_run.conclusion == 'success')
runs-on: ubuntu-latest
steps:
- name: Download Branch and run_id Artifacts
uses: dawidd6/action-download-artifact@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
workflow: unit-tests.yml
name: branch-info-${{ github.event_name == 'workflow_run' && github.event.workflow_run.id || github.run_id }}
path: ./artifacts
continue-on-error: true # Allow the step to fail without stopping the workflow
- name: Determine Branch for Checkout
id: determine_branch
run: |
if [[ -f ./artifacts/branch.txt && -f ./artifacts/run_id.txt ]]; then
echo "branch=$(cat ./artifacts/branch.txt)" >> $GITHUB_ENV
echo "original_run_id=$(cat ./artifacts/run_id.txt)" >> $GITHUB_ENV
else
BRANCH_NAME=$(echo $GITHUB_REF | cut -d "/" -f 3)
echo "branch=$BRANCH_NAME" >> $GITHUB_ENV
fi
- name: Print Branch to be Checked Out
run: |
echo "Branch to checkout: ${{ env.branch }}"
- name: Checkout the Code
uses: actions/checkout@v4
with:
ref: ${{ env.branch }}
- name: Set Up Python
uses: actions/setup-python@v5
with:
python-version: '3.12.2'
cache: 'pip' # caching pip stuff
- name: Install Chromium
uses: browser-actions/setup-chrome@v1
- name: Chromium Binary Details
run: |
which chromedriver
which chromium
- name: Install Swirl
run: ./install.sh
- name: Update apt
run: sudo apt -o Acquire::Retries=3 update
- name: Upgrade Ubuntu to Latest Patches
run: sudo apt upgrade -y
- name: Install redis-server
run: sudo apt install -y redis-server
- name: Set Up Swirl
run: python swirl.py setup
- name: Start Swirl
run: python swirl.py start
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Run the QA Suite
run: docker run --net=host -t swirlai/swirl-search-qa:automated-tests sh -c "behave --tags=qa_suite,community"
- name: Ensure Artifacts Directory Exists and Write Branch and run_id Again
run: |
mkdir -p ./artifacts
echo "${{ env.branch }}" > ./artifacts/branch.txt
echo "${{ env.original_run_id }}" > ./artifacts/run_id.txt
- name: Re-upload Branch and run_id for Subsequent Workflows
uses: actions/upload-artifact@v4
with:
name: branch-info-${{ github.run_id }}
path: |
./artifacts/branch.txt
./artifacts/run_id.txt
- name: Upload Log Files
if: always()
uses: actions/upload-artifact@v4
with:
name: log-files
path: |
logs/
/var/log/syslog*