Paig server background mode #92
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: paig-server-ci | |
on: | |
push: | |
branches: [ "main" ] | |
paths: | |
- 'paig-server/**' | |
pull_request: | |
branches: [ "main" ] | |
paths: | |
- 'paig-server/**' | |
workflow_dispatch: # Allows manual trigger | |
permissions: | |
contents: read | |
jobs: | |
build_and_test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 # Ensure the repo is checked out | |
- name: Set up Python 3.10 | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.10" | |
- name: Prepare venv | |
run: | | |
python3 -m pip install virtualenv | |
virtualenv -p python3 venv | |
. venv/bin/activate | |
pip install twine build pytest pytest-cov | |
- name: Build and Install paig-common wheel | |
run: | | |
. venv/bin/activate | |
cd paig-common | |
python3 -m build -w | |
pip install dist/*.whl | |
cd .. | |
- name: Install PAIG-Server dependencies | |
run: | | |
. venv/bin/activate | |
pip install -r paig-server/backend/requirements.txt | |
- name: Test with pytest | |
run: | | |
filepath=$PWD | |
. venv/bin/activate && cd paig-server/backend/paig | |
python3 -m pytest --cov="." --cov-report term --cov-report xml:$filepath/coverage.xml --junitxml=$filepath/junit.xml tests | |
- name: Upload coverage report | |
uses: actions/upload-artifact@v4 | |
with: | |
name: coverage-report | |
path: coverage.xml | |
- name: Upload test results | |
uses: actions/upload-artifact@v4 | |
with: | |
name: junit-results | |
path: junit.xml | |
- name: Install Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
registry-url: https://registry.npmjs.org/ | |
- name: Install Node.js dependencies and build UI | |
run: | | |
cd paig-server/scripts | |
sh build_ui.sh | |
- name: Build the wheel | |
run: | | |
. venv/bin/activate | |
cd paig-server | |
python3 -m build -w | |
- name: Install created package | |
run: | | |
rm -rf venv | |
virtualenv -p python3 venv && . venv/bin/activate | |
cd paig-server | |
pip install dist/*.whl |