Repository navigation
56 lines (56 loc) · 2.23 KB
/
Copy pathprecompiled-javascript.yml
File metadata and controls
56 lines (56 loc) · 2.23 KB
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
name: Precompiled JavaScript contracts
on:
pull_request:
paths:
- 'experiments/WebScene.NativeEngine.Probe/**'
- 'src/WebScene.Sdk/**'
- 'scripts/prepare_runner_disk.py'
- 'scripts/tests/test_prepare_runner_disk.py'
- '.github/workflows/precompiled-javascript.yml'
workflow_dispatch:
permissions:
contents: read
jobs:
portable-v8-contract:
runs-on: [self-hosted, Linux, X64]
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
- name: Reclaim stale runner temporary data
shell: bash
run: |
python3 scripts/prepare_runner_disk.py "$RUNNER_TEMP" --system-temp /tmp --minimum-free-bytes 6442450944
job_tmp="$RUNNER_TEMP/webscene-job-${GITHUB_RUN_ID}-${GITHUB_RUN_ATTEMPT}-${GITHUB_JOB//[^A-Za-z0-9_.-]/_}"
mkdir -p "$job_tmp"
echo "TMPDIR=$job_tmp" >> "$GITHUB_ENV"
echo "WEBSCENE_JOB_TMP=$job_tmp" >> "$GITHUB_ENV"
- uses: actions/setup-node@v4
with:
node-version: '22.16.0'
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install native adapter prerequisites
run: |
sudo flock /var/lock/webscene-apt.lock bash -c '
apt-get clean
apt-get update
apt-get install -y build-essential libssl-dev cmake ninja-build
'
- name: Build test adapter against real V8 (not the production SDK)
working-directory: experiments/WebScene.NativeEngine.Probe
run: |
NODE_ROOT="$(dirname "$(dirname "$(command -v node)")")"
c++ -std=c++20 -shared -fPIC -I"$NODE_ROOT/include/node" -Inative \
tests/precompiled/node_adapter.cpp -lcrypto -o tests/precompiled/adapter.node
- name: Execute cold-process V8 contracts
run: node experiments/WebScene.NativeEngine.Probe/tests/precompiled/test_v8.cjs
- name: Build driver and CMake contracts
run: python -m unittest discover -s experiments/WebScene.NativeEngine.Probe/tests/precompiled -p 'test_*.py' -v
- name: Release job temporary data
if: always()
shell: bash
run: |
if [[ -n "${WEBSCENE_JOB_TMP:-}" ]]; then
rm -rf -- "$WEBSCENE_JOB_TMP"
fi