From 584d00e257afd4bc407b3835c9a3ac1dc181f5d5 Mon Sep 17 00:00:00 2001 From: yacchin1205 <968739+yacchin1205@users.noreply.github.com> Date: Tue, 12 Nov 2024 07:48:54 +0900 Subject: [PATCH 1/3] Fix actions workflows --- .github/workflows/build.yml | 28 +++++++++++-- .github/workflows/check-release.yml | 63 ----------------------------- .github/workflows/release.yml | 15 +++++-- 3 files changed, 36 insertions(+), 70 deletions(-) delete mode 100644 .github/workflows/check-release.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5deea46..b9fb255 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -23,23 +23,45 @@ jobs: run: | set -eux jlpm - jlpm lint:check + jlpm run eslint:check python -m pip install . jupyter labextension list 2>&1 | grep -ie "lc_notebook_diff.*OK" python -m jupyterlab.browser_check + jlpm install + cd ./ui-tests + jlpm install + jlpm playwright install + jlpm playwright test + cd .. + pip install build python -m build --sdist cp dist/*.tar.gz myextension.tar.gz pip uninstall -y "lc_notebook_diff" jupyterlab rm -rf myextension - - uses: actions/upload-artifact@v2 + npm pack + mv lc_notebook_diff-*.tgz myextension-nodejs.tgz + + - uses: actions/upload-artifact@v4 + if: ${{ !cancelled() }} + with: + name: playwright-report + path: ui-tests/playwright-report/ + retention-days: 30 + + - uses: actions/upload-artifact@v4 with: name: myextension-sdist path: myextension.tar.gz + - uses: actions/upload-artifact@v4 + with: + name: myextension-nodejs + path: myextension-nodejs.tgz + test_isolated: needs: build runs-on: ubuntu-latest @@ -52,7 +74,7 @@ jobs: with: python-version: '3.9' architecture: 'x64' - - uses: actions/download-artifact@v2 + - uses: actions/download-artifact@v4 with: name: myextension-sdist - name: Install and Test diff --git a/.github/workflows/check-release.yml b/.github/workflows/check-release.yml deleted file mode 100644 index b88365d..0000000 --- a/.github/workflows/check-release.yml +++ /dev/null @@ -1,63 +0,0 @@ -name: Check Release -on: - push: - branches: - - main - pull_request: - branches: - - main - -permissions: - contents: write - -jobs: - check_release: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v2 - - name: Install Python - uses: actions/setup-python@v2 - with: - python-version: 3.9 - architecture: 'x64' - - name: Install node - uses: actions/setup-node@v3 - with: - node-version: 18 - - - - name: Get pip cache dir - id: pip-cache - run: | - echo "::set-output name=dir::$(pip cache dir)" - - name: Cache pip - uses: actions/cache@v1 - with: - path: ${{ steps.pip-cache.outputs.dir }} - key: ${{ runner.os }}-pip-${{ hashFiles('package.json') }} - restore-keys: | - ${{ runner.os }}-pip- - - name: Cache checked links - uses: actions/cache@v2 - with: - path: ~/.cache/pytest-link-check - key: ${{ runner.os }}-linkcheck-${{ hashFiles('**/.md') }}-md-links - restore-keys: | - ${{ runner.os }}-linkcheck- - - name: Upgrade packaging dependencies - run: | - pip install --upgrade pip setuptools wheel jupyter-packaging~=0.10 --user - - name: Install Dependencies - run: | - pip install . - - name: Check Release - uses: jupyter-server/jupyter_releaser/.github/actions/check-release@v1 - with: - token: ${{ secrets.GITHUB_TOKEN }} - - - name: Upload Distributions - uses: actions/upload-artifact@v2 - with: - name: lc_notebook_diff-releaser-dist-${{ github.run_number }} - path: .jupyter_releaser_checkout/dist diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d5811eb..0623b7b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -79,12 +79,19 @@ jobs: npm pack mv lc_notebook_diff-*.tgz myextension-nodejs.tgz - - uses: actions/upload-artifact@v2 + - uses: actions/upload-artifact@v4 + if: ${{ !cancelled() }} + with: + name: playwright-report + path: ui-tests/playwright-report/ + retention-days: 30 + + - uses: actions/upload-artifact@v4 with: name: myextension-sdist path: myextension.tar.gz - - uses: actions/upload-artifact@v2 + - uses: actions/upload-artifact@v4 with: name: myextension-nodejs path: myextension-nodejs.tgz @@ -96,10 +103,10 @@ jobs: steps: - name: Checkout uses: actions/checkout@v2 - - uses: actions/download-artifact@v2 + - uses: actions/download-artifact@v4 with: name: myextension-sdist - - uses: actions/download-artifact@v2 + - uses: actions/download-artifact@v4 with: name: myextension-nodejs - name: release From d6d56fc3daf00eedc7cc3d59758b6552b9e6128c Mon Sep 17 00:00:00 2001 From: yacchin1205 <968739+yacchin1205@users.noreply.github.com> Date: Tue, 12 Nov 2024 08:49:45 +0900 Subject: [PATCH 2/3] Fix build script --- hatch_build.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hatch_build.py b/hatch_build.py index bfdf153..b2226e0 100644 --- a/hatch_build.py +++ b/hatch_build.py @@ -22,6 +22,6 @@ class CustomHook(BuildHookInterface): def initialize(self, version, build_data): """Initialize the hook.""" - if self.target_name not in ["wheel", "sdist"]: + if self.target_name not in ["sdist"]: return build_nbextension() \ No newline at end of file From f37e3e04fafedaf91c1b1f1dec360fe9516eda0f Mon Sep 17 00:00:00 2001 From: yacchin1205 <968739+yacchin1205@users.noreply.github.com> Date: Tue, 12 Nov 2024 10:20:17 +0900 Subject: [PATCH 3/3] Fix build scripts --- .github/workflows/build.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b9fb255..50e2a42 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -17,13 +17,21 @@ jobs: uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1 - name: Install dependencies - run: python -m pip install -U 'jupyterlab>=4.0.0,<5' + run: python -m pip install -U 'jupyterlab>=4.0.0,<5' && python -m pip install -U 'notebook>=7,<8' - name: Build the extension run: | set -eux jlpm jlpm run eslint:check + cd ./components + npm install + npm run build + cd .. + cd ./nbextension + npm install + npm run build + cd .. python -m pip install . jupyter labextension list 2>&1 | grep -ie "lc_notebook_diff.*OK"