Skip to content

Commit

Permalink
chore: re-enable testing examples (#2752)
Browse files Browse the repository at this point in the history
Adds all missing examples and re-enables testing main with them.
  • Loading branch information
achingbrain authored Oct 8, 2024
1 parent 8874660 commit 934a891
Showing 1 changed file with 104 additions and 35 deletions.
139 changes: 104 additions & 35 deletions .github/workflows/examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,38 +19,107 @@ jobs:
node-version: lts/*
- uses: ipfs/aegir/actions/cache-node-modules@master

# re-enable after libp2p@2.x.x release
# test-examples:
# name: Test example ${{ matrix.example.name }}
# runs-on: ubuntu-latest
# needs: build
# continue-on-error: true
# strategy:
# matrix:
# example:
# - name: js-libp2p-example-chat
# repo: https://github.com/libp2p/js-libp2p-example-chat.git
# deps:
# - '@libp2p/tcp@$PWD/packages/transport-tcp'
# - '@libp2p/websockets@$PWD/packages/transport-websockets'
# - 'libp2p@$PWD/packages/libp2p'
# - name: js-libp2p-example-circuit-relay
# repo: https://github.com/libp2p/js-libp2p-example-circuit-relay.git
# deps:
# - '@libp2p/circuit-relay-v2@$PWD/packages/transport-circuit-relay-v2'
# - '@libp2p/identify@$PWD/packages/protocol-identify'
# - '@libp2p/websockets@$PWD/packages/transport-websockets'
# - 'libp2p@$PWD/packages/libp2p'
# - name: js-libp2p-example-connection-encryption
# repo: https://github.com/libp2p/js-libp2p-example-connection-encryption.git
# deps:
# - '@libp2p/plaintext@$PWD/packages/connection-encrypter-plaintext'
# - '@libp2p/tcp@$PWD/packages/transport-tcp'
# - 'libp2p@$PWD/packages/libp2p'
# steps:
# - uses: actions/checkout@v4
# - uses: actions/setup-node@v4
# with:
# node-version: lts/*
# - uses: ipfs/aegir/actions/cache-node-modules@master
# - run: npx xvfb-maybe aegir test-dependant ${{ matrix.example.repo }} --deps ${{ join(matrix.example.deps, ',') }}
test-examples:
name: Test example ${{ matrix.example.name }}
runs-on: ubuntu-latest
needs: build
continue-on-error: true
strategy:
matrix:
example:
- name: js-libp2p-example-browser-pubsub
repo: https://github.com/libp2p/js-libp2p-example-browser-pubsub.git
deps:
- '@libp2p/circuit-relay-v2@$PWD/packages/transport-circuit-relay-v2'
- '@libp2p/dcutr@$PWD/packages/protocol-dcutr'
- '@libp2p/identify@$PWD/packages/protocol-identify'
- '@libp2p/webrtc@$PWD/packages/transport-webrtc'
- '@libp2p/websockets@$PWD/packages/transport-websockets'
- 'libp2p@$PWD/packages/libp2p'
- name: js-libp2p-example-chat
repo: https://github.com/libp2p/js-libp2p-example-chat.git
deps:
- '@libp2p/mdns@$PWD/packages/peer-discovery-mdns'
- '@libp2p/tcp@$PWD/packages/transport-tcp'
- '@libp2p/websockets@$PWD/packages/transport-websockets'
- 'libp2p@$PWD/packages/libp2p'
- name: js-libp2p-example-circuit-relay
repo: https://github.com/libp2p/js-libp2p-example-circuit-relay.git
deps:
- '@libp2p/circuit-relay-v2@$PWD/packages/transport-circuit-relay-v2'
- '@libp2p/identify@$PWD/packages/protocol-identify'
- '@libp2p/websockets@$PWD/packages/transport-websockets'
- 'libp2p@$PWD/packages/libp2p'
- name: js-libp2p-example-connection-encryption
repo: https://github.com/libp2p/js-libp2p-example-connection-encryption.git
deps:
- '@libp2p/plaintext@$PWD/packages/connection-encrypter-plaintext'
- '@libp2p/tcp@$PWD/packages/transport-tcp'
- 'libp2p@$PWD/packages/libp2p'
- name: js-libp2p-example-custom-protocols
repo: https://github.com/libp2p/js-libp2p-example-custom-protocols.git
deps:
- '@libp2p/tcp@$PWD/packages/transport-tcp'
- '@libp2p/websockets@$PWD/packages/transport-websockets'
- 'libp2p@$PWD/packages/libp2p'
- name: js-libp2p-example-delegated-routing
repo: https://github.com/libp2p/js-libp2p-example-delegated-routing.git
deps:
- 'libp2p@$PWD/packages/libp2p'
- name: js-libp2p-example-discovery-mechanisms
repo: https://github.com/libp2p/js-libp2p-example-discovery-mechanisms.git
deps:
- '@libp2p/bootstrap@$PWD/packages/peer-discovery-bootstrap'
- '@libp2p/circuit-relay-v2@$PWD/packages/transport-circuit-relay-v2'
- '@libp2p/identify@$PWD/packages/protocol-identify'
- '@libp2p/kad-dht@$PWD/packages/kad-dht'
- '@libp2p/mdns@$PWD/packages/peer-discovery-mdns'
- '@libp2p/tcp@$PWD/packages/transport-tcp'
- 'libp2p@$PWD/packages/libp2p'
- name: js-libp2p-example-peer-and-content-routing
repo: https://github.com/libp2p/js-libp2p-example-peer-and-content-routing.git
deps:
- '@libp2p/identify@$PWD/packages/protocol-identify'
- '@libp2p/kad-dht@$PWD/packages/kad-dht'
- '@libp2p/tcp@$PWD/packages/transport-tcp'
- 'libp2p@$PWD/packages/libp2p'
- name: js-libp2p-example-pnet
repo: https://github.com/libp2p/js-libp2p-example-pnet.git
deps:
- '@libp2p/pnet@$PWD/packages/pnet'
- '@libp2p/tcp@$PWD/packages/transport-tcp'
- 'libp2p@$PWD/packages/libp2p'
- name: js-libp2p-example-protocol-and-stream-muxing
repo: https://github.com/libp2p/js-libp2p-example-protocol-and-stream-muxing.git
deps:
- '@libp2p/tcp@$PWD/packages/transport-tcp'
- 'libp2p@$PWD/packages/libp2p'
- name: js-libp2p-example-pubsub
repo: https://github.com/libp2p/js-libp2p-example-pubsub.git
deps:
- '@libp2p/identify@$PWD/packages/protocol-identify'
- '@libp2p/tcp@$PWD/packages/transport-tcp'
- 'libp2p@$PWD/packages/libp2p'
- name: js-libp2p-example-transports
repo: https://github.com/libp2p/js-libp2p-example-transports.git
deps:
- '@libp2p/tcp@$PWD/packages/transport-tcp'
- '@libp2p/websockets@$PWD/packages/transport-websockets'
- 'libp2p@$PWD/packages/libp2p'
- name: js-libp2p-example-webrtc-private-to-private
repo: https://github.com/libp2p/js-libp2p-example-webrtc-private-to-private.git
deps:
- '@libp2p/circuit-relay-v2@$PWD/packages/transport-circuit-relay-v2'
- '@libp2p/identify@$PWD/packages/protocol-identify'
- '@libp2p/ping@$PWD/packages/protocol-ping'
- '@libp2p/webrtc@$PWD/packages/transport-webrtc'
- '@libp2p/websockets@$PWD/packages/transport-websockets'
- 'libp2p@$PWD/packages/libp2p'
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: lts/*
- uses: ipfs/aegir/actions/cache-node-modules@master
- run: npx playwright install-deps
- run: npx xvfb-maybe aegir test-dependant ${{ matrix.example.repo }} --deps ${{ join(matrix.example.deps, ',') }}

0 comments on commit 934a891

Please sign in to comment.