name: Build on: push: branches: ['main'] pull_request: permissions: contents: write concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} cancel-in-progress: true env: PIP_DISABLE_PIP_VERSION_CHECK: 1 defaults: run: shell: bash -e {0} jobs: build: runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v2 - name: Build uses: ./.github/actions/build-dist test: runs-on: ubuntu-latest timeout-minutes: 10 steps: - name: Checkout uses: actions/checkout@v2 - name: Base Setup uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1 with: python_version: "3.10" - name: Install the package run: | python -m pip install ".[dev,test]" jlpm run build:test - name: Unit tests run: | jlpm run test pytest -vv || pytest -vv --lf - name: Integration Tests run: | jupyter labextension list 2>&1 | grep -ie "@jupyter-notebook/lab-extension.*enabled.*ok" - jupyter server extension list 2>&1 | grep -ie "notebook.*enabled" - python -m jupyterlab.browser_check install: needs: [build] runs-on: ${{ matrix.os }} timeout-minutes: 10 strategy: fail-fast: false matrix: os: [ubuntu-latest, macos-latest, windows-latest] python: ['3.7', '3.10'] include: - python: '3.7' dist: 'notebook*.tar.gz' - python: '3.10' dist: 'notebook*.whl' - os: windows-latest py_cmd: python - os: macos-latest py_cmd: python3 - os: ubuntu-latest py_cmd: python steps: - name: Install Python uses: actions/setup-python@v4 with: python-version: ${{ matrix.python }} architecture: 'x64' - uses: actions/download-artifact@v2 with: name: notebook-dist-${{ github.run_number }} path: ./dist - name: Install the prerequisites run: | ${{ matrix.py_cmd }} -m pip install -U pip wheel - name: Install the package run: | cd dist ${{ matrix.py_cmd }} -m pip install -vv ${{ matrix.dist }} - name: Validate environment run: | ${{ matrix.py_cmd }} -m pip freeze ${{ matrix.py_cmd }} -m pip check - name: Validate the install run: | jupyter labextension list jupyter labextension list 2>&1 | grep -ie "@jupyter-notebook/lab-extension.*enabled.*ok" - jupyter server extension list jupyter server extension list 2>&1 | grep -ie "notebook.*enabled" - jupyter notebook --version jupyter notebook --help pre-commit: runs-on: ubuntu-latest timeout-minutes: 10 steps: - uses: actions/checkout@v2 - name: Base Setup uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1 - name: Install Jupyterlab run: pip install -e . - uses: pre-commit/action@v2.0.0 with: extra_args: --all-files --hook-stage=manual - name: Help message if pre-commit fail if: ${{ failure() }} run: | echo "or you can run by hand on staged files with" echo " pre-commit run" echo "or after-the-fact on already committed files with" echo " pre-commit run --all-files --hook-stage=manual"