-
-
Notifications
You must be signed in to change notification settings - Fork 127
155 lines (131 loc) · 4.33 KB
/
tests.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
name: Tests
on:
push:
branches: [main]
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
env:
# Use environment variable to tell Playwright where to install browser binaries so they can be cached for future workflow runs
PLAYWRIGHT_BROWSERS_PATH: ${{ github.workspace }}/pw-browsers
jobs:
test:
name: JS
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
browser: [chromium, firefox, webkit]
exclude:
# Playwright webkit binary is not compatible with ubuntu
- os: ubuntu-latest
browser: webkit
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
- name: Set up browser cache
uses: actions/cache@v4
with:
path: |
${{ github.workspace }}/pw-browsers
key: ${{ matrix.os }}-${{ matrix.browser }}-${{ hashFiles('./yarn.lock') }}
- name: Install dependencies
shell: bash
run: |
set -eux
yarn
- name: Build Source
shell: bash
run: |
set -eux
yarn build
yarn playwright install ${{ matrix.browser }}
- name: Run Tests
run: |
yarn run test:${{ matrix.browser }}
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
- name: Set up browser cache
uses: actions/cache@v4
with:
path: |
${{ github.workspace }}/pw-browsers
key: ubuntu-latest-chromium-${{ hashFiles('./yarn.lock') }}
- name: Install dependencies
shell: bash
run: |
set -eux
yarn
- name: Check linters
shell: bash
run: |
set -eux
yarn lint:check
- name: Build Source
shell: bash
run: |
set -eux
yarn build
yarn build:test
- name: Test Examples
shell: bash
run: |
set -eux
yarn minimize
yarn build:examples
# Install playwright for example tests
npx playwright install chromium
yarn test:examples
- name: Build Docs
run: |
set -eux
yarn clean
yarn build:src
yarn docs
- name: Publish with Verdaccio
run: |
set -eux
npm install -g verdaccio
verdaccio --config .github/scripts/verdaccio.yml &
npm set registry http://localhost:4873/
yarn config set npmRegistryServer http://localhost:4873/
yarn config set unsafeHttpWhitelist --json '["localhost"]'
git config --global user.email "[email protected]"
git config --global user.name "Your Name"
yarn run update:versions patch --yes
git commit -a -m "Update versions"
yarn run publish
yarn config unset npmRegistryServer
yarn config unset unsafeHttpWhitelist
check_links:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
- uses: jupyterlab/maintainer-tools/.github/actions/check-links@v1
with:
ignore_links: "./api/index.html examples/accordionpanel/index.html examples/datagrid/index.html examples/dockpanel/index.html examples/menubar/index.html https://mybinder.org/v2/gh/jupyterlab/lumino/.*"
check_release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Bump artificially the top version
shell: python
run: |
import json
from datetime import datetime
with open("package.json") as f:
data = json.load(f)
data["version"] = datetime.now().strftime("%Y.%m.%d")
data["jupyter-releaser"] = { "options": { "version-cmd": "npm run update:versions -- --yes" } }
with open("package.json", "w") as f:
data = json.dump(data, f)
- name: Check Release
uses: jupyter-server/jupyter_releaser/.github/actions/check-release@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}