Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
95 lines
3.1 KiB
YAML
95 lines
3.1 KiB
YAML
name: pnpm WebAssembly
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
pull_request:
|
|
paths:
|
|
- 'pnpm/**'
|
|
- 'pnpr/**'
|
|
- 'Cargo.toml'
|
|
- 'Cargo.lock'
|
|
- 'rust-toolchain.toml'
|
|
- '.cargo/**'
|
|
- '.config/pnpm/**'
|
|
- 'package.json'
|
|
- 'pnpm-lock.yaml'
|
|
- 'pnpm-workspace.yaml'
|
|
- '.github/workflows/pnpm-wasm.yml'
|
|
- '.github/workflows/release.yml'
|
|
- '.github/actions/wasm-toolchain/**'
|
|
schedule:
|
|
- cron: '30 6 * * *'
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
webcontainer:
|
|
name: Build and run pnpm in WebContainers
|
|
runs-on: blacksmith-8vcpu-ubuntu-2404
|
|
timeout-minutes: 90
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
with:
|
|
persist-credentials: false
|
|
|
|
- name: Install pnpm
|
|
uses: pnpm/setup@a0881977cd8ea73b1ed212236c99ca10dcc80cf4 # v3.1.1
|
|
with:
|
|
install: false
|
|
|
|
- name: Install pinned WebAssembly toolchain
|
|
id: wasm-toolchain
|
|
uses: $/.github/actions/wasm-toolchain
|
|
|
|
- name: Cache WASM compilation
|
|
uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2.9.3
|
|
with:
|
|
shared-key: pnpm-wasm-sdk34-wabt1042
|
|
|
|
- name: Install runtime and browser harness
|
|
run: pnpm install --frozen-lockfile --filter @pnpm-private/wasm-runtime --filter @pnpm-private/ecosystem-e2e-webcontainer --filter @pnpm/esm-loader
|
|
|
|
- name: Build pnpm and the shared-library probe
|
|
env:
|
|
WASI_SDK_PATH: ${{ steps.wasm-toolchain.outputs.wasi-sdk-path }}
|
|
WABT_PATH: ${{ steps.wasm-toolchain.outputs.wabt-path }}
|
|
run: |
|
|
pnpm build:pnpm:wasm
|
|
pnpm build:wasm-runtime-probe
|
|
|
|
- name: Test the Node host and Rust runtime
|
|
env:
|
|
WABT_PATH: ${{ steps.wasm-toolchain.outputs.wabt-path }}
|
|
run: pnpm --filter @pnpm-private/wasm-runtime test
|
|
|
|
- name: Test WASM store permissions on Node.js
|
|
run: |
|
|
pnpm_probe_dir=$(mktemp -d)
|
|
PROBE_DIR="$pnpm_probe_dir" PROBE_STORE=roundtrip node pnpm/wasm/run.mjs target/wasm-runtime-probe/wasm32-wasip1-threads/debug/pnpm-wasm-runtime-probe.wasm
|
|
|
|
- name: Install Chromium
|
|
run: pnpm --filter @pnpm-private/ecosystem-e2e-webcontainer exec playwright-core install --with-deps --only-shell chromium
|
|
|
|
- name: Test shared libraries in a WebContainer
|
|
run: node pnpm/tasks/ecosystem-e2e/webcontainer/run.mjs --wasm-runtime target/wasm-runtime-probe/wasm32-wasip1-threads/debug/pnpm-wasm-runtime-probe.wasm
|
|
|
|
- name: Package @pnpm/wasm
|
|
run: pnpm pack:pnpm:wasm
|
|
|
|
- name: Test the packaged pnpm CLI in a WebContainer
|
|
run: node pnpm/tasks/ecosystem-e2e/webcontainer/run.mjs --wasm-package target/pnpm-wasm.tgz
|
|
|
|
- name: Upload WASM build outputs
|
|
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
|
|
with:
|
|
name: pnpm-wasm
|
|
path: target/pnpm-wasm.tgz
|
|
retention-days: 7
|
|
if-no-files-found: error
|