Skip to content

Commit 58c9097

Browse files
authored
chore: Test website build in CI (#9643)
1 parent f9ca91b commit 58c9097

File tree

6 files changed

+52
-3
lines changed

6 files changed

+52
-3
lines changed

.github/workflows/test.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,28 @@ jobs:
3838
uses: coverallsapp/github-action@648a8eb78e6d50909eff900e4ec85cab4524a45b # v2.3.6
3939
with:
4040
github-token: ${{ secrets.GITHUB_TOKEN }}
41+
42+
test-website:
43+
runs-on: ubuntu-22.04
44+
permissions:
45+
checks: write
46+
contents: read
47+
48+
steps:
49+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
50+
- uses: volta-cli/action@5c175f92dea6f48441c436471e6479dbc192e194 # v4.2.1
51+
with:
52+
cache: 'yarn'
53+
54+
- name: Install dependencies
55+
run: yarn bootstrap
56+
57+
- name: Build packages
58+
run: yarn build
59+
60+
- name: Test website build
61+
run: |
62+
yarn test-website
4163
4264
test-python:
4365
runs-on: ubuntu-latest

docs/api-reference/widgets/compass-widget.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ Learn more about how to replace icons in the [styling guide](/docs/api-reference
4747
| Name | Type | Default |
4848
| ---------------- | ------------------------ | ---------------------------------------------- |
4949
| `--icon-compass` | [SVG Data Url][data_url] | Custom Icon |
50-
| `--icon-compass-north-color` | [Color](color_url) | `rgb(240, 92, 68)` |
51-
| `--icon-compass-south-color` | [Color](color_url) | `rgb(204, 204, 204)` |
50+
| `--icon-compass-north-color` | [Color][color_url] | `rgb(240, 92, 68)` |
51+
| `--icon-compass-south-color` | [Color][color_url] | `rgb(204, 204, 204)` |
5252

5353
[data_url]: https://developer.mozilla.org/en-US/docs/Web/CSS/url#using_a_data_url
5454
[color_url]: https://developer.mozilla.org/en-US/docs/Web/CSS/color_value

docs/api-reference/widgets/theme-widget.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import BrowserOnly from '@docusaurus/BrowserOnly';
12
import {WidgetPreview} from '@site/src/doc-demos/widgets';
23
import {_ThemeWidget} from '@deck.gl/widgets';
34

@@ -12,7 +13,7 @@ This widget changes the theme of deck.gl between light mode and dark mode. Click
1213
- The `ThemeWidget` is mainly intended for minimal applications and to help developers test theme changes. More advanced applications that already support theming in their non-Deck UI will likely want to control change of deck themes using the same mechanism that is used for the remainder of their UI.
1314
:::
1415

15-
<WidgetPreview cls={_ThemeWidget}/>
16+
<BrowserOnly>{() => <WidgetPreview cls={_ThemeWidget}/>}</BrowserOnly>
1617

1718
```ts
1819
import {_ThemeWidget as ThemeWidget} from '@deck.gl/widgets';

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
"start": "open https://deck.gl/docs/get-started/getting-started",
2929
"test": "ocular-test",
3030
"test-fast": "ocular-lint && ocular-test node",
31+
"test-website": "cd website && yarn && yarn test-build && cd ..",
3132
"metrics": "ocular-metrics",
3233
"link-luma": "yarn && (cd node_modules && mv luma.gl luma.orig && ln -s ../../luma.gl/modules/core)",
3334
"unlink-luma": "(cd node_modules && mv luma.gl luma.ln && mv luma.orig luma.gl)",

website/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
"start": "docusaurus start",
99
"build": "./scripts/build.sh prod",
1010
"build-staging": "./scripts/build.sh staging",
11+
"test-build": "./scripts/test-build.sh",
1112
"swizzle": "docusaurus swizzle",
1213
"clear": "docusaurus clear",
1314
"serve": "docusaurus serve",

website/scripts/test-build.sh

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/bin/bash
2+
set -e
3+
4+
# Set dummy environment variables for build
5+
export GoogleMapsAPIKey="dummy-google-maps-api-key"
6+
export GoogleMapsMapId="dummy-google-maps-map-id"
7+
export MapboxAccessToken="dummy-mapbox-access-token"
8+
9+
# rebuild modules from source
10+
(
11+
cd ..
12+
yarn build
13+
)
14+
15+
# clean up cache
16+
docusaurus clear
17+
docusaurus build
18+
19+
# build gallery (scripting) examples
20+
(
21+
cd ../examples/gallery
22+
yarn
23+
yarn build
24+
)

0 commit comments

Comments
 (0)