Skip to content

Commit

Permalink
More CI fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
fcollonval committed Aug 20, 2023
1 parent cff86d9 commit 121880b
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 13 deletions.
10 changes: 7 additions & 3 deletions .github/workflows/check-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,14 @@ jobs:

- name: Create the extension
id: create-extension
env:
COPIER_SKIP_INSTALL_TASK: '1'
run: |
set -eux
tmpfolder=$(mktemp -d)
echo "extension_folder=${tmpfolder}" >> "$GITHUB_OUTPUT"
python -m copier copy -l -d author_name="My Name" -d repository="https://github.com/test/lab-extension" -d venv="none" --vcs-ref HEAD --UNSAFE . $tmpfolder
cat $tmpfolder/pyproject.toml
python -m copier copy -l -d author_name="My Name" -d repository="https://github.com/test/lab-extension" -d venv="none" --vcs-ref HEAD --UNSAFE . ${tmpfolder}
cat ${tmpfolder}/pyproject.toml
- name: Test the extension
working-directory: ${{ steps.create-extension.outputs.extension_folder }}
Expand Down Expand Up @@ -95,11 +97,13 @@ jobs:

- name: Create the extension
id: create-extension
env:
COPIER_SKIP_INSTALL_TASK: '1'
run: |
set -eux
tmpfolder=$(mktemp -d)
python -m copier copy -l -d kind=mimerenderer -d viewer_name="My Viewer" -d mimetype="application/vnd.my_org.my_type" -d mimetype_name="my_type" -d file_extension=".my_type" -d author_name="My Name" -d repository="https://github.com/test/lab-extension" -d venv="none" --vcs-ref HEAD --UNSAFE . myextension
echo "extension_folder=${tmpfolder}" >> "$GITHUB_OUTPUT"
python -m copier copy -l -d kind=mimerenderer -d viewer_name="My Viewer" -d mimetype="application/vnd.my_org.my_type" -d mimetype_name="my_type" -d file_extension=".my_type" -d author_name="My Name" -d repository="https://github.com/test/lab-extension" -d venv="none" --vcs-ref HEAD --UNSAFE . ${tmpfolder}
- name: Install the extension
working-directory: ${{ steps.create-extension.outputs.extension_folder }}
Expand Down
28 changes: 18 additions & 10 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -174,10 +174,12 @@ jobs:
git config --global user.email "github-actions[bot]@users.noreply.github.com"
- name: Create server extension pip install
id: create-extension-1
env:
COPIER_SKIP_INSTALL_TASK: '1'
run: |
tmpfolder=$(mktemp -d)
echo "extension_folder=${tmpfolder}" >> "$GITHUB_OUTPUT"
python -m copier copy -l -d kind=server -d author_name="My Name" -d repository="https://github.com/test/lab-extension" -d venv="none" --vcs-ref HEAD --UNSAFE . $tmpfolder
cd $tmpfolder
Expand All @@ -197,15 +199,17 @@ jobs:
python -m jupyterlab.browser_check
pip uninstall -y myextension jupyterlab
rm -rf $tmpfolder
rm -rf "${{ steps.create-extension-1.outputs.extension_folder }}"
shell: bash

- name: Create server extension pip develop
id: create-extension-2
run: |
tmpfolder=$(mktemp -d)
echo "extension_folder=${tmpfolder}" >> "$GITHUB_OUTPUT"
YARN_ENABLE_IMMUTABLE_INSTALLS=false python -m copier copy -l -d kind=server -d author_name="My Name" -d repository="https://github.com/test/lab-extension" -d venv="none" --vcs-ref HEAD --UNSAFE . $tmpfolder
cd $tmpfolder
cd ${tmpfolder}
# Check unit tests are passing
python -m pytest -vv -r ap --cov myextension
Expand All @@ -230,27 +234,29 @@ jobs:

- name: Build server extension in develop mode
run: |
jupyter labextension build $tmpfolder
jupyter labextension build "${{ steps.create-extension-2.outputs.extension_folder }}"
jupyter labextension uninstall myextension
python -m pip uninstall -y myextension jupyterlab
- run: |
set -eux
rm -rf $tmpfolder
rm -rf "${{ steps.create-extension-2.outputs.extension_folder }}"
shell: bash
- name: Install server extension from a tarball
id: create-extension-3
env:
COPIER_SKIP_INSTALL_TASK: '1'
run: |
tmpfolder=$(mktemp -d)
echo "extension_folder=${tmpfolder}" >> "$GITHUB_OUTPUT"
python -m copier copy -l -d kind=server -d author_name="My Name" -d repository="https://github.com/test/lab-extension" -d venv="none" --vcs-ref HEAD --UNSAFE . $tmpfolder
cd $tmpfolder
cd ${tmpfolder}
python -m pip install "jupyterlab>=4.0.0,<5"
jupyter lab clean --all
YARN_ENABLE_IMMUTABLE_INSTALLS=false python -m build $tmpfolder
YARN_ENABLE_IMMUTABLE_INSTALLS=false python -m build ${tmpfolder}
cd dist
python -m pip install myextension-0.1.0.tar.gz
Expand All @@ -266,10 +272,10 @@ jobs:
python -m jupyterlab.browser_check
cp $tmpfolder/dist/*.tar.gz myextension.tar.gz
cp $tmpfolder/dist/*.whl myextension.whl
cp "${{ steps.create-extension-3.outputs.extension_folder }}"/dist/*.tar.gz myextension.tar.gz
cp "${{ steps.create-extension-3.outputs.extension_folder }}"/dist/*.whl myextension.whl
python -m pip uninstall -y myextension jupyterlab
rm -rf $tmpfolder
rm -rf "${{ steps.create-extension-3.outputs.extension_folder }}"
shell: bash

- uses: actions/upload-artifact@v2
Expand Down Expand Up @@ -427,9 +433,11 @@ jobs:
git config --global user.email "github-actions[bot]@users.noreply.github.com"
- name: Create server extension with conda
id: create-extension
shell: bash -el {0}
run: |
tmpfolder=$(mktemp -d)
echo "extension_folder=${tmpfolder}" >> "$GITHUB_OUTPUT"
YARN_ENABLE_IMMUTABLE_INSTALLS=false python -m copier copy -l -d kind=server -d author_name="My Name" -d repository="https://github.com/test/lab-extension" --vcs-ref HEAD --UNSAFE . $tmpfolder
Expand All @@ -448,7 +456,7 @@ jobs:
python -m jupyterlab.browser_check
pip uninstall -y myextension jupyterlab
rm -rf $tmpfolder
rm -rf "${{ steps.create-extension.outputs.extension_folder }}"
pnpm_linker:
runs-on: ubuntu-latest
Expand Down

0 comments on commit 121880b

Please sign in to comment.