Skip to content

Commit 7f952df

Browse files
Update CI (#62)
* 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
1 parent 1958b48 commit 7f952df

File tree

1 file changed

+56
-50
lines changed

1 file changed

+56
-50
lines changed

.github/workflows/build.yml

Lines changed: 56 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -6,86 +6,89 @@ on:
66
pull_request:
77
branches: '*'
88

9+
defaults:
10+
run:
11+
shell: bash -el {0}
12+
913
jobs:
1014
build:
15+
name: Build and test
1116
runs-on: ubuntu-latest
1217

1318
steps:
1419
- name: Checkout
15-
uses: actions/checkout@v3
16-
17-
- name: Base Setup
18-
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
20+
uses: actions/checkout@v4
1921

20-
- name: Install dependencies
21-
run: |
22-
python -m pip install -U "jupyterlab>=4.0.0,<5"
23-
python -m pip install hatch-jupyter-builder
22+
- name: Set up environment
23+
uses: mamba-org/setup-micromamba@v1
24+
with:
25+
environment-name: urdf
26+
init-shell: bash
27+
create-args: >-
28+
python
29+
python-build
30+
jupyterlab>=4.0
31+
hatch-jupyter-builder
32+
nodejs
2433
2534
- name: Lint the extension
2635
run: |
27-
set -eux
2836
jlpm
2937
jlpm run lint:check
38+
3039
- name: Test the extension
31-
run: |
32-
set -eux
33-
jlpm run test
40+
run: jlpm run test
3441

3542
- name: Build the extension
3643
run: |
37-
set -eux
3844
python -m pip install .[test]
39-
4045
jupyter labextension list
4146
jupyter labextension list 2>&1 | grep -ie "jupyterlab-urdf.*OK"
4247
python -m jupyterlab.browser_check
4348
4449
- name: Package the extension
4550
run: |
46-
set -eux
47-
48-
pip install build
4951
python -m build
5052
pip uninstall -y "jupyterlab_urdf" jupyterlab
5153
5254
- name: Upload extension packages
53-
uses: actions/upload-artifact@v3
55+
uses: actions/upload-artifact@v4
5456
with:
5557
name: extension-artifacts
5658
path: dist/jupyterlab_urdf*
5759
if-no-files-found: error
5860

59-
test_isolated:
61+
test-isolated:
62+
name: Isolated tests
6063
needs: build
6164
runs-on: ubuntu-latest
6265

6366
steps:
6467
- name: Checkout
65-
uses: actions/checkout@v3
66-
- name: Install Python
67-
uses: actions/setup-python@v4
68+
uses: actions/checkout@v4
69+
70+
- name: Set up environment
71+
uses: mamba-org/setup-micromamba@v1
6872
with:
69-
python-version: '3.9'
70-
architecture: 'x64'
71-
- uses: actions/download-artifact@v3
73+
environment-name: urdf-isolated
74+
init-shell: bash
75+
create-args: >-
76+
python
77+
jupyterlab>=4.0
78+
79+
- name: Download extension package
80+
uses: actions/download-artifact@v4
7281
with:
7382
name: extension-artifacts
74-
- name: Install and Test
75-
run: |
76-
set -eux
77-
# Remove NodeJS, twice to take care of system and locally installed node versions.
78-
sudo rm -rf $(which node)
79-
sudo rm -rf $(which node)
80-
81-
pip install "jupyterlab>=4.0.0,<5" jupyterlab_urdf*.whl
82-
8383

84+
- name: Install and test
85+
run: |
86+
pip install jupyterlab_urdf*.whl
8487
jupyter labextension list
8588
jupyter labextension list 2>&1 | grep -ie "jupyterlab-urdf.*OK"
8689
python -m jupyterlab.browser_check --no-browser-test
8790
88-
integration-tests:
91+
test-integration:
8992
name: Integration tests
9093
needs: build
9194
runs-on: ubuntu-latest
@@ -95,20 +98,25 @@ jobs:
9598

9699
steps:
97100
- name: Checkout
98-
uses: actions/checkout@v3
101+
uses: actions/checkout@v4
99102

100-
- name: Base Setup
101-
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
103+
- name: Set up environment
104+
uses: mamba-org/setup-micromamba@v1
105+
with:
106+
environment-name: urdf-integration
107+
init-shell: bash
108+
create-args: >-
109+
python
110+
jupyterlab==4.0.3
102111
103112
- name: Download extension package
104-
uses: actions/download-artifact@v3
113+
uses: actions/download-artifact@v4
105114
with:
106115
name: extension-artifacts
107116

108117
- name: Install the extension
109118
run: |
110-
set -eux
111-
python -m pip install "jupyterlab==4.0.3" jupyterlab_urdf*.whl
119+
pip install jupyterlab_urdf*.whl
112120
jupyter labextension list
113121
114122
- name: Install dependencies
@@ -118,10 +126,9 @@ jobs:
118126
run: jlpm install
119127

120128
- name: Set up browser cache
121-
uses: actions/cache@v3
129+
uses: actions/cache@v4
122130
with:
123-
path: |
124-
${{ github.workspace }}/pw-browsers
131+
path: ${{ github.workspace }}/pw-browsers
125132
key: ${{ runner.os }}-${{ hashFiles('ui-tests/yarn.lock') }}
126133

127134
- name: Install browser
@@ -130,23 +137,22 @@ jobs:
130137

131138
- name: Execute integration tests
132139
working-directory: ui-tests
133-
run: |
134-
jlpm playwright test
140+
run: jlpm playwright test
135141

136-
- name: Upload Playwright Test report
142+
- name: Upload playwright test report
137143
if: always()
138-
uses: actions/upload-artifact@v3
144+
uses: actions/upload-artifact@v4
139145
with:
140146
name: jupyterlab_urdf-playwright-tests
141147
path: |
142148
ui-tests/test-results
143149
ui-tests/playwright-report
144150
145151
check_links:
146-
name: Check Links
152+
name: Check links
147153
runs-on: ubuntu-latest
148154
timeout-minutes: 15
149155
steps:
150-
- uses: actions/checkout@v3
156+
- uses: actions/checkout@v4
151157
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
152158
- uses: jupyterlab/maintainer-tools/.github/actions/check-links@v1

0 commit comments

Comments
 (0)