From 382fab92bad5c35458a199dd5f25d1c19f255743 Mon Sep 17 00:00:00 2001 From: Arun Sharma Date: Wed, 29 Apr 2026 11:51:09 -0700 Subject: [PATCH] Add published wasm package CI --- .github/workflows/ci.yml | 79 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..c0e3c97 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,79 @@ +name: CI + +on: + push: + branches: [main] + pull_request: + branches: [main] + workflow_dispatch: + inputs: + package_version: + description: "@ladybugdb/wasm-core version to test" + required: true + default: "0.16.0" + +jobs: + test: + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + include: + - os: ubuntu-latest + platform: linux + arch: x64 + - os: ubuntu-24.04-arm + platform: linux + arch: arm64 + - os: macos-latest + platform: darwin + arch: arm64 + - os: windows-latest + platform: win32 + arch: x64 + env: + LADYBUG_WASM_VERSION: ${{ github.event_name == 'workflow_dispatch' && inputs.package_version || '0.16.0' }} + steps: + - name: Checkout wasm package tests + uses: actions/checkout@v4 + with: + fetch-depth: 1 + path: tools/wasm + + - name: Fetch Ladybug source archive + shell: bash + run: | + curl -fsSL https://github.com/LadybugDB/ladybug/archive/refs/heads/main.tar.gz \ + | tar -xz --strip-components=1 --exclude='*/tools/wasm' + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: 24 + cache: npm + cache-dependency-path: tools/wasm/package-lock.json + + - name: Enable long paths (Windows) + if: ${{ matrix.platform == 'win32' }} + shell: pwsh + run: | + New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem" -Name "LongPathsEnabled" -Value 1 -PropertyType DWORD -Force + git config --system core.longpaths true + + - name: Install test dependencies + working-directory: tools/wasm + run: npm ci + + - name: Install wasm package + working-directory: tools/wasm + shell: bash + run: | + rm -rf package + package_tgz="$(npm pack "@ladybugdb/wasm-core@${LADYBUG_WASM_VERSION}" --silent)" + mkdir package + tar -xzf "${package_tgz}" -C package --strip-components=1 + node -e "const pkg = require('./package/package.json'); console.log(pkg.name + '@' + pkg.version)" + + - name: Run API tests + working-directory: tools/wasm + run: npm test