Skip to content

Commit 2285205

Browse files
committed
fix(ci): install deps once then cache
1 parent e67744b commit 2285205

File tree

2 files changed

+43
-8
lines changed

2 files changed

+43
-8
lines changed
+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: "Install p2pd"
2+
inputs:
3+
os:
4+
required: true
5+
cpu:
6+
required: true
7+
8+
runs:
9+
using: "composite"
10+
steps:
11+
- name: Download p2pd
12+
shell: bash
13+
run: |
14+
mkdir -p .ci-bin
15+
16+
if [[ "${{ inputs.os }}" == windows* ]]; then
17+
curl -sLO "https://github.com/libp2p/go-libp2p-daemon/releases/download/v0.9.1/p2pd-windows-amd64.exe"
18+
mv p2pd-windows-amd64.exe .ci-bin/p2pd.exe
19+
elif [[ "${{ inputs.os }}" == macos* ]]; then
20+
if [ "${{ inputs.cpu }}" = "arm64" ]; then
21+
curl -sLO "https://github.com/libp2p/go-libp2p-daemon/releases/download/v0.9.1/p2pd-darwin-arm64"
22+
mv p2pd-darwin-arm64 .ci-bin/p2pd
23+
else
24+
curl -sLO "https://github.com/libp2p/go-libp2p-daemon/releases/download/v0.9.1/p2pd-darwin-amd64"
25+
mv p2pd-darwin-amd64 .ci-bin/p2pd
26+
fi
27+
chmod +x .ci-bin/p2pd
28+
else
29+
if [ "${{ inputs.cpu }}" = "i386" ]; then
30+
echo "No official i386 build available for p2pd. Exiting..."
31+
exit 1
32+
else
33+
curl -sLO "https://github.com/libp2p/go-libp2p-daemon/releases/download/v0.9.1/p2pd-linux-amd64"
34+
mv p2pd-linux-amd64 .ci-bin/p2pd
35+
chmod +x .ci-bin/p2pd
36+
fi
37+
fi
38+
39+
echo "${PWD}/.ci-bin" >> $GITHUB_PATH

.github/workflows/ci.yml

+4-8
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@ jobs:
2121
platform:
2222
- os: linux
2323
cpu: amd64
24-
- os: linux
25-
cpu: i386
2624
- os: linux-gcc-14
2725
cpu: amd64
2826
- os: macos
@@ -78,14 +76,12 @@ jobs:
7876
shell: ${{ matrix.shell }}
7977
nim_ref: ${{ matrix.nim.ref }}
8078

81-
- name: Setup Go
82-
uses: actions/setup-go@v5
83-
with:
84-
go-version: '~1.16.0' # That's the minimum Go version that works with arm.
8579

8680
- name: Install p2pd
87-
run: |
88-
V=1 bash scripts/build_p2pd.sh p2pdCache 124530a3
81+
uses: ./.github/actions/install_p2pd
82+
with:
83+
os: ${{ matrix.platform.os }}
84+
cpu: ${{ matrix.platform.cpu }}
8985

9086
- name: Restore deps from cache
9187
id: deps-cache

0 commit comments

Comments
 (0)