Skip to content

Commit cd97386

Browse files
authored
Bump NodeJS to v20 in web demo (#13)
* Update CI workflow * Update checkout action from v2 to v4 * Reformat CI file * Update step descriptions * Create .node-version file * Bump dependencies and fix dependency resolution * Bumps preact, react-ace, other dependencies * Fix GL resolution to v6 * Update lint script * Fix build, dev scripts error A more long-term fix will be made in the future. * Add lint check to CI workflow
1 parent b2fdead commit cd97386

File tree

4 files changed

+2961
-751
lines changed

4 files changed

+2961
-751
lines changed

.github/workflows/ci.yml

Lines changed: 54 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@ name: CI
22

33
on:
44
push:
5-
branches: [ master ]
5+
branches:
6+
- master
67
pull_request:
7-
branches: [ master ]
8+
branches:
9+
- master
810

911
jobs:
1012
build:
@@ -20,32 +22,56 @@ jobs:
2022
- -DCMAKE_BUILD_TYPE=Release
2123
- -DCMAKE_BUILD_TYPE=Release -DSINTER_TEST_SHORT_DOUBLE=1
2224
steps:
23-
- uses: actions/checkout@v2
24-
- name: install cpp-coveralls
25-
run: pip install --user cpp-coveralls
26-
if: github.event_name != 'pull_request' && contains(matrix.cmake-args, 'coverage')
27-
- name: mkdir
28-
run: mkdir build
29-
- name: cmake
30-
working-directory: build
31-
run: cmake .. ${{ matrix.cmake-args }}
32-
- name: make
33-
working-directory: build
34-
run: make -j4
35-
- name: test
36-
working-directory: build
37-
run: make CTEST_PARALLEL_LEVEL=$(nproc) CTEST_OUTPUT_ON_FAILURE=1 test
38-
- name: coverage
39-
working-directory: build
40-
env:
41-
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
42-
TRAVIS_JOB_ID: ${{ github.run_id }}
43-
run: ~/.local/bin/cpp-coveralls -r .. --include vm --include runner --gcov-options '\-lp' -y ../.coveralls.yml
44-
if: github.event_name != 'pull_request' && contains(matrix.cmake-args, 'coverage')
25+
- name: Checkout repository
26+
uses: actions/checkout@v4
27+
- name: install cpp-coveralls
28+
run: pip install --user cpp-coveralls
29+
if: github.event_name != 'pull_request' && contains(matrix.cmake-args, 'coverage')
30+
- name: mkdir
31+
run: mkdir build
32+
- name: cmake
33+
working-directory: build
34+
run: cmake .. ${{ matrix.cmake-args }}
35+
- name: make
36+
working-directory: build
37+
run: make -j4
38+
- name: Run tests
39+
working-directory: build
40+
run: make CTEST_PARALLEL_LEVEL=$(nproc) CTEST_OUTPUT_ON_FAILURE=1 test
41+
- name: Check coverage
42+
working-directory: build
43+
env:
44+
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
45+
TRAVIS_JOB_ID: ${{ github.run_id }}
46+
run: ~/.local/bin/cpp-coveralls -r .. --include vm --include runner --gcov-options '\-lp' -y ../.coveralls.yml
47+
if: github.event_name != 'pull_request' && contains(matrix.cmake-args, 'coverage')
4548
check-headers:
4649
runs-on: ubuntu-latest
4750
steps:
48-
- uses: actions/checkout@v2
49-
- name: check if headers work in C++
50-
working-directory: vm/include
51-
run: g++ -std=c++11 -fsyntax-only sinter/*.h sinter.h -I. -Wall -Wextra -pedantic
51+
- name: Checkout repository
52+
uses: actions/checkout@v4
53+
- name: Check if headers work in C++
54+
working-directory: vm/include
55+
run: g++ -std=c++11 -fsyntax-only sinter/*.h sinter.h -I. -Wall -Wextra -pedantic
56+
web-demo:
57+
runs-on: ubuntu-latest
58+
steps:
59+
- name: Checkout repository
60+
uses: actions/checkout@v4
61+
- name: Install dependencies (apt)
62+
run: |
63+
sudo apt-get update && \
64+
sudo apt-get install -y --no-install-recommends \
65+
libxi-dev libgl1-mesa-dev
66+
- name: Setup Node.js
67+
uses: actions/setup-node@v4
68+
with:
69+
node-version: 20
70+
cache: yarn
71+
cache-dependency-path: ./devices/wasm/web/yarn.lock
72+
- name: Install dependencies
73+
working-directory: devices/wasm/web
74+
run: yarn install --frozen-lockfile
75+
- name: Lint
76+
working-directory: devices/wasm/web
77+
run: yarn lint

.node-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
20.11.0

devices/wasm/web/package.json

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
"version": "0.0.1",
55
"license": "Apache-2.0",
66
"scripts": {
7-
"build": "preact build --no-prerender",
8-
"dev": "preact watch",
9-
"lint": "eslint src"
7+
"build": "cross-env NODE_OPTIONS=--openssl-legacy-provider preact build --no-prerender",
8+
"dev": "cross-env NODE_OPTIONS=--openssl-legacy-provider preact watch",
9+
"lint": "eslint --max-warnings=0 src"
1010
},
1111
"eslintConfig": {
1212
"extends": "preact",
@@ -15,14 +15,19 @@
1515
]
1616
},
1717
"devDependencies": {
18+
"cross-env": "^7.0.3",
1819
"eslint": "^8.0.0",
1920
"eslint-config-preact": "^1.1.4",
21+
"jest": "^29.7.0",
2022
"preact-cli": "=3.3.0"
2123
},
2224
"dependencies": {
2325
"file-saver": "^2.0.5",
2426
"js-slang": "^0.5.19",
2527
"preact": "^10.5.15",
2628
"react-ace": "^9.4.4"
29+
},
30+
"resolutions": {
31+
"**/gl": "^6.0.2"
2732
}
2833
}

0 commit comments

Comments
 (0)