Skip to content

PyProject.toml file update (removing qualibrate and python version <3… #46

PyProject.toml file update (removing qualibrate and python version <3…

PyProject.toml file update (removing qualibrate and python version <3… #46

name: Playwright Tests
on:
push:
branches:
- main
- integration
pull_request:
branches:
- main
- integration
jobs:
test:
runs-on: ubuntu-latest
steps:
# Step 1: Checkout the repository
- name: Checkout Repository
uses: actions/checkout@v4
# Step 2: Set up Node.js
- name: Use Node.js
id: node-setup
uses: actions/setup-node@v4
with:
node-version: "20.x"
# Step 3: Cache frontend dependencies
- uses: actions/cache@v4
id: frontend-cache-id
with:
path: frontend/node_modules
key: npm-${{ hashFiles('frontend/**/package-lock.json') }}
restore-keys: npm-
# Step 4: Install frontend dependencies
- name: Install npm dependencies
if: steps.frontend-cache-id.outputs.cache-hit != 'true'
working-directory: frontend
run: npm ci
# Step 5: Build the frontend
- name: Build frontend
working-directory: frontend
run: npm run build
# Step 6: Set up Python environment
- uses: actions/setup-python@v5
with:
python-version: "3.10"
# Step 7: Copy built frontend to backend
- name: Copy built FE to BE
run: cp -r frontend/dist backend/qualibrate_static
# Step 8: Install backend dependencies
- name: Install qualibrate-app
run: pip install .
working-directory: backend
- name: Install qualibrate-core, qualibrate-runner, and qualibrate-composite
run: pip install git+https://github.com/qua-platform/qualibrate-runner.git \
git+https://github.com/qua-platform/qualibrate-core.git \
git+https://github.com/qua-platform/qualibrate.git
# Step 9: Checkout calibration scripts repository
- name: Checkout Calibration Scripts
uses: actions/checkout@v4
with:
repository: 'qua-platform/qualibrate-examples'
path: 'qualibrate-examples'
token: ${{ secrets.QUALIBRATION_EXAMPLES_TOKEN }}
# Step 10: Install Playwright test dependencies
- name: Install Playwright Test Dependencies
run: pip install quam xarray
# Step 11: Create directory for user storage
- name: Create directory for user storage
run: mkdir -p data
# Step 12: Create Qualibrate configuration
- name: Create Qualibrate Configuration
run: |
qualibrate config --auto-accept \
--runner-calibration-library-folder $GITHUB_WORKSPACE/qualibrate-examples/calibrations \
--app-user-storage $GITHUB_WORKSPACE/data
# Step 13: Install Node.js and Playwright dependencies
- name: Install Playwright Dependencies
working-directory: ./frontend/tests
run: |
npm install
npx playwright install-deps chromium
npx playwright install chromium
# Step 14: Start Qualibrate Server
- name: Start Qualibrate Server
run: |
nohup qualibrate start > qualibrate-server.log 2>&1 &
for i in {1..15}; do
if curl -s http://localhost:8001/ > /dev/null; then
echo "Server is up and running"
break
fi
echo "Waiting for server to start..."
sleep 2
done
curl -v http://localhost:8001/
# Step 15: Run Playwright tests
- name: Run Playwright Tests
working-directory: ./frontend/tests/e2e
run: npx playwright test