Skip to content

Commit 13a7708

Browse files
authored
Add smoke test for production build (#12965)
Currently we don't seem to have any automated test that verifies whether the production build works as expected. For a recent issue and its root cause, which remained unrevealed by the CI, see #12962 Contributed on behalf of STMicroelectronics
1 parent 7ad7f22 commit 13a7708

File tree

2 files changed

+54
-0
lines changed

2 files changed

+54
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: Production Build Smoke Test
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
workflow_dispatch:
8+
pull_request:
9+
branches:
10+
- master
11+
12+
jobs:
13+
build-and-test-playwright:
14+
name: Smoke Test for Browser Example Production Build on ubuntu-latest with Node.js 18.x
15+
16+
runs-on: ubuntu-latest
17+
timeout-minutes: 60
18+
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@v3
22+
23+
- name: Use Node.js "18.x"
24+
uses: actions/setup-node@v3
25+
with:
26+
node-version: "18.x"
27+
registry-url: "https://registry.npmjs.org"
28+
29+
- name: Use Python 3.11
30+
uses: actions/setup-python@v4
31+
with:
32+
python-version: "3.11"
33+
34+
- name: Build Browser Example Application for Production
35+
shell: bash
36+
run: |
37+
yarn global add node-gyp
38+
yarn --skip-integrity-check --network-timeout 100000
39+
yarn browser build:production
40+
env:
41+
NODE_OPTIONS: --max_old_space_size=4096
42+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # https://github.com/microsoft/vscode-ripgrep/issues/9
43+
44+
- name: Build Playwright
45+
shell: bash
46+
run: |
47+
yarn --cwd examples/playwright build
48+
49+
- name: Run Smoke Test (examples/playwright/src/tests/theia-app)
50+
uses: GabrielBB/xvfb-action@v1
51+
with:
52+
run: yarn test:playwright theia-app

examples/browser/package.json

+2
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,9 @@
6464
"scripts": {
6565
"clean": "theia clean",
6666
"build": "yarn -s compile && yarn -s bundle",
67+
"build:production": "yarn -s compile && yarn -s bundle:production",
6768
"bundle": "yarn rebuild && theia build --mode development",
69+
"bundle:production": "yarn rebuild && theia build --mode production",
6870
"compile": "tsc -b",
6971
"coverage": "yarn -s test --test-coverage && yarn -s coverage:report",
7072
"coverage:clean": "rimraf .nyc_output && rimraf coverage",

0 commit comments

Comments
 (0)