Bump lerna version from 7 to >9
#1189
Workflow file for this run
This file contains hidden or 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 | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: '*' | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} | |
| jobs: | |
| test-backend-conda: | |
| name: Server [Conda/Ubuntu] - Python ${{ matrix.python-version }} on JL ${{ matrix.jupyterlab-version }} | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: ['3.14'] | |
| jupyterlab-version: ['4.5'] | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Python ${{ matrix.python-version }} | |
| uses: conda-incubator/setup-miniconda@v3 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| activate-environment: test_gator | |
| channels: conda-forge | |
| show-channel-urls: true | |
| use-only-tar-bz2: false | |
| - name: Install and enable Corepack | |
| run: | | |
| npm install -g corepack@0.33.0 --force | |
| corepack enable | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| - name: Install dependencies | |
| run: | | |
| conda info | |
| conda install -c conda-forge -n test_gator nb_conda_kernels "jupyterlab=${{ matrix.jupyterlab-version }}" "notebook>=7" | |
| conda activate test_gator | |
| jupyter --version | |
| jlpm install | |
| shell: bash -l {0} | |
| - name: Install Extension | |
| run: pip install -e .[test,dev] | |
| shell: bash -l {0} | |
| - name: Test the server extension | |
| run: python -m pytest -ra mamba_gator | |
| shell: bash -l {0} | |
| test-backend-mamba: | |
| name: Server [Mamba/Ubuntu] - Python ${{ matrix.python-version }} on JL ${{ matrix.jupyterlab-version }} | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: ['3.14'] | |
| jupyterlab-version: ['4.5'] | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Cache conda | |
| uses: actions/cache@v4 | |
| env: | |
| # Increase this value to reset cache | |
| CACHE_NUMBER: 0 | |
| with: | |
| path: ~/conda_pkgs_dir | |
| key: ${{ runner.os }}-mamba-${{ matrix.python-version }}-${{ env.CACHE_NUMBER }}-${{ hashFiles('pyproject.toml') }} | |
| restore-keys: | | |
| ${{ runner.os }}-mamba-${{ matrix.python-version }}-${{ env.CACHE_NUMBER }}-${{ hashFiles('pyproject.toml') }} | |
| ${{ runner.os }}-mamba-${{ matrix.python-version }} | |
| - name: Setup Python ${{ matrix.python-version }} | |
| uses: conda-incubator/setup-miniconda@v3 | |
| with: | |
| miniforge-version: '24.11.3-2' # For Mamba 1.5.12 | |
| show-channel-urls: true | |
| use-only-tar-bz2: false | |
| - name: Install and enable Corepack | |
| run: | | |
| npm install -g corepack@0.33.0 --force | |
| corepack enable | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: 'yarn' | |
| - name: Install dependencies | |
| run: | | |
| mamba create -y -n test_gator -c conda-forge python=${{ matrix.python-version }} nb_conda_kernels | |
| conda activate test_gator | |
| pip install "jupyterlab==${{ matrix.jupyterlab-version }}.*" "notebook>=7" | |
| jupyter --version | |
| jlpm install | |
| shell: bash -l {0} | |
| - name: Install Extension | |
| run: | | |
| conda activate test_gator | |
| pip install -e .[test,dev] | |
| shell: bash -l {0} | |
| - name: Test the server extension | |
| run: | | |
| conda activate test_gator | |
| python -m pytest -ra mamba_gator | |
| shell: bash -l {0} | |
| test-frontend-unit: | |
| name: Frontend Unit Tests on JL ${{ matrix.jupyterlab-version }} | |
| runs-on: ubuntu-latest | |
| # Note: Skipping setup-python - using runner's pre-installed Python for pip only. | |
| # JupyterLab is installed just to get jlpm, not for Python code execution. | |
| strategy: | |
| matrix: | |
| jupyterlab-version: ['4.5'] | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Install and enable Corepack | |
| run: | | |
| npm install -g corepack@0.33.0 --force | |
| corepack enable | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: 'yarn' | |
| - name: Install JupyterLab | |
| run: pip install "jupyterlab==${{ matrix.jupyterlab-version }}.*" | |
| - name: Install dependencies | |
| run: jlpm install | |
| - name: Run linter | |
| run: jlpm run eslint:check | |
| - name: Build packages | |
| run: jlpm run build | |
| - name: Run frontend tests | |
| run: jlpm run test | |
| # TODO: Enable when adding Playwright E2E tests | |
| # test-frontend-e2e: | |
| # name: Test E2E on ${{ matrix.os }} on ${{ matrix.jupyterlab-version }} | |
| # runs-on: ${{ matrix.os }} | |
| # strategy: | |
| # matrix: | |
| # jupyterlab-version: ["4.5"] | |
| # os: | |
| # - ubuntu-latest | |
| # - macos-latest | |
| # - windows-latest | |
| # steps: | |
| # - name: Checkout | |
| # uses: actions/checkout@v4 | |
| # - name: Install and enable Corepack | |
| # run: | | |
| # npm install -g corepack@0.33.0 --force | |
| # corepack enable | |
| # - name: Setup Node.js | |
| # uses: actions/setup-node@v4 | |
| # with: | |
| # node-version: '20' | |
| # cache: 'yarn' | |
| # - name: Install JupyterLab | |
| # run: pip install "jupyterlab==${{ matrix.jupyterlab-version }}.*" | |
| # - name: Install dependencies | |
| # run: jlpm install | |
| # - name: Build packages | |
| # run: jlpm run build | |
| # - name: Install Playwright browsers | |
| # run: npx playwright install --with-deps chromium | |
| # - name: Run E2E tests | |
| # run: jlpm run test:e2e | |
| test-backend-os-compat: | |
| name: Server [Conda/${{ matrix.os }}] - Python 3.14 on JL ${{ matrix.jupyterlab-version }} | |
| runs-on: ${{ matrix.os }} | |
| continue-on-error: true | |
| timeout-minutes: 60 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: | |
| - 'macos-latest' | |
| - 'windows-latest' | |
| jupyterlab-version: ['4.5'] | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Cache conda | |
| uses: actions/cache@v4 | |
| env: | |
| # Increase this value to reset cache | |
| CACHE_NUMBER: 0 | |
| with: | |
| path: ~/conda_pkgs_dir | |
| key: ${{ matrix.os }}-conda-3.14-${{ env.CACHE_NUMBER }}-${{ hashFiles('pyproject.toml') }} | |
| restore-keys: | | |
| ${{ matrix.os }}-conda-3.14-${{ env.CACHE_NUMBER }}-${{ hashFiles('pyproject.toml') }} | |
| ${{ matrix.os }}-conda-3.14 | |
| - name: Setup Python 3.14 | |
| uses: conda-incubator/setup-miniconda@v3 | |
| with: | |
| activate-environment: test_gator | |
| channels: conda-forge | |
| python-version: '3.14' | |
| show-channel-urls: true | |
| use-only-tar-bz2: false | |
| - name: Install and enable Corepack | |
| run: | | |
| npm install -g corepack@0.33.0 --force | |
| corepack enable | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: 'yarn' | |
| - name: Create conda environment | |
| run: | | |
| conda info | |
| conda install -c conda-forge -n test_gator nb_conda_kernels "jupyterlab=${{ matrix.jupyterlab-version }}" "notebook>=7" | |
| - name: Upgrade conda dependencies on Windows (resolves OSError) | |
| if: matrix.os == 'windows-latest' | |
| run: > | |
| conda install -c conda-forge -n test_gator | |
| "websocket-client>=1.7" | |
| "send2trash>=1.8.2" | |
| "jupyter_server<3.0.0,>=2.0.0" | |
| --yes | |
| shell: bash -l {0} | |
| - name: Install dependencies and Extension | |
| run: | | |
| conda activate test_gator | |
| jlpm install | |
| pip install -e .[test,dev] | |
| shell: bash -l {0} | |
| - name: Test the extension | |
| env: | |
| OS_RUNNER: ${{ matrix.os }} | |
| run: | | |
| conda activate test_gator | |
| python -m pytest mamba_gator | |
| shell: bash -l {0} | |
| - name: Verify extension installation | |
| run: | | |
| conda activate test_gator | |
| jupyter server extension list | |
| jupyter labextension list | |
| shell: bash -l {0} | |
| - name: Browser check | |
| if: matrix.os != 'windows-latest' | |
| run: | | |
| npx playwright install --with-deps chromium | |
| conda activate test_gator | |
| python -m jupyterlab.browser_check | |
| shell: bash -l {0} | |
| test-integration: | |
| name: Full Suite [Mamba/Ubuntu] - Python 3.14 on JL ${{ matrix.jupyterlab-version }} | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| jupyterlab-version: ['4.5'] | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Cache conda | |
| uses: actions/cache@v4 | |
| env: | |
| # Increase this value to reset cache | |
| CACHE_NUMBER: 0 | |
| with: | |
| path: ~/conda_pkgs_dir | |
| key: ${{ runner.os }}-mamba-3.14-${{ env.CACHE_NUMBER }}-${{ hashFiles('pyproject.toml') }} | |
| restore-keys: | | |
| ${{ runner.os }}-mamba-3.14-${{ env.CACHE_NUMBER }}-${{ hashFiles('pyproject.toml') }} | |
| ${{ runner.os }}-mamba-3.14 | |
| - name: Setup Python 3.14 | |
| uses: conda-incubator/setup-miniconda@v3 | |
| with: | |
| miniforge-version: '24.11.3-2' # For Mamba 1.5.12 | |
| show-channel-urls: true | |
| use-only-tar-bz2: false | |
| - name: Install and enable Corepack | |
| run: | | |
| npm install -g corepack@0.33.0 --force | |
| corepack enable | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: 'yarn' | |
| - name: Create mamba environment | |
| shell: bash -l {0} | |
| run: | | |
| mamba create -y -n test_gator -c conda-forge python=3.14 nb_conda_kernels | |
| conda activate test_gator | |
| pip install "jupyterlab==${{ matrix.jupyterlab-version }}.*" "notebook>=7" | |
| python --version | |
| jupyter --version | |
| - name: Install Dependencies and Extension | |
| run: | | |
| conda activate test_gator | |
| jlpm install | |
| pip install -e .[test,dev] | |
| # Check pip dependencies | |
| pip check | |
| shell: bash -l {0} | |
| - name: Install Playwright browsers | |
| run: npx playwright install --with-deps chromium | |
| shell: bash -l {0} | |
| - name: Run linters | |
| run: | | |
| conda activate test_gator | |
| hatch run lint:check | |
| jlpm run eslint:check | |
| shell: bash -l {0} | |
| - name: Test TypeScript frontend | |
| run: | | |
| conda activate test_gator | |
| jlpm run test | |
| shell: bash -l {0} | |
| - name: Test Python backend with coverage | |
| run: | | |
| conda activate test_gator | |
| coverage run -m pytest mamba_gator --junitxml=pytest-results.xml | |
| coverage report | |
| coverage xml -o coverage.xml | |
| coverage json -o coverage.json | |
| shell: bash -l {0} | |
| - name: Generate coverage report summary | |
| if: always() | |
| run: | | |
| conda activate test_gator | |
| echo "## 🐍 Python Backend Test Coverage" >> $GITHUB_STEP_SUMMARY | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| echo "\`\`\`" >> $GITHUB_STEP_SUMMARY | |
| coverage report >> $GITHUB_STEP_SUMMARY | |
| echo "\`\`\`" >> $GITHUB_STEP_SUMMARY | |
| shell: bash -l {0} | |
| - name: Upload coverage reports | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: coverage-report | |
| path: | | |
| coverage.xml | |
| coverage.json | |
| pytest-results.xml | |
| .coverage | |
| - name: Verify extension installation | |
| run: | | |
| conda activate test_gator | |
| jupyter server extension list | |
| jupyter server extension list 2>&1 | grep "mamba_gator.*OK" | |
| jupyter labextension list | |
| jupyter labextension list 2>&1 | grep "@mamba-org/gator-lab.*OK" | |
| python -m jupyterlab.browser_check | |
| shell: bash -l {0} | |
| make_sdist: | |
| name: Make SDist | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 20 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Base Setup | |
| uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1 | |
| with: | |
| python_version: '3.14' | |
| - name: Build SDist | |
| run: | | |
| pip install build | |
| python -m build --sdist | |
| - name: Upload sdist Artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: 'sdist' | |
| path: dist/*.tar.gz | |
| test-offline-build: | |
| name: Test building offline | |
| runs-on: ubuntu-latest | |
| needs: [make_sdist] | |
| timeout-minutes: 20 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Base Setup | |
| uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1 | |
| - name: Download sdist | |
| uses: actions/download-artifact@v4 | |
| - name: Install From SDist | |
| run: | | |
| set -ex | |
| cd sdist | |
| mkdir test | |
| tar --strip-components=1 -zxvf *.tar.gz -C ./test | |
| - name: Test offline build with unshare | |
| run: | | |
| # Use unshare to create a network namespace that blocks network access | |
| cd sdist/test | |
| python -m venv .venv | |
| .venv/bin/python -m pip install build jupyter-server hatch-jupyter-builder jupyterlab | |
| sudo unshare --net bash -c ".venv/bin/python -m build --no-isolation --wheel" |