Skip to content
This repository has been archived by the owner on Aug 1, 2023. It is now read-only.

Commit

Permalink
fix: go-libp2p-relay-daemon caching on ci
Browse files Browse the repository at this point in the history
  • Loading branch information
lidel committed Nov 29, 2021
1 parent e1f111a commit 3004b52
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 5 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ jobs:
with:
path: |
/tmp/*-ipfs/**
./go-libp2p-relay-daemon
~/.npm
./node_modules
key: ${{ runner.os }}-build-${{ env.CACHE_NAME }}-${{ github.event.pull_request.head.sha }}
Expand All @@ -56,6 +57,7 @@ jobs:
with:
path: |
/tmp/*-ipfs/**
./go-libp2p-relay-daemon
~/.npm
./node_modules
key: ${{ runner.os }}-build-${{ env.CACHE_NAME }}-${{ github.event.pull_request.head.sha }}
Expand Down Expand Up @@ -84,6 +86,7 @@ jobs:
with:
path: |
/tmp/*-ipfs/**
./go-libp2p-relay-daemon
~/.npm
./node_modules
key: ${{ runner.os }}-build-${{ env.CACHE_NAME }}-${{ github.event.pull_request.head.sha }}
Expand Down Expand Up @@ -119,6 +122,7 @@ jobs:
with:
path: |
/tmp/*-ipfs/**
./go-libp2p-relay-daemon
~/.npm
./node_modules
key: ${{ runner.os }}-build-${{ env.CACHE_NAME }}-${{ github.event.pull_request.head.sha }}
Expand Down Expand Up @@ -151,6 +155,7 @@ jobs:
with:
path: |
/tmp/*-ipfs/**
./go-libp2p-relay-daemon
~/.npm
./node_modules
key: ${{ runner.os }}-build-${{ env.CACHE_NAME }}-${{ github.event.pull_request.head.sha }}
Expand Down
2 changes: 1 addition & 1 deletion scripts/custom-runtime.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ if [ ! -d /tmp/go-ipfs ]; then
git clone https://github.com/ipfs/go-ipfs.git
cd go-ipfs
# set implementation to specific commit
git checkout f13fa35a68723b5702312bed4575911f7f0f2185
git checkout 8c902b156b1c35d17ce45de2525c80bf71c77b5b # https://github.com/ipfs/go-ipfs/pull/8563
make build
fi
fi
Expand Down
7 changes: 5 additions & 2 deletions scripts/setup-relayd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,13 @@

set -eo pipefail

if ! type relayd; then
if ! test -e ./go-libp2p-relay-daemon/relayd; then
echo "Building ./go-libp2p-relay-daemon/relayd binary.."
rm -rf ./go-libp2p-relay-daemon
git clone https://github.com/libp2p/go-libp2p-relay-daemon.git
cd go-libp2p-relay-daemon
# no releases atm, so we pin implementation to specific commit
git checkout 65211a0b6d881086feb7c386d780f55c37dff101 # 2021-11-19
go install ./...
go build ./...
echo "./go-libp2p-relay-daemon/relayd is ready"
fi
2 changes: 1 addition & 1 deletion test/files.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const goOptions = {
config: {
// enabled sharding for go with automatic threshold dropped to the minimum
Internal: {
UnixFSShardingSizeThreshold: "1B"
UnixFSShardingSizeThreshold: '1B'
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion test/utils/relayd.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export async function getRelayV (version, factory) {
if (relays.has(version)) return relays.get(version)
if (process.env.DEBUG) console.log(`Starting relayd_v${version}..`) // eslint-disable-line no-console
if (version < 1 || version > 2) throw new Error('Unsupported circuit relay version')
const relayd = command(`relayd -config scripts/relayd_v${version}.config.json -id scripts/relayd_v${version}.identity`)
const relayd = command(`go-libp2p-relay-daemon/relayd -config scripts/relayd_v${version}.config.json -id scripts/relayd_v${version}.identity`)
let id
for await (const line of relayd.stdout) {
const text = line.toString()
Expand Down

0 comments on commit 3004b52

Please sign in to comment.