Skip to content

[ php-wasm ] Add test-unit-jspi in CI workflow #2285

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 13 commits into from
Jul 4, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
96 changes: 48 additions & 48 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,38 +30,22 @@ jobs:
fail-fast: false
matrix:
include:
- name: test-unit-asyncify (1/16)
- name: test-unit-asyncify (1/8)
target: test
- name: test-unit-asyncify (2/16)
target: test-php
- name: test-unit-asyncify (3/16)
target: test-php-networking
- name: test-unit-asyncify (4/16)
target: test-php-request-handler-files
- name: test-unit-asyncify (5/16)
target: test-php-request-handler-requests
- name: test-unit-asyncify (6/16)
target: test-php-asyncify-file-get-contents-http
- name: test-unit-asyncify (7/16)
target: test-php-asyncify-file-get-contents-https
- name: test-unit-asyncify (8/16)
target: test-php-asyncify-fopen-http
- name: test-unit-asyncify (9/16)
target: test-php-asyncify-fopen-https
- name: test-unit-asyncify (10/16)
target: test-php-asyncify-fsockopen-http
- name: test-unit-asyncify (11/16)
target: test-php-asyncify-fsockopen-https
- name: test-unit-asyncify (12/16)
target: test-php-asyncify-gethostbyname-http
- name: test-unit-asyncify (13/16)
target: test-php-asyncify-gethostbyname-https
- name: test-unit-asyncify (14/16)
target: test-php-asyncify-mysqli-http
- name: test-unit-asyncify (15/16)
target: test-php-asyncify-mysqli-https
- name: test-unit-asyncify (16/16)
target: test-php-asyncify-sqlite3
- name: test-unit-asyncify (2/8)
target: test-asyncify
- name: test-unit-asyncify (3/8)
target: test-php-file-get-contents-asyncify
- name: test-unit-asyncify (4/8)
target: test-php-fopen-asyncify
- name: test-unit-asyncify (5/8)
target: test-php-fsockopen-asyncify
- name: test-unit-asyncify (6/8)
target: test-php-gethostbyname-asyncify
- name: test-unit-asyncify (7/8)
target: test-php-mysqli-asyncify
- name: test-unit-asyncify (8/8)
target: test-php-sqlite3-asyncify
name: ${{ matrix.name }}
services:
mysql:
Expand Down Expand Up @@ -97,9 +81,36 @@ jobs:
fail-fast: false
matrix:
include:
- name: test-unit-jspi (1/1)
target: test-php-dynamic-loading-jspi
- name: test-unit-jspi (1/7)
target: test-jspi
- name: test-unit-jspi (2/7)
target: test-php-file-get-contents-jspi
- name: test-unit-jspi (3/7)
target: test-php-fopen-jspi
- name: test-unit-jspi (4/7)
target: test-php-fsockopen-jspi
- name: test-unit-jspi (5/7)
target: test-php-gethostbyname-jspi
- name: test-unit-jspi (6/7)
target: test-php-mysqli-jspi
- name: test-unit-jspi (7/7)
target: test-php-sqlite3-jspi
name: ${{ matrix.name }}
services:
mysql:
image: mysql:5.7
env:
MYSQL_DATABASE: test_db
MYSQL_USER: user
MYSQL_PASSWORD: password
MYSQL_ROOT_PASSWORD: rootpassword
ports:
- 3306:3306
options: >-
--health-cmd="mysqladmin ping --silent"
--health-interval=10s
--health-timeout=5s
--health-retries=3
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -108,21 +119,10 @@ jobs:
with:
node-version: 23
- run: node --expose-gc node_modules/nx/bin/nx affected --target=${{ matrix.target }}
# Most of these tests pass locally but the process is crashing
# on the CI runner.
#
# test-unit-jspi:
# runs-on: ubuntu-latest
# needs: [lint-and-typecheck]
# steps:
# - uses: actions/checkout@v4
# with:
# submodules: true
# - uses: ./.github/actions/prepare-playground
# with:
# # @TODO: Switch to the production version once it's released
# node-version: 23.0.0-nightly2024100909d10b50dc
# - run: node --experimental-wasm-jspi --experimental-wasm-stack-switching --expose-gc node_modules/nx/bin/nx affected --target=test --configuration=ci
env:
MYSQL_DATABASE: test_db
MYSQL_USER: user
MYSQL_PASSWORD: password
test-e2e:
runs-on: ubuntu-latest
needs: [lint-and-typecheck]
Expand Down
Binary file modified packages/php-wasm/node/asyncify/7_2_34/php_7_2.wasm
Binary file not shown.
Binary file modified packages/php-wasm/node/asyncify/7_3_33/php_7_3.wasm
Binary file not shown.
Binary file modified packages/php-wasm/node/asyncify/7_4_33/php_7_4.wasm
Binary file not shown.
Binary file modified packages/php-wasm/node/asyncify/8_0_30/php_8_0.wasm
Binary file not shown.
Binary file modified packages/php-wasm/node/asyncify/8_1_23/php_8_1.wasm
Binary file not shown.
Binary file modified packages/php-wasm/node/asyncify/8_2_10/php_8_2.wasm
Binary file not shown.
Binary file modified packages/php-wasm/node/asyncify/8_3_0/php_8_3.wasm
Binary file not shown.
Binary file modified packages/php-wasm/node/asyncify/8_4_0/php_8_4.wasm
Binary file not shown.
2 changes: 1 addition & 1 deletion packages/php-wasm/node/asyncify/php_7_3.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import path from 'path';

