Skip to content

fix: test compatible npm at node minimum #74

fix: test compatible npm at node minimum

fix: test compatible npm at node minimum #74

name: Cross-platform package conformance
on:
push:
pull_request:
workflow_dispatch:
permissions:
contents: read
jobs:
package-host:
name: ${{ matrix.host }} package host
runs-on: ${{ matrix.host }}
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
host:
- ubuntu-latest
- macos-latest
- windows-latest
steps:
- name: Check out source
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
with:
persist-credentials: false
- name: Configure Node.js
uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6
with:
node-version: "24.18.0"
package-manager-cache: false
- name: Install pinned npm CLI
shell: bash
run: |
npm install --global npm@12.0.1 --ignore-scripts --no-audit --no-fund
test "$(node --version)" = "v24.18.0"
test "$(npm --version)" = "12.0.1"
- name: Configure uv and Python
uses: astral-sh/setup-uv@11f9893b081a58869d3b5fccaea48c9e9e46f990 # v8.3.2
with:
version: "0.11.28"
python-version: "3.13.13"
enable-cache: false
- name: Install locked test environment
shell: bash
run: uv sync --frozen --extra test
- name: Verify portable platform contracts
shell: bash
run: |
uv run pytest -q tests/platform/test_host_support.py
node npm/scripts/check-package.mjs
node npm/bin/agentnet.mjs --version
- name: Pack, install, and launch from an unrelated directory
shell: bash
run: |
PACK_DIR="$RUNNER_TEMP/agentnet-pack"
PREFIX="$RUNNER_TEMP/agentnet-prefix"
UNRELATED="$RUNNER_TEMP/agentnet-unrelated"
mkdir -p "$PACK_DIR" "$PREFIX" "$UNRELATED"
PACKED="$(npm pack --ignore-scripts --pack-destination "$PACK_DIR")"
npm install --prefix "$PREFIX" --ignore-scripts --no-audit --no-fund "$PACK_DIR/$PACKED"
cd "$UNRELATED"
node "$PREFIX/node_modules/@misunders2d/agentnet/npm/bin/agentnet.mjs" --version
node-compatibility:
name: Ubuntu / Node.js ${{ matrix.node }} compatibility
runs-on: ubuntu-latest
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
include:
- node: "22.19.0"
npm: "10.9.3"
- node: "24.18.0"
npm: "12.0.1"
- node: "26.5.0"
npm: "12.0.1"
steps:
- name: Check out source
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
with:
persist-credentials: false
- name: Configure Node.js
uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6
with:
node-version: ${{ matrix.node }}
package-manager-cache: false
- name: Install pinned npm CLI
shell: bash
run: |
npm install --global npm@${{ matrix.npm }} --ignore-scripts --no-audit --no-fund
test "$(npm --version)" = "${{ matrix.npm }}"
- name: Configure uv and Python
uses: astral-sh/setup-uv@11f9893b081a58869d3b5fccaea48c9e9e46f990 # v8.3.2
with:
version: "0.11.28"
python-version: "3.13.13"
enable-cache: false
- name: Install locked dependencies
shell: bash
run: npm ci --ignore-scripts --no-audit --no-fund
- name: Pack, install, and launch compatibility artifact
shell: bash
run: |
test "$(node --version)" = "v${{ matrix.node }}"
node npm/scripts/check-package.mjs
PACK_DIR="$RUNNER_TEMP/agentnet-node-${{ matrix.node }}-pack"
PREFIX="$RUNNER_TEMP/agentnet-node-${{ matrix.node }}-prefix"
UNRELATED="$RUNNER_TEMP/agentnet-node-${{ matrix.node }}-unrelated"
mkdir -p "$PACK_DIR" "$PREFIX" "$UNRELATED"
PACKED="$(npm pack --ignore-scripts --pack-destination "$PACK_DIR")"
npm install --prefix "$PREFIX" --ignore-scripts --no-audit --no-fund "$PACK_DIR/$PACKED"
cd "$UNRELATED"
node "$PREFIX/node_modules/@misunders2d/agentnet/npm/bin/agentnet.mjs" --version