Skip to content

Commit

Permalink
Update CI (#62)
Browse files Browse the repository at this point in the history
* Update actions checkout

* Set up environment

* Check env

* Declare shell

* Set default run shell

* Install build with env

* Update artifacts action

* Update isolate test

* Clean isolation tests

* Set up env for integration tests

* Update integration tests
  • Loading branch information
IsabelParedes authored Jul 1, 2024
1 parent 1958b48 commit 7f952df
Showing 1 changed file with 56 additions and 50 deletions.
106 changes: 56 additions & 50 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,86 +6,89 @@ on:
pull_request:
branches: '*'

defaults:
run:
shell: bash -el {0}

jobs:
build:
name: Build and test
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Base Setup
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
uses: actions/checkout@v4

- name: Install dependencies
run: |
python -m pip install -U "jupyterlab>=4.0.0,<5"
python -m pip install hatch-jupyter-builder
- name: Set up environment
uses: mamba-org/setup-micromamba@v1
with:
environment-name: urdf
init-shell: bash
create-args: >-
python
python-build
jupyterlab>=4.0
hatch-jupyter-builder
nodejs
- name: Lint the extension
run: |
set -eux
jlpm
jlpm run lint:check
- name: Test the extension
run: |
set -eux
jlpm run test
run: jlpm run test

- name: Build the extension
run: |
set -eux
python -m pip install .[test]
jupyter labextension list
jupyter labextension list 2>&1 | grep -ie "jupyterlab-urdf.*OK"
python -m jupyterlab.browser_check
- name: Package the extension
run: |
set -eux
pip install build
python -m build
pip uninstall -y "jupyterlab_urdf" jupyterlab
- name: Upload extension packages
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: extension-artifacts
path: dist/jupyterlab_urdf*
if-no-files-found: error

test_isolated:
test-isolated:
name: Isolated tests
needs: build
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install Python
uses: actions/setup-python@v4
uses: actions/checkout@v4

- name: Set up environment
uses: mamba-org/setup-micromamba@v1
with:
python-version: '3.9'
architecture: 'x64'
- uses: actions/download-artifact@v3
environment-name: urdf-isolated
init-shell: bash
create-args: >-
python
jupyterlab>=4.0
- name: Download extension package
uses: actions/download-artifact@v4
with:
name: extension-artifacts
- name: Install and Test
run: |
set -eux
# Remove NodeJS, twice to take care of system and locally installed node versions.
sudo rm -rf $(which node)
sudo rm -rf $(which node)
pip install "jupyterlab>=4.0.0,<5" jupyterlab_urdf*.whl

- name: Install and test
run: |
pip install jupyterlab_urdf*.whl
jupyter labextension list
jupyter labextension list 2>&1 | grep -ie "jupyterlab-urdf.*OK"
python -m jupyterlab.browser_check --no-browser-test
integration-tests:
test-integration:
name: Integration tests
needs: build
runs-on: ubuntu-latest
Expand All @@ -95,20 +98,25 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Base Setup
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
- name: Set up environment
uses: mamba-org/setup-micromamba@v1
with:
environment-name: urdf-integration
init-shell: bash
create-args: >-
python
jupyterlab==4.0.3
- name: Download extension package
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: extension-artifacts

- name: Install the extension
run: |
set -eux
python -m pip install "jupyterlab==4.0.3" jupyterlab_urdf*.whl
pip install jupyterlab_urdf*.whl
jupyter labextension list
- name: Install dependencies
Expand All @@ -118,10 +126,9 @@ jobs:
run: jlpm install

- name: Set up browser cache
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: |
${{ github.workspace }}/pw-browsers
path: ${{ github.workspace }}/pw-browsers
key: ${{ runner.os }}-${{ hashFiles('ui-tests/yarn.lock') }}

- name: Install browser
Expand All @@ -130,23 +137,22 @@ jobs:

- name: Execute integration tests
working-directory: ui-tests
run: |
jlpm playwright test
run: jlpm playwright test

- name: Upload Playwright Test report
- name: Upload playwright test report
if: always()
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: jupyterlab_urdf-playwright-tests
path: |
ui-tests/test-results
ui-tests/playwright-report
check_links:
name: Check Links
name: Check links
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
- uses: jupyterlab/maintainer-tools/.github/actions/check-links@v1

0 comments on commit 7f952df

Please sign in to comment.