Agent Mode: Tests #580
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: Test - Mito AI | |
on: | |
push: | |
branches: [ dev ] | |
paths: | |
- 'mito-ai/**' | |
- 'tests/mitoai_ui_tests/**' | |
- '.github/workflows/test-mito-ai.yml' | |
pull_request: | |
paths: | |
- 'mito-ai/**' | |
- 'tests/mitoai_ui_tests/**' | |
- '.github/workflows/test-mito-ai.yml' | |
jobs: | |
test-mitoai-frontend-jupyterlab: | |
runs-on: ubuntu-20.04 | |
timeout-minutes: 60 | |
strategy: | |
matrix: | |
python-version: ['3.10', '3.12'] | |
use-mito-ai-server: [true, false] | |
fail-fast: false | |
steps: | |
- name: Cancel Previous Runs | |
uses: styfle/[email protected] | |
with: | |
access_token: ${{ github.token }} | |
- uses: actions/checkout@v2 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ matrix.python-version }} | |
cache: pip | |
cache-dependency-path: | | |
mito-ai/setup.py | |
tests/requirements.txt | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
cache: 'npm' | |
cache-dependency-path: mito-ai/package-lock.json | |
- name: Upgrade pip | |
run: | | |
python -m pip install --upgrade pip | |
- name: Install dependencies | |
run: | | |
cd tests | |
bash mac-setup.sh | |
- name: Setup JupyterLab | |
run: | | |
cd tests | |
source venv/bin/activate | |
cd ../mito-ai | |
jupyter labextension develop . --overwrite | |
jupyter server extension enable --py mito_ai | |
- name: Start a server and run tests | |
run: | | |
cd tests | |
source venv/bin/activate | |
jupyter lab --config jupyter_server_test_config.py & | |
npm run test:mitoai | |
env: | |
OPENAI_API_KEY: ${{ matrix.use-mito-ai-server && '' || secrets.OPENAI_API_KEY }} | |
- name: Upload test-results | |
uses: actions/upload-artifact@v4 | |
if: failure() | |
with: | |
name: mitoai-jupyterlab-playwright-report-${{ matrix.python-version }}-${{ matrix.use-mito-ai-server }}-${{ github.run_id }} | |
path: tests/playwright-report/ | |
retention-days: 14 |