Skip to content
Open
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
14 changes: 10 additions & 4 deletions .github/workflows/examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,13 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v6
with:
node-version: lts/*
- uses: ipfs/aegir/actions/cache-node-modules@main
cache: pnpm
- run: pnpm install --frozen-lockfile
- run: pnpm run --if-present build

test-examples:
name: Test example ${{ matrix.example.name }}
Expand Down Expand Up @@ -128,9 +131,12 @@ jobs:
- 'libp2p@$PWD/packages/libp2p'
steps:
- uses: actions/checkout@v6
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v6
with:
node-version: lts/*
- uses: ipfs/aegir/actions/cache-node-modules@main
- run: npx playwright install-deps
- run: npx xvfb-maybe aegir test-dependant ${{ matrix.example.repo }} --deps ${{ join(matrix.example.deps, ',') }}
cache: pnpm
- run: pnpm install --frozen-lockfile
- run: pnpm run --if-present build
- run: pnpm exec playwright-core install-deps
- run: pnpm exec xvfb-maybe aegir test-dependant ${{ matrix.example.repo }} --deps ${{ join(matrix.example.deps, ',') }}
128 changes: 61 additions & 67 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,41 +7,37 @@ on:
branches:
- "**"

env:
CACHE_DIRS: |
./interop/dist
./interop/node_modules
./doc/node_modules

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v6
with:
node-version: lts/*
- uses: ipfs/aegir/actions/cache-node-modules@main
with:
directories: ${{ env.CACHE_DIRS }}
cache: pnpm
- run: pnpm install --frozen-lockfile
- run: pnpm run --if-present build

check:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v6
with:
node-version: lts/*
- uses: ipfs/aegir/actions/cache-node-modules@main
with:
directories: ${{ env.CACHE_DIRS }}
- run: npm run --if-present lint
- run: npm run --if-present dep-check
- run: npm run --if-present docs:no-publish
cache: pnpm
- run: pnpm install --frozen-lockfile
- run: pnpm run --if-present build
- run: pnpm run --if-present lint
- run: pnpm run --if-present dep-check
- run: pnpm run --if-present docs:no-publish
- run: git diff --exit-code
- run: npm run --if-present doc-check
- run: npm run --if-present spell-check
- run: pnpm run --if-present doc-check
- run: pnpm run --if-present spell-check

test-node:
needs: build
Expand All @@ -53,13 +49,13 @@ jobs:
fail-fast: false
steps:
- uses: actions/checkout@v6
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v6
with:
node-version: ${{ matrix.node }}
- uses: ipfs/aegir/actions/cache-node-modules@main
with:
directories: ${{ env.CACHE_DIRS }}
- run: npm run --if-present test:node
cache: pnpm
- run: pnpm install --frozen-lockfile
- run: pnpm run --if-present test:node
- uses: codecov/codecov-action@18283e04ce6e62d37312384ff67231eb8fd56d24 # v5.4.3
with:
flags: node
Expand All @@ -71,13 +67,13 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v6
with:
node-version: lts/*
- uses: ipfs/aegir/actions/cache-node-modules@main
with:
directories: ${{ env.CACHE_DIRS }}
- run: npm run --if-present test:chrome
cache: pnpm
- run: pnpm install --frozen-lockfile
- run: pnpm run --if-present test:chrome
- uses: codecov/codecov-action@18283e04ce6e62d37312384ff67231eb8fd56d24 # v5.4.3
with:
flags: chrome
Expand All @@ -89,13 +85,13 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v6
with:
node-version: lts/*
- uses: ipfs/aegir/actions/cache-node-modules@main
with:
directories: ${{ env.CACHE_DIRS }}
- run: npm run --if-present test:chrome-webworker
cache: pnpm
- run: pnpm install --frozen-lockfile
- run: pnpm run --if-present test:chrome-webworker
- uses: codecov/codecov-action@18283e04ce6e62d37312384ff67231eb8fd56d24 # v5.4.3
with:
flags: chrome-webworker
Expand All @@ -107,13 +103,13 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v6
with:
node-version: lts/*
- uses: ipfs/aegir/actions/cache-node-modules@main
with:
directories: ${{ env.CACHE_DIRS }}
- run: npm run --if-present test:firefox
cache: pnpm
- run: pnpm install --frozen-lockfile
- run: pnpm run --if-present test:firefox
- uses: codecov/codecov-action@18283e04ce6e62d37312384ff67231eb8fd56d24 # v5.4.3
with:
flags: firefox
Expand All @@ -125,13 +121,13 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v6
with:
node-version: lts/*
- uses: ipfs/aegir/actions/cache-node-modules@main
with:
directories: ${{ env.CACHE_DIRS }}
- run: npm run --if-present test:firefox-webworker
cache: pnpm
- run: pnpm install --frozen-lockfile
- run: pnpm run --if-present test:firefox-webworker
- uses: codecov/codecov-action@18283e04ce6e62d37312384ff67231eb8fd56d24 # v5.4.3
with:
flags: firefox-webworker
Expand All @@ -143,18 +139,18 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v6
with:
node-version: lts/*
- uses: ipfs/aegir/actions/cache-node-modules@main
with:
directories: ${{ env.CACHE_DIRS }}
cache: pnpm
- run: pnpm install --frozen-lockfile
# https://github.com/actions/runner-images/issues/9733#issuecomment-2074590278
- run: |
sudo rm /etc/apt/sources.list.d/microsoft-prod.list
sudo apt-get update
- run: npx playwright install-deps
- run: npm run --if-present test:webkit
- run: pnpm exec playwright-core install-deps
- run: pnpm run --if-present test:webkit
- uses: codecov/codecov-action@18283e04ce6e62d37312384ff67231eb8fd56d24 # v5.4.3
with:
flags: webkit
Expand All @@ -166,13 +162,13 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v6
with:
node-version: lts/*
- uses: ipfs/aegir/actions/cache-node-modules@main
with:
directories: ${{ env.CACHE_DIRS }}
- run: npx xvfb-maybe npm run --if-present test:electron-main
cache: pnpm
- run: pnpm install --frozen-lockfile
- run: pnpm exec xvfb-maybe pnpm run --if-present test:electron-main
- uses: codecov/codecov-action@18283e04ce6e62d37312384ff67231eb8fd56d24 # v5.4.3
with:
flags: electron-main
Expand All @@ -184,13 +180,13 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v6
with:
node-version: lts/*
- uses: ipfs/aegir/actions/cache-node-modules@main
with:
directories: ${{ env.CACHE_DIRS }}
- run: npx xvfb-maybe npm run --if-present test:electron-renderer
cache: pnpm
- run: pnpm install --frozen-lockfile
- run: pnpm exec xvfb-maybe pnpm run --if-present test:electron-renderer
- uses: codecov/codecov-action@18283e04ce6e62d37312384ff67231eb8fd56d24 # v5.4.3
with:
flags: electron-renderer
Expand All @@ -202,13 +198,13 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v6
with:
node-version: lts/*
- uses: ipfs/aegir/actions/cache-node-modules@main
with:
directories: ${{ env.CACHE_DIRS }}
- run: npm run test:interop -- --bail
cache: pnpm
- run: pnpm install --frozen-lockfile
- run: pnpm run test:interop -- --bail

# transport-interop:
# needs: build
Expand All @@ -219,21 +215,19 @@ jobs:
# with:
# tool-cache: true
# - uses: actions/checkout@v6
# - uses: pnpm/action-setup@v4
# - uses: actions/setup-node@v6
# with:
# node-version: lts/*
# - uses: ipfs/aegir/actions/cache-node-modules@main
# with:
# directories: ${{ env.CACHE_DIRS }}
# cache: pnpm
# - run: pnpm install --frozen-lockfile
# - name: Build images
# run: (cd interop && make -j 4)
# - name: Save package-lock.json as artifact
# - name: Save pnpm-lock.yaml as artifact
# uses: actions/upload-artifact@v4
# with:
# name: package locks
# path: |
# package-lock.json
# interop/package-lock.json
# name: pnpm lock
# path: pnpm-lock.yaml
# - uses: libp2p/test-plans/.github/actions/run-transport-interop-test@master
# with:
# test-filter: js-libp2p-head
Expand Down Expand Up @@ -275,13 +269,13 @@ jobs:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v6
with:
node-version: lts/*
registry-url: "https://registry.npmjs.org"
- uses: ipfs/aegir/actions/cache-node-modules@main
with:
directories: ${{ env.CACHE_DIRS }}
cache: pnpm
- run: pnpm install --frozen-lockfile
- uses: ipfs/aegir/actions/docker-login@main
with:
docker-token: ${{ secrets.DOCKER_TOKEN }}
Expand All @@ -290,15 +284,15 @@ jobs:
name: Run release version
run: |
git update-index --assume-unchanged packages/libp2p/src/version.ts
npm run --if-present release
pnpm run --if-present release
env:
GITHUB_TOKEN: ${{ github.token }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- if: ${{ steps.release.outputs.releases_created != 'true' }}
name: Run release rc
run: |
git update-index --assume-unchanged packages/libp2p/src/version.ts
npm run --if-present release:rc
pnpm run --if-present release:rc
env:
GITHUB_TOKEN: ${{ github.token }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
12 changes: 5 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"url": "https://github.com/libp2p/js-libp2p/issues"
},
"private": true,
"packageManager": "pnpm@11.1.1",
"scripts": {
"reset": "aegir run clean && aegir clean interop/node_modules packages/*/node_modules node_modules package-lock.json packages/*/package-lock.json interop/*/package-lock.json",
"test": "aegir run test",
Expand Down Expand Up @@ -39,16 +40,13 @@
"docs:no-publish": "aegir docs --publish false -- --exclude interop --exclude doc"
},
"devDependencies": {
"aegir": "^47.0.22",
"npm-run-all": "^4.1.5"
"aegir": "^47.2.0",
"npm-run-all": "^4.1.5",
"xvfb-maybe": "0.2.1"
},
"workspaces": [
"doc",
"interop",
"packages/*"
],
"overrides": {
"playwright-core": "1.58.0",
"@multiformats/multiaddr": "13.0.1"
}
]
}
3 changes: 0 additions & 3 deletions packages/gossipsub/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,6 @@
"sinon-ts": "^2.0.0",
"time-cache": "^0.3.0"
},
"engines": {
"npm": ">=8.7.0"
},
"eslintConfig": {
"extends": "ipfs",
"ignorePatterns": [
Expand Down
4 changes: 2 additions & 2 deletions packages/integration-tests/test/identify.node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { identify, identifyPush } from '@libp2p/identify'
import { multiaddr } from '@multiformats/multiaddr'
import { expect } from 'aegir/chai'
import { createLibp2p } from 'libp2p'
import { name, version } from 'libp2p/version'
import { pEvent } from 'p-event'
import pWaitFor from 'p-wait-for'
import sinon from 'sinon'
Expand All @@ -13,7 +14,6 @@ import type { Libp2p } from '@libp2p/interface'

const LOCAL_PORT = 47321
const REMOTE_PORT = 47322
const AGENT_VERSION = 'libp2p/0.0.0'

// Stub environment version for testing dynamic AGENT_VERSION
sinon.stub(process, 'version').value('vTEST')
Expand Down Expand Up @@ -215,7 +215,7 @@ describe('identify', () => {
const peer = await libp2p.peerStore.get(libp2p.peerId)
const storedAgentVersion = peer.metadata.get('AgentVersion')

expect(uint8ArrayToString(storedAgentVersion ?? new Uint8Array())).to.include(`${AGENT_VERSION} node/`)
expect(uint8ArrayToString(storedAgentVersion ?? new Uint8Array())).to.include(`${name}/${version} node/`)
})

it('should store host data and protocol version into peer store', async () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/libp2p-daemon-client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"lint": "aegir lint",
"dep-check": "aegir dep-check",
"build": "aegir build",
"pretest": "npm run build",
"pretest": "pnpm run build",
"test": "aegir test -t node",
"test:node": "aegir test -t node"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/libp2p-daemon-server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"lint": "aegir lint",
"dep-check": "aegir dep-check",
"build": "aegir build",
"pretest": "npm run build",
"pretest": "pnpm run build",
"test": "aegir test -t node",
"test:node": "aegir test -t node"
},
Expand Down
Loading
Loading