Files
reusing_workflows/.github/workflows/build_jlext.yml
2024-04-11 15:53:16 +08:00

80 lines
2.1 KiB
YAML

on:
workflow_call:
inputs:
extension-name:
required: true
type: string
dist-dir:
required: false
type: string
default: 'dist'
artifact-name:
required: false
type: string
default: 'artifact'
jobs:
build_jlext_project:
runs-on: ubuntu_act_on_20
# container:
# image: catthehacker/ubuntu:act-latest
env:
RUNNER_TOOL_CACHE: /toolcache
steps:
- uses: actions/checkout@v4
- name: Install yarn
run: |
curl -fsSL --create-dirs -o $HOME/bin/yarn \
https://github.com/yarnpkg/yarn/releases/download/v1.22.22/yarn-1.22.22.js
chmod +x $HOME/bin/yarn
echo "$HOME/bin" >> $GITHUB_PATH
- name: Base Setup
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
- name: Install dependencies
run: python -m pip install -U "jupyterlab>=4.0.0,<5"
# - name: Lint the extension
# run: |
# set -eux
# jlpm
# jlpm run lint:check
# - name: Test the extension
# run: |
# set -eux
# jlpm run test
# - name: Build the extension
# run: |
# set -eux
# python -m pip install .[test]
# pytest -vv -r ap --cov ${{ inputs.extension-name }}
# jupyter server extension list
# jupyter server extension list 2>&1 | grep -ie "${{ inputs.extension-name }}.*OK"
# jupyter labextension list
# jupyter labextension list 2>&1 | grep -ie "alab-project-ext.*OK"
# python -m jupyterlab.browser_check
- name: Package the extension
run: |
set -eux
pip install build
python -m build
pip uninstall -y "${{ inputs.extension-name }}" jupyterlab
mv ${{ inputs.dist-dir }} pub
- uses: actions/upload-artifact@v3
with:
name: ${{ inputs.artifact-name }}
path: |
pub
docker
if-no-files-found: error