Skip to content

Commit

Permalink
Split the build github action per package
Browse files Browse the repository at this point in the history
  • Loading branch information
brichet committed Apr 8, 2024
1 parent 8101fae commit b303fa6
Showing 1 changed file with 24 additions and 23 deletions.
47 changes: 24 additions & 23 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ concurrency:
cancel-in-progress: true

jobs:
build:
build_jupyter-chat:
runs-on: ubuntu-latest
name: Build jupyter_chat

steps:
- name: Checkout
Expand All @@ -24,48 +25,48 @@ jobs:
- name: Install dependencies
run: python -m pip install -U "jupyterlab>=4.0.0,<5"

- name: Lint the extension
- name: Lint the packages
run: |
set -eux
jlpm
jlpm run lint:check
- name: Build the core package
run: jlpm build:core

- name: Test the packages
run: |
set -eux
jlpm run test
- name: Build packages
run: jlpm build

- name: Package jupyterlab_ws_chat
working-directory: packages/jupyterlab-ws-chat
run: |
set -eux
pip install build
python -m build
pip uninstall -y "jupyterlab_ws_chat" jupyterlab
build_extensions:
runs-on: ubuntu-latest
needs: build_jupyter-chat
strategy:
matrix:
extension: [collaborative, websocket]
name: Build ${{ matrix.extension }} chat extension
env:
PACKAGE: fromJSON('["jupyterlab_ws_chat", "jupyterlab_${{ matrix.extension }}_chat"]')[matrix.extension == 'websocket']
DIRECTORY: fromJSON('["packages/jupyterlab-ws-chat", "packages/jupyterlab-${{ matrix.extension }}-chat"]')[matrix.extension == 'websocket']

- name: Upload jupyterlab_ws_chat packages
uses: actions/upload-artifact@v3
with:
name: package-artifacts
path: packages/jupyterlab-ws-chat/dist/jupyterlab_ws_chat*
if-no-files-found: error
steps:
- name: Build package
run: jlpm build:${{ matrix.extension }}

- name: Package jupyterlab_collaborative_chat
working-directory: packages/jupyterlab-collaborative-chat
- name: Package ${{ env.PACKAGE }}
working-directory: ${{ env.DIRECTORY }}
run: |
set -eux
pip install build
python -m build
pip uninstall -y "jupyterlab_collaborative_chat" jupyterlab
pip uninstall -y "${{ env.PACKAGE }}" jupyterlab
- name: Upload jupyterlab_collaborative_chat packages
- name: Upload ${{ env.PACKAGE }} package
uses: actions/upload-artifact@v3
with:
name: package-artifacts
path: packages/jupyterlab-collaborative-chat/dist/jupyterlab_collaborative_chat*
path: ${{ env.DIRECTORY }}/dist/${{ env.PACKAGE }}*
if-no-files-found: error

check_links:
Expand Down

0 comments on commit b303fa6

Please sign in to comment.