Skip to content

Update YML files to use Node 24 and latest actions #1

Update YML files to use Node 24 and latest actions

Update YML files to use Node 24 and latest actions #1

Workflow file for this run

# Copyright 2023-2025 The MathWorks, Inc.

Check failure on line 1 in .github/workflows/run-e2e-tests.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/run-e2e-tests.yml

Invalid workflow file

(Line: 15, Col: 21): A sequence was not expected, (Line: 16, Col: 23): A sequence was not expected
name: End-to-End Tests for MATLAB Integration for Jupyter
on:
workflow_call:
jobs:
playwright_e2e_tests:
timeout-minutes: 15
runs-on: ubuntu-latest
defaults:
run:
working-directory: tests/e2e
env:
NODE_VERSION: ["24"]
PYTHON_VERSION: ["3.10"]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Node ${{ env.NODE_VERSION }}
uses: actions/setup-node@v6
with:
node-version: ${{ env.NODE_VERSION }}
- name: Set up Python ${{ env.PYTHON_VERSION }}
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Install xvfb
run: |
sudo apt-get update
sudo apt-get install -y xvfb
- name: Install node dependencies
run: npm ci
- name: Run the linter
run: npm run lint
- name: Set up MATLAB
# Use MATLAB Actions to get running MATLAB in GitHub Actions
uses: matlab-actions/setup-matlab@v2
with:
products: MATLAB Symbolic_Math_Toolbox
- name: Install jupyterlab and jupyter-matlab-proxy
working-directory: ${{ github.workspace }}
run: |
python3 -m pip install --upgrade pip
python3 -m pip install ".[dev]"
python3 -m pip install "jupyterlab>4.0.0,<5.0.0"
- name: Install playwright browsers
run: npx playwright install --with-deps
- name: Find an available port
run: |
FREE_PORT=$(python3 -c 'import socket; s=socket.socket(); s.bind(("", 0)); print(s.getsockname()[1]); s.close()');
echo "Using port = ${FREE_PORT}"
echo "TEST_JMP_PORT=$FREE_PORT" >> "$GITHUB_ENV"
- name: Start JupyterLab in background and save PID
id: start-jlab
run: |
npm start
- name: License MATLAB
env:
TEST_USERNAME: ${{ secrets.TEST_USERNAME }}
TEST_PASSWORD: ${{ secrets.TEST_PASSWORD }}
run: |
python3 -m pip install --upgrade pip
python3 -m pip install pytest-playwright
python3 -m playwright install chromium --with-deps
(cd tests/utils && python3 -c "from licensing import *; license_with_online_licensing(log_dir=\"./licensing-logs\")")
- name: Run playwright tests
env:
TEST_JMP_PORT: ${{ env.TEST_JMP_PORT }}
run: |
echo "Playwright version: $(npx playwright -V)"
npm test
- name: Stop JupyterLab
if: always()
run: |
npm stop
- name: Zip test results
if: always()
run: |
zip -r zipped-e2e-test-results.zip \
./playwright-report \
./test-results \
./licensing-logs \
./jupyterlab.log
- name: Preserve test results after the job has finished
if: always()
uses: actions/upload-artifact@v4
with:
name: e2e_test_results
path: ./tests/e2e/zipped-e2e-test-results.zip
retention-days: 5