notebook/.github/workflows/build.yml

199 lines
5.2 KiB
YAML
Raw Normal View History

2020-12-08 00:51:17 +08:00
name: Build
on:
push:
2021-05-28 21:05:47 +08:00
branches: '*'
2020-12-08 00:51:17 +08:00
pull_request:
branches: '*'
2021-05-28 20:17:09 +08:00
permissions:
contents:
write
2021-01-06 10:17:29 +08:00
env:
PIP_DISABLE_PIP_VERSION_CHECK: 1
defaults:
run:
shell: bash -l {0}
2020-12-08 00:51:17 +08:00
jobs:
integrity:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Build checksum file
run: |
2021-05-28 20:17:09 +08:00
sed -n 20,146p .github/workflows/build.yml > build
sed -n 20,146p .github/workflows/release.yml > release
diff build release
2021-01-06 10:17:29 +08:00
test:
needs: [integrity]
2020-12-08 00:51:17 +08:00
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install node
2021-01-22 06:22:59 +08:00
uses: actions/setup-node@v2
2020-12-08 00:51:17 +08:00
with:
node-version: '14.x'
- name: Install Python
uses: actions/setup-python@v2
with:
python-version: '3.9'
architecture: 'x64'
- name: Install dependencies
run: |
2021-01-06 10:17:29 +08:00
python -m pip install --upgrade pip wheel
2020-12-08 00:51:17 +08:00
python -m pip install jupyter_packaging
- name: Install the package
run: |
python -m pip install .
jupyter labextension list 2>&1 | grep -ie "@retrolab/lab-extension.*enabled.*ok" -
jupyter server extension list 2>&1 | grep -ie "retrolab.*enabled" -
2020-12-08 00:51:17 +08:00
python -m jupyterlab.browser_check
- name: Lint
run: |
jlpm
jlpm run eslint:check
jlpm run prettier:check
- name: Test
run: |
jlpm run build:test
2021-01-29 07:34:07 +08:00
jlpm run test
2021-01-06 10:17:29 +08:00
build:
needs: [integrity]
2021-01-06 10:17:29 +08:00
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install node
2021-01-22 06:22:59 +08:00
uses: actions/setup-node@v2
2021-01-06 10:17:29 +08:00
with:
node-version: '14.x'
- name: Install Python
uses: actions/setup-python@v2
with:
python-version: '3.9'
architecture: 'x64'
- name: Install dependencies
run: |
python -m pip install --upgrade pip wheel
python -m pip install setuptools jupyter_packaging "jupyterlab>=3,<4"
2021-01-06 22:15:17 +08:00
- name: Build pypi distributions
2021-01-06 10:17:29 +08:00
run: |
python setup.py sdist bdist_wheel
2021-01-06 22:15:17 +08:00
- name: Build npm distributions
run: |
mkdir pkgs
2021-01-06 22:15:17 +08:00
jlpm lerna exec -- npm pack
cp packages/*/*.tgz pkgs
2021-01-06 22:15:17 +08:00
- name: Build checksum file
run: |
2021-01-06 10:17:29 +08:00
cd dist
sha256sum * | tee SHA256SUMS
cd ../pkgs
sha256sum * | tee SHA256SUMS
2021-01-06 22:15:17 +08:00
- name: Upload distributions
2021-01-06 10:17:29 +08:00
uses: actions/upload-artifact@v2
with:
name: dist ${{ github.run_number }}
path: ./dist
- name: Upload distributions
uses: actions/upload-artifact@v2
with:
name: pkgs ${{ github.run_number }}
path: ./pkgs
2021-01-06 10:17:29 +08:00
install:
runs-on: ${{ matrix.os }}-latest
needs: [build]
strategy:
fail-fast: false
matrix:
os: [ubuntu, macos, windows]
python: ['3.6', '3.9']
include:
- python: '3.6'
dist: 'retrolab*.tar.gz'
2021-01-06 10:17:29 +08:00
- python: '3.9'
dist: 'retrolab*.whl'
2021-01-06 10:17:29 +08:00
- os: windows
py_cmd: python
- os: macos
py_cmd: python3
- os: ubuntu
py_cmd: python
steps:
- name: Install Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python }}
architecture: 'x64'
- uses: actions/download-artifact@v2
with:
name: dist ${{ github.run_number }}
path: ./dist
- name: Install the prerequisites
run: |
${{ matrix.py_cmd }} -m pip install 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 "@retrolab/lab-extension.*enabled.*ok" -
2021-01-06 10:17:29 +08:00
jupyter server extension list
jupyter server extension list 2>&1 | grep -ie "retrolab.*enabled" -
jupyter retro --version
jupyter retro --help
2021-01-29 07:34:07 +08:00
end2end:
needs: [build]
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
browser: [firefox, chromium]
steps:
2021-01-29 07:41:55 +08:00
- name: Checkout
uses: actions/checkout@v2
2021-01-29 07:34:07 +08:00
- name: Install Python
uses: actions/setup-python@v2
with:
python-version: '3.9'
architecture: 'x64'
- uses: actions/download-artifact@v2
with:
name: dist ${{ github.run_number }}
path: ./dist
- name: Install the prerequisites
run: |
python -m pip install pip wheel
- name: Install the package
run: |
cd dist
python -m pip install -vv retrolab*.whl
2021-01-29 07:34:07 +08:00
- uses: microsoft/playwright-github-action@v1
- name: Test
run: |
2021-01-29 07:59:53 +08:00
jlpm
2021-01-29 07:34:07 +08:00
jlpm run build:test
2021-01-29 07:53:48 +08:00
jlpm run test:ci
2021-01-29 07:34:07 +08:00
env:
BROWSER: ${{ matrix.browser }}
- uses: actions/upload-artifact@v2
if: ${{ always() }}
with:
name: test-artifacts-${{ matrix.browser }} ${{ github.run_number }}
2021-01-29 07:34:07 +08:00
path: app/artifacts