Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 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
15 changes: 12 additions & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,6 @@ jobs:
npm test

tests:
# lint-python takes ~5 seconds, so wait for it to pass before running the full matrix of tests.
needs: [lint-python]
strategy:
fail-fast: false
max-parallel: 11
Expand All @@ -101,14 +99,18 @@ jobs:
- os: macos-13
python: "3.13"
node: 23.x
- os: ubuntu-24.04-arm
- os: ubuntu-24.04-arm
python: "3.13"
node: 23.x
- os: windows-2025
python: "3.13"
node: 23.x
name: ${{ matrix.os }} - ${{ matrix.python }} - ${{ matrix.node }}
runs-on: ${{ matrix.os }}
env:
WASI_VERSION: '25'
WASI_VERSION_FULL: '25.0'
WASI_SDK_PATH: 'wasi-sdk-25.0'
steps:
- name: Checkout Repository
uses: actions/checkout@v4
Expand All @@ -123,6 +125,13 @@ jobs:
env:
PYTHON_VERSION: ${{ matrix.python }} # Why do this?
- uses: seanmiddleditch/gha-setup-ninja@v6
- name: Install wasi-sdk (Windows)
shell: pwsh
if: ${{ startsWith(matrix.os, 'windows') }}
Comment thread
toyobayashi marked this conversation as resolved.
Outdated
run: |
Start-BitsTransfer -Source https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-${env:WASI_VERSION}/wasi-sdk-${env:WASI_VERSION_FULL}-x86_64-windows.tar.gz
New-Item -ItemType Directory -Path ${env:WASI_SDK_PATH}
tar -zxvf wasi-sdk-${env:WASI_VERSION_FULL}-x86_64-windows.tar.gz -C ${env:WASI_SDK_PATH} --strip 1
- name: Install Dependencies
run: |
npm install
Expand Down
5 changes: 4 additions & 1 deletion test/test-windows-make.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,12 @@ function getEnv (target) {
env.CC_target = 'emcc'
env.CXX_target = 'em++'
} else if (target === 'wasi') {
if (!process.env.WASI_SDK_PATH) return env
env.AR_target = path.resolve(__dirname, '..', process.env.WASI_SDK_PATH, 'bin', executable('ar'))
env.CC_target = path.resolve(__dirname, '..', process.env.WASI_SDK_PATH, 'bin', executable('clang'))
env.CXX_target = path.resolve(__dirname, '..', process.env.WASI_SDK_PATH, 'bin', executable('clang++'))
} else if (target === 'wasm') {
if (!process.env.WASI_SDK_PATH) return env
env.AR_target = path.resolve(__dirname, '..', process.env.WASI_SDK_PATH, 'bin', executable('ar'))
env.CC_target = path.resolve(__dirname, '..', process.env.WASI_SDK_PATH, 'bin', executable('clang'))
env.CXX_target = path.resolve(__dirname, '..', process.env.WASI_SDK_PATH, 'bin', executable('clang++'))
Expand All @@ -72,14 +74,15 @@ function quote (path) {
if (path.includes(' ')) {
return `"${path}"`
}
return path
}

describe('windows-cross-compile', function () {
it('build simple node-api addon', async function () {
if (process.platform !== 'win32') {
return this.skip('This test is only for windows')
Comment thread
toyobayashi marked this conversation as resolved.
Outdated
}
const env = getEnv('win-clang')
Comment thread
legendecas marked this conversation as resolved.
const env = getEnv('wasm')
if (!gracefulFs.existsSync(env.CC_target)) {
return this.skip('Visual Studio Clang is not installed')
}
Expand Down