const dependencyFilename = path.join(__dirname, '7_3_33', 'php_7_3.wasm');
export { dependencyFilename };
export const dependenciesTotalSize = 17697844;
export const dependenciesTotalSize = 17697847;
export function init(RuntimeName, PHPLoader) {
// The rest of the code comes from the built php.js file and esm-suffix.js
// include: shell.js
Expand Down
2 changes: 1 addition & 1 deletion packages/php-wasm/node/asyncify/php_8_0.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import path from 'path';

const dependencyFilename = path.join(__dirname, '8_0_30', 'php_8_0.wasm');
export { dependencyFilename };
export const dependenciesTotalSize = 18445624;
export const dependenciesTotalSize = 18445623;
export function init(RuntimeName, PHPLoader) {
// The rest of the code comes from the built php.js file and esm-suffix.js
// include: shell.js
Expand Down
2 changes: 1 addition & 1 deletion packages/php-wasm/node/asyncify/php_8_3.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import path from 'path';

const dependencyFilename = path.join(__dirname, '8_3_0', 'php_8_3.wasm');
export { dependencyFilename };
export const dependenciesTotalSize = 19201581;
export const dependenciesTotalSize = 19201580;
export function init(RuntimeName, PHPLoader) {
// The rest of the code comes from the built php.js file and esm-suffix.js
// include: shell.js
Expand Down
125 changes: 56 additions & 69 deletions packages/php-wasm/node/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@
"executor": "@wp-playground/nx-extensions:package-for-self-hosting",
"dependsOn": ["build"]
},
"test": {
"test-asyncify": {
"executor": "@nx/vite:test",
"outputs": ["{workspaceRoot}/coverage/packages/php-wasm/node"],
"options": {
Expand All @@ -156,162 +156,149 @@
"php-ini.spec.ts",
"php-memory.spec.ts",
"php-process-manager.spec.ts",
"php-request-handler.spec.ts",
"php-vars.spec.ts",
"rotate-php-runtime.spec.ts",
"symlinks.spec.ts",
"write-files.spec.ts"
"write-files.spec.ts",
"php-networking.spec.ts",
"php-request-handler.spec.ts",
"php.spec.ts"
]
}
},
"test-php": {
"executor": "@nx/vite:test",
"outputs": ["{workspaceRoot}/coverage/packages/php-wasm/node"],
"options": {
"reportsDirectory": "../../../coverage/packages/php-wasm/node",
"testFiles": ["php.spec.ts"]
}
},
"test-php-networking": {
"executor": "@nx/vite:test",
"outputs": ["{workspaceRoot}/coverage/packages/php-wasm/node"],
"options": {
"reportsDirectory": "../../../coverage/packages/php-wasm/node",
"testFiles": ["php-networking.spec.ts"]
}
},
"test-php-dynamic-loading-jspi": {
"test-jspi": {
"executor": "@nx/vite:test",
"outputs": ["{workspaceRoot}/coverage/packages/php-wasm/node"],
"options": {
"configFile": "packages/php-wasm/node/vite.jspi.config.ts",
"reportsDirectory": "../../../coverage/packages/php-wasm/node",
"testFiles": ["php-dynamic-loading.spec.ts"]
}
},
"test-php-request-handler-files": {
"executor": "@nx/vite:test",
"outputs": ["{workspaceRoot}/coverage/packages/php-wasm/node"],
"options": {
"reportsDirectory": "../../../coverage/packages/php-wasm/node",
"testFiles": ["php-request-handler-files.spec.ts"]
"testFiles": [
"php-crash.spec.ts",
"php-ini.spec.ts",
"php-memory.spec.ts",
"php-process-manager.spec.ts",
"php-vars.spec.ts",
"rotate-php-runtime.spec.ts",
"symlinks.spec.ts",
"write-files.spec.ts",
"php-networking.spec.ts",
"php-dynamic-loading.spec.ts",
"php-request-handler.spec.ts",
"php.spec.ts"
]
}
},
"test-php-request-handler-requests": {
"test-php-file-get-contents-asyncify": {
"executor": "@nx/vite:test",
"outputs": ["{workspaceRoot}/coverage/packages/php-wasm/node"],
"options": {
"reportsDirectory": "../../../coverage/packages/php-wasm/node",
"testFiles": ["php-request-handler-requests.spec.ts"]
"testFiles": ["php-file-get-contents.spec.ts"]
}
},
"test-php-asyncify-file-get-contents-http": {
"test-php-file-get-contents-jspi": {
"executor": "@nx/vite:test",
"outputs": ["{workspaceRoot}/coverage/packages/php-wasm/node"],
"options": {
"configFile": "packages/php-wasm/node/vite.jspi.config.ts",
"reportsDirectory": "../../../coverage/packages/php-wasm/node",
"testFiles": ["php-asyncify-file-get-contents.spec.ts"]
"testFiles": ["php-file-get-contents.spec.ts"]
}
},
"test-php-asyncify-file-get-contents-https": {
"test-php-fopen-asyncify": {
"executor": "@nx/vite:test",
"outputs": ["{workspaceRoot}/coverage/packages/php-wasm/node"],
"options": {
"configFile": "packages/php-wasm/node/vite.https.config.ts",
"reportsDirectory": "../../../coverage/packages/php-wasm/node",
"testFiles": ["php-asyncify-file-get-contents.spec.ts"]
"testFiles": ["php-fopen.spec.ts"]
}
},
"test-php-asyncify-fopen-http": {
"test-php-fopen-jspi": {
"executor": "@nx/vite:test",
"outputs": ["{workspaceRoot}/coverage/packages/php-wasm/node"],
"options": {
"configFile": "packages/php-wasm/node/vite.jspi.config.ts",
"reportsDirectory": "../../../coverage/packages/php-wasm/node",
"testFiles": ["php-asyncify-fopen.spec.ts"]
"testFiles": ["php-fopen.spec.ts"]
}
},
"test-php-asyncify-fopen-https": {
"test-php-fsockopen-asyncify": {
"executor": "@nx/vite:test",
"outputs": ["{workspaceRoot}/coverage/packages/php-wasm/node"],
"options": {
"configFile": "packages/php-wasm/node/vite.https.config.ts",
"reportsDirectory": "../../../coverage/packages/php-wasm/node",
"testFiles": ["php-asyncify-fopen.spec.ts"]
"testFiles": ["php-fsockopen.spec.ts"]
}
},
"test-php-asyncify-fsockopen-http": {
"test-php-fsockopen-jspi": {
"executor": "@nx/vite:test",
"outputs": ["{workspaceRoot}/coverage/packages/php-wasm/node"],
"options": {
"configFile": "packages/php-wasm/node/vite.jspi.config.ts",
"reportsDirectory": "../../../coverage/packages/php-wasm/node",
"testFiles": ["php-asyncify-fsockopen.spec.ts"]
"testFiles": ["php-fsockopen.spec.ts"]
}
},
"test-php-asyncify-fsockopen-https": {
"test-php-gethostbyname-asyncify": {
"executor": "@nx/vite:test",
"outputs": ["{workspaceRoot}/coverage/packages/php-wasm/node"],
"options": {
"configFile": "packages/php-wasm/node/vite.https.config.ts",
"reportsDirectory": "../../../coverage/packages/php-wasm/node",
"testFiles": ["php-asyncify-fsockopen.spec.ts"]
"testFiles": ["php-gethostbyname.spec.ts"]
}
},
"test-php-asyncify-gethostbyname-http": {
"test-php-gethostbyname-jspi": {
"executor": "@nx/vite:test",
"outputs": ["{workspaceRoot}/coverage/packages/php-wasm/node"],
"options": {
"configFile": "packages/php-wasm/node/vite.jspi.config.ts",
"reportsDirectory": "../../../coverage/packages/php-wasm/node",
"testFiles": ["php-asyncify-gethostbyname.spec.ts"]
"testFiles": ["php-gethostbyname.spec.ts"]
}
},
"test-php-asyncify-gethostbyname-https": {
"test-php-mysqli-asyncify": {
"executor": "@nx/vite:test",
"outputs": ["{workspaceRoot}/coverage/packages/php-wasm/node"],
"options": {
"configFile": "packages/php-wasm/node/vite.https.config.ts",
"reportsDirectory": "../../../coverage/packages/php-wasm/node",
"testFiles": ["php-asyncify-gethostbyname.spec.ts"]
"testFiles": ["php-mysqli.spec.ts"]
}
},
"test-php-asyncify-mysqli-http": {
"test-php-mysqli-jspi": {
"executor": "@nx/vite:test",
"outputs": ["{workspaceRoot}/coverage/packages/php-wasm/node"],
"options": {
"configFile": "packages/php-wasm/node/vite.jspi.config.ts",
"reportsDirectory": "../../../coverage/packages/php-wasm/node",
"testFiles": ["php-asyncify-mysqli.spec.ts"]
"testFiles": ["php-mysqli.spec.ts"]
}
},
"test-php-asyncify-mysqli-https": {
"test-php-sqlite3-asyncify": {
"executor": "@nx/vite:test",
"outputs": ["{workspaceRoot}/coverage/packages/php-wasm/node"],
"options": {
"configFile": "packages/php-wasm/node/vite.https.config.ts",
"reportsDirectory": "../../../coverage/packages/php-wasm/node",
"testFiles": ["php-asyncify-mysqli.spec.ts"]
"testFiles": ["php-sqlite3.spec.ts"]
}
},
"test-php-asyncify-sqlite3": {
"test-php-sqlite3-jspi": {
"executor": "@nx/vite:test",
"outputs": ["{workspaceRoot}/coverage/packages/php-wasm/node"],
"options": {
"configFile": "packages/php-wasm/node/vite.jspi.config.ts",
"reportsDirectory": "../../../coverage/packages/php-wasm/node",
"testFiles": ["php-asyncify-sqlite3.spec.ts"]
"testFiles": ["php-sqlite3.spec.ts"]
}
},
"test-php-asyncify-all": {
"executor": "nx:noop",
"dependsOn": [
"test-php-asyncify-file-get-contents-http",
"test-php-asyncify-file-get-contents-https",
"test-php-asyncify-fopen-http",
"test-php-asyncify-fopen-https",
"test-php-asyncify-fsockopen-http",
"test-php-asyncify-fsockopen-https",
"test-php-asyncify-gethostbyname-http",
"test-php-asyncify-gethostbyname-https",
"test-php-asyncify-mysqli-http",
"test-php-asyncify-mysqli-https",
"test-php-asyncify-sqlite3"
"test-php-file-get-contents-asyncify",
"test-php-fopen-asyncify",
"test-php-fsockopen-asyncify",
"test-php-gethostbyname-asyncify",
"test-php-mysqli-asyncify",
"test-php-sqlite3-asyncify"
]
},
"lint": {
Expand Down
Loading