Skip to content

[README] Add PolyScope version requirements (#19) #26

[README] Add PolyScope version requirements (#19)

[README] Add PolyScope version requirements (#19) #26

name: Build and Test
on:
workflow_dispatch:
pull_request:
push:
branches:
- master
jobs:
backend-test:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.13'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r external-control-backend/requirements.txt
pip install pytest
- name: Run backend tests
working-directory: external-control-backend/tests
run: pytest
build-frontend-and-test:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '18'
- name: Set up Chrome for Karma tests
uses: browser-actions/setup-chrome@v1
- name: Configure npm registry
run: |
npm config set @universal-robots:registry https://pkgs.dev.azure.com/polyscopex/api/_packaging/polyscopex/npm/registry/
npm config set strict-ssl false
- name: Install dependencies
run: npm install
- name: Build project
run: npm run build
- name: Run frontend tests
working-directory: external-control-frontend
run: npm run test
# Store build artifacts as workflow artifacts (temporary)
- name: Store build artifacts
uses: actions/upload-artifact@v4
with:
name: build-temp-artifacts
path: target/external-control-*.urcapx
if-no-files-found: error
upload-urcapx:
runs-on: ubuntu-latest
needs: [backend-test, build-frontend-and-test] # Only runs if both jobs succeed
steps:
- name: Download build artifacts
uses: actions/download-artifact@v4
with:
name: build-temp-artifacts
path: target/
- name: Upload final artifacts
uses: actions/upload-artifact@v4
with:
name: external-control-urcapx
path: target/external-control-*.urcapx
if-no-files-found: error