Skip to content

Commit

Permalink
add infra to support multiple v8 versions (#108)
Browse files Browse the repository at this point in the history
* fix compile issue for v8 version 7.4~13.0
  • Loading branch information
LanderlYoung authored Sep 23, 2024
1 parent 12096d4 commit 4532e91
Show file tree
Hide file tree
Showing 18 changed files with 385 additions and 188 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ jobs:
matrix:
backends: [ V8, JavaScriptCore, QuickJs, Lua ]
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2
- uses: actions/checkout@v4.1.7
- uses: actions/cache@v4.0.2
with:
key: ScriptX-UnitTests-Depedencies-${{ hashFiles('test/cmake/**') }}
path: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/sync_to_tencent_code.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
timeout-minutes: 30
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4.1.7
with:
fetch-depth: 0
- name: mirror-repository
Expand Down
53 changes: 38 additions & 15 deletions .github/workflows/unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ jobs:
# mac runner seems to be slow and rear
# - Release
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2
- uses: actions/checkout@v4.1.7
- uses: actions/cache@v4.0.2
with:
key: ScriptX-UnitTests-Depedencies-${{ hashFiles('test/cmake/**') }}
path: |
Expand Down Expand Up @@ -61,15 +61,15 @@ jobs:
- Debug
- Release
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2
- uses: actions/checkout@v4.1.7
- uses: actions/cache@v4.0.2
with:
key: ScriptX-UnitTests-Depedencies-${{ hashFiles('test/cmake/**') }}
path: |
build/ScriptXTestLibs
build/googletest-src
- name: Add MSBuild to PATH
uses: microsoft/setup-msbuild@v1.0.2
uses: microsoft/setup-msbuild@v2
- name: Configure cmake X64
if: matrix.backends != 'JavaScriptCore'
shell: powershell
Expand Down Expand Up @@ -112,8 +112,8 @@ jobs:
- Debug
- Release
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2
- uses: actions/checkout@v4.1.7
- uses: actions/cache@v4.0.2
with:
key: ScriptX-UnitTests-Depedencies-${{ hashFiles('test/cmake/**') }}
path: |
Expand All @@ -138,6 +138,29 @@ jobs:
cd build
./UnitTests
ubuntu-v8-versions-build:
timeout-minutes: 60
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
# format index{0 .. index-1}/concurrency
job_split: [ 0/8, 1/8, 2/8, 3/8, 4/8, 5/8, 6/8, 7/8 ]
steps:
- uses: actions/[email protected]
- uses: actions/[email protected]
with:
key: ScriptX-UnitTests-Depedencies-${{ hashFiles('test/cmake/**') }}
path: |
build/ScriptXTestLibs
- name: Test build v8 on supported versions
env:
SCRIPTX_TEST_FORCE_UPDATE_DEPS: ON
SCRIPTX_TEST_V8_JOB_SPLIT_CONFIG: ${{ matrix.job_split }}
run: |
mkdir -p build && cd build
../test/cmake/test_v8_compiles.sh continue
android-clang-build:
# disable for now
# 1. we don't have android libraries
Expand All @@ -153,8 +176,8 @@ jobs:
- Debug
- Release
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2
- uses: actions/checkout@v4.1.7
- uses: actions/cache@v4.0.2
with:
key: ScriptX-UnitTests-Depedencies-${{ hashFiles('test/cmake/**') }}
path: |
Expand Down Expand Up @@ -185,9 +208,9 @@ jobs:
matrix:
node-version: [ 14.x, 15.x, 16.x, 18.x ] # 19.x
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4.1.7
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
uses: actions/setup-node@v4.0.4
with:
node-version: ${{ matrix.node-version }}
- name: Prepare npm
Expand All @@ -209,20 +232,20 @@ jobs:
matrix:
emscripten-version: [ '3.0.0', '3.1.33' ]
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2
- uses: actions/checkout@v4.1.7
- uses: actions/cache@v4.0.2
with:
key: ScriptX-UnitTests-Depedencies-${{ hashFiles('test/cmake/**') }}
path: |
build/ScriptXTestLibs
build/googletest-src
- name: Setup Emscripten
uses: mymindstorm/setup-emsdk@v11
uses: mymindstorm/setup-emsdk@v14
with:
version: ${{ matrix.emscripten-version }}
actions-cache-folder: emsdk-cache-${{ matrix.emscripten-version }}
- name: Setup Node.js
uses: actions/setup-node@v1
uses: actions/setup-node@v4.0.4
with:
node-version: '19.3.0' # insteadof '>= 14', use fixed version
- name: Configure Webassembly backend
Expand Down
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
Version 3.6.0 (2024-09):
1. `[V8]` add test infrastructure to test on multiple v8 versions
2. `[V8]` add support to v8 versions through 7.4~13.0

Version 3.5.0 (2023-05):
1. `[QuickJs]` add support for QuickJs 2024-01-13

Expand Down Expand Up @@ -83,4 +87,4 @@ A Template backend which has no implementation.

---
Version 0.0 (2019-10):
Project started.
Project started.
3 changes: 2 additions & 1 deletion README-zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ ScriptX的术语中,"前端"指对外的C++ API,"后端"则指不同的底

| 后端 | 语言 | 版本 | 状态 |
| :----: | :----: | :----: | :----: |
| V8 | JavaScript | 7.4+ | done |
| V8 | JavaScript | 7.4+<br>([tested versions][tested_v8_versions]) | done |
| JavaScriptCore | JavaScript | 7604.1.38.0.7+<br>(iOS 10+/macOS10.12+) | done |
| Node.js | JavaScript | 14.x+ | done |
| QuickJs | JavaScript | 2024-01-13 | done |
Expand All @@ -30,6 +30,7 @@ ScriptX的术语中,"前端"指对外的C++ API,"后端"则指不同的底
| YARV | Ruby | | todo |
| Mono | C# | | todo |

[tested_v8_versions]: https://github.com/LanderlYoung/ScriptXTestLibs/blob/main/v8/supported_versions.txt

# 简介

Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ In ScriptX terminology, "front-end" refers to the external C++ API, and "back-en

| backend | language | version | states |
| :----: | :----: | :----: | :----: |
| V8 | JavaScript | 7.4+ | done |
| V8 | JavaScript | 7.4+<br>([tested versions][tested_v8_versions]) | done |
| JavaScriptCore | JavaScript | 7604.1.38.0.7+<br>(iOS 10+/macOS10.12+) | done |
| Node.js | JavaScript | 14.x+ | done |
| QuickJs | JavaScript | 2024-01-13 | done |
Expand All @@ -29,6 +29,8 @@ In ScriptX terminology, "front-end" refers to the external C++ API, and "back-en
| YARV | Ruby | | todo |
| Mono | C# | | todo |

[tested_v8_versions]: https://github.com/LanderlYoung/ScriptXTestLibs/blob/main/v8/supported_versions.txt

# Introduction

The interface of ScriptX uses modern C++ features. And to be 100% in line with the C++ standard, completely cross-platform.
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.5.0
3.6.0
Loading

0 comments on commit 4532e91

Please sign in to comment.