You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
187 lines
5.2 KiB
187 lines
5.2 KiB
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 -eux {0}
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Build
|
|
uses: ./.github/actions/build-dist
|
|
|
|
test:
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 10
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Base Setup
|
|
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
|
|
|
|
- name: Test the package
|
|
run: hatch run cov:test
|
|
|
|
- name: JavaScript tests
|
|
run: |
|
|
pip install jupyterlab
|
|
jlpm run build:test
|
|
jlpm run test
|
|
|
|
- name: Integration Tests
|
|
run: |
|
|
pip install .
|
|
cd
|
|
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
|
|
|
|
test_docs:
|
|
name: Test Docs
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
|
|
- run: |
|
|
# pandoc is not up to date in the ubuntu repos, so we install directly
|
|
wget https://github.com/jgm/pandoc/releases/download/2.14.2/pandoc-2.14.2-1-amd64.deb && sudo dpkg -i pandoc-2.14.2-1-amd64.deb
|
|
- run: hatch run docs:build
|
|
|
|
test_minimum_versions:
|
|
name: Test Minimum Versions
|
|
timeout-minutes: 20
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
|
|
with:
|
|
python_version: "3.7"
|
|
- uses: jupyterlab/maintainer-tools/.github/actions/install-minimums@v1
|
|
with:
|
|
only_create_file: 1
|
|
- name: Run the unit tests
|
|
run: |
|
|
export PIP_CONSTRAINT="./contraints_file.txt"
|
|
hatch run test:nowarn || hatch run test:nowarn --lf
|
|
|
|
test_prereleases:
|
|
name: Test Prereleases
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 20
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
|
|
with:
|
|
python_version: "3.11"
|
|
- name: Run the tests
|
|
run: |
|
|
PIP_PRE=1 hatch run test:nowarn || hatch run test:nowarn --lf
|
|
|
|
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.11']
|
|
include:
|
|
- python: '3.7'
|
|
dist: 'notebook*.tar.gz'
|
|
- python: '3.11'
|
|
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@v3
|
|
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
|
|
|
|
check_links:
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 10
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
|
|
- uses: jupyterlab/maintainer-tools/.github/actions/check-links@v1
|
|
with:
|
|
ignore_links: "https://playwright.dev/docs/test-cli/ https://blog.jupyter.org/the-big-split-9d7b88a031a7 https://blog.jupyter.org/jupyter-ascending-1bf5b362d97e"
|
|
|
|
pre_commit:
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 10
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
|
|
- run: pip install -e .
|
|
- uses: jupyterlab/maintainer-tools/.github/actions/pre-commit@v1
|
|
|
|
|
|
tests_check: # This job does nothing and is only used for the branch protection
|
|
if: always()
|
|
needs:
|
|
- test
|
|
- install
|
|
- pre_commit
|
|
- test_docs
|
|
- test_minimum_versions
|
|
- test_prereleases
|
|
- check_links
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Decide whether the needed jobs succeeded or failed
|
|
uses: re-actors/alls-green@release/v1
|
|
with:
|
|
jobs: ${{ toJSON(needs) }}
|