forked from jupyterlab/pull-requests
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
404 additions
and
1,609 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,294 @@ | ||
name: Build | ||
name: CI | ||
|
||
on: | ||
push: | ||
branches: ["master", "next"] | ||
branches: [master, next] | ||
pull_request: | ||
branches: '*' | ||
|
||
env: | ||
CACHE_EPOCH: 1 | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
runs-on: ${{ matrix.os }}-latest | ||
|
||
strategy: | ||
matrix: | ||
os: [ubuntu] | ||
python-version: [3.9] | ||
node-version: [14.x] | ||
lab-version: [2] | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Install Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Install node | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
|
||
- name: Cache (node_modules) | ||
id: cache-node-modules | ||
uses: actions/cache@v2 | ||
with: | ||
path: node_modules | ||
key: | | ||
${{ env.CACHE_EPOCH }}-node-modules-${{ runner.os }}-${{ hashFiles('yarn.lock', '.yarnrc') }} | ||
- name: Install packaging pre-dependencies | ||
run: python -m pip install --upgrade pip wheel setuptools | ||
|
||
- name: Get pip cache dir | ||
id: cache-pip | ||
run: | | ||
echo "::set-output name=dir::$(pip cache dir)" | ||
- name: Cache pip | ||
uses: actions/cache@v2 | ||
with: | ||
path: ${{ steps.cache-pip.outputs.dir }} | ||
key: | | ||
${{ env.CACHE_EPOCH }}-${{ runner.os }}-pip-build-${{ matrix.python-version }}-${{ hashFiles('setup.py', 'setup.cfg') }} | ||
restore-keys: | | ||
${{ env.CACHE_EPOCH }}-${{ runner.os }}-pip-build-${{ matrix.python-version }}- | ||
${{ env.CACHE_EPOCH }}-${{ runner.os }}-pip- | ||
- name: Install packaging dependencies | ||
run: python -m pip install 'jupyterlab==${{ matrix.lab-version }}.*' twine | ||
|
||
- name: Install yarn dependencies | ||
if: ${{ steps.cache-node-modules.outputs.cache-hit != 'true' }} | ||
run: jlpm --prefer-offline --frozen-lockfile | ||
|
||
- name: Build JS (lib) | ||
run: jlpm build:lib | ||
|
||
- name: Build JS (labextension) | ||
run: jlpm build:labextension | ||
|
||
- name: Build PyPI distributions | ||
run: python setup.py sdist bdist_wheel | ||
|
||
- name: Validate packages | ||
run: twine check dist/* | ||
|
||
- name: Collect npmjs.com distribution | ||
run: | | ||
set -eux | ||
cp jupyterlab_pullrequests/labextension/*.tgz dist | ||
- name: Hash distributions | ||
run: | | ||
set -eux | ||
cd dist | ||
sha256sum * | tee SHA256SUMS | ||
- name: Upload distributions | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: pull-requests dist ${{ github.run_number }} | ||
path: ./dist | ||
|
||
lint: | ||
runs-on: ${{ matrix.os }}-latest | ||
|
||
strategy: | ||
matrix: | ||
os: [ubuntu] | ||
python-version: [3.9] | ||
node-version: [14.x] | ||
lab-version: [2] | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Install Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Install node | ||
uses: actions/setup-node@v1 | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
|
||
- name: Cache (node_modules) | ||
id: cache-node-modules | ||
uses: actions/cache@v2 | ||
with: | ||
path: node_modules | ||
key: | | ||
${{ env.CACHE_EPOCH }}-node-modules-${{ runner.os }}-${{ hashFiles('yarn.lock', '.yarnrc') }} | ||
- name: Install packaging pre-dependencies | ||
run: python -m pip install --upgrade pip wheel setuptools | ||
|
||
- name: Get pip cache dir | ||
id: cache-pip | ||
run: | | ||
echo "::set-output name=dir::$(pip cache dir)" | ||
- name: Cache pip | ||
uses: actions/cache@v2 | ||
with: | ||
node-version: '14.x' | ||
path: ${{ steps.cache-pip.outputs.dir }} | ||
key: | | ||
${{ env.CACHE_EPOCH }}-${{ runner.os }}-pip-lint-${{ matrix.python-version }}-${{ hashFiles('setup.py', 'setup.cfg') }} | ||
restore-keys: | | ||
${{ env.CACHE_EPOCH }}-${{ runner.os }}-pip-lint-${{ matrix.python-version }}- | ||
${{ env.CACHE_EPOCH }}-${{ runner.os }}-pip- | ||
- name: Install lint/test dependencies | ||
run: python -m pip install 'jupyterlab==${{ matrix.lab-version }}.*' | ||
|
||
- name: Build JS | ||
run: jlpm build | ||
|
||
- name: Install lint/test dependencies | ||
run: python -m pip install -e '.[coverage]' | ||
|
||
- name: Install yarn dependencies | ||
if: ${{ steps.cache-node-modules.outputs.cache-hit != 'true' }} | ||
run: jlpm --prefer-offline --frozen-lockfile | ||
|
||
- name: Lint (JS) | ||
run: jlpm eslint:check | ||
|
||
- name: Test (Python) | ||
run: | | ||
set -eux | ||
python -m pytest --pyargs jupyterlab_pullrequests --cov jupyterlab_pullrequests --cov-report term-missing:skip-covered --no-cov-on-fail | ||
- name: Test (JS) | ||
run: jlpm test || echo 'known to be broken' | ||
|
||
- name: Upload Coverage | ||
run: codecov | ||
|
||
install: | ||
runs-on: ${{ matrix.os }}-latest | ||
needs: [build] | ||
|
||
strategy: | ||
# TODO: possibly put back | ||
fail-fast: false | ||
matrix: | ||
os: [ubuntu, macos, windows] | ||
python-version: [3.6, 3.9, pypy3] | ||
node-version: [10.x, 14.x] | ||
lab-version: [2] | ||
include: | ||
# cover artifacts | ||
- python-version: 3.6 | ||
dist: jupyterlab_pullrequests*.tar.gz | ||
- python-version: 3.9 | ||
dist: jupyterlab_pullrequests*.whl | ||
- python-version: pypy3 | ||
dist: jupyterlab_pullrequests*.tar.gz | ||
# platform-specific pythons | ||
- os: windows | ||
py-cmd: python | ||
shell: cmd | ||
- os: macos | ||
py-cmd: python3 | ||
shell: bash | ||
- os: ubuntu | ||
py-cmd: python | ||
shell: bash | ||
exclude: | ||
# not supported | ||
- os: windows | ||
python-version: pypy3 | ||
# don't need the full node/py matrix | ||
- python-version: 3.6 | ||
node-version: 14.x | ||
- python-version: 3.9 | ||
node-version: 10.x | ||
- python-version: pypy3 | ||
node-version: 10.x | ||
|
||
defaults: | ||
run: | ||
shell: ${{ matrix.shell }} | ||
|
||
steps: | ||
- name: Install Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: '3.7' | ||
architecture: 'x64' | ||
- name: Install dependencies | ||
run: python -m pip install jupyterlab~=2.0 | ||
- name: Build the extension | ||
python-version: ${{ matrix.python-version }} | ||
architecture: x64 | ||
|
||
- name: Install pre-dependencies | ||
run: ${{ matrix.py-cmd }} -m pip install --upgrade pip wheel setuptools | ||
|
||
- name: Download distributions | ||
uses: actions/download-artifact@v2 | ||
with: | ||
name: pull-requests dist ${{ github.run_number }} | ||
path: ./dist | ||
|
||
- name: Get pip cache dir and distribution | ||
id: cache-pip | ||
shell: bash -l {0} | ||
run: | | ||
jlpm | ||
jlpm run eslint:check | ||
# jlpm run test | ||
set -eux | ||
echo "::set-output name=dir::$(${{ matrix.py-cmd }} -m pip cache dir)" | ||
echo "::set-output name=pydist::$(ls ./dist/${{ matrix.dist }})" | ||
- name: Cache pip | ||
uses: actions/cache@v2 | ||
with: | ||
path: ${{ steps.cache-pip.outputs.dir }} | ||
key: | | ||
${{ env.CACHE_EPOCH }}-${{ runner.os }}-pip-install-${{ matrix.python-version }}-${{ hashFiles('setup.py', 'setup.cfg') }} | ||
restore-keys: | | ||
${{ env.CACHE_EPOCH }}-${{ runner.os }}-pip-install-${{ matrix.python-version }}- | ||
${{ env.CACHE_EPOCH }}-${{ runner.os }}-pip- | ||
- name: Install package | ||
run: ${{ matrix.py-cmd }} -m pip install ${{ steps.cache-pip.outputs.pydist }} | ||
|
||
- name: List pip environment | ||
run: ${{ matrix.py-cmd }} -m pip freeze | ||
|
||
- name: Validate pip environment | ||
run: ${{ matrix.py-cmd }} -m pip check | ||
|
||
- name: List server extension | ||
run: jupyter serverextension list 2>&1 > serverextensions.txt | ||
|
||
- name: Validate server extension | ||
shell: bash -l {0} | ||
run: cat serverextensions.txt | grep -ie "jupyterlab_pullrequests.*enabled" | ||
|
||
- name: Install test dependencies | ||
run: ${{ matrix.py-cmd }} -m pip install "mock>=4.0.0" pytest-asyncio pytest diff-match-patch | ||
|
||
- name: Test (Python) | ||
run: ${{ matrix.py-cmd }} -m pytest --pyargs jupyterlab_pullrequests -vv | ||
|
||
- name: Install node | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
|
||
- name: Install Lab Extension | ||
run: ${{ matrix.py-cmd }} -m jupyter lab build | ||
|
||
pip install .[test] | ||
python -m pytest | ||
- name: List Lab Extensions | ||
run: ${{ matrix.py-cmd }} -m jupyter labextension list 2>&1 > labextensions.txt | ||
|
||
jupyter lab build | ||
jupyter serverextension list 2>&1 | grep -ie "jupyterlab_pullrequests.*OK" | ||
jupyter labextension list 2>&1 | grep -ie "@jupyterlab/pullrequests.*OK" | ||
- name: Validate Lab Extension | ||
shell: bash -l {0} | ||
run: cat labextensions.txt | grep -ie "@jupyterlab/pullrequests.*ok" | ||
|
||
python -m jupyterlab.browser_check | ||
- name: Run browser check | ||
run: ${{ matrix.py-cmd }} -m python -m jupyterlab.browser_check |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
yarn-offline-mirror "./.yarn-packages" | ||
yarn-offline-mirror-pruning true | ||
ignore-optional true | ||
network-timeout "300000" | ||
disable-self-update-check true |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1 @@ | ||
version_info = (2, 0, 0) | ||
__version__ = ".".join(map(str, version_info)) | ||
__version__ = "2.0.0" |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
from __future__ import annotations | ||
|
||
import abc | ||
import json | ||
import http | ||
|
Empty file.
Oops, something went wrong.