Skip to content

Commit 1c99074

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

File tree

1 file changed

+24
-12
lines changed

1 file changed

+24
-12
lines changed

.github/workflows/ci.yml

+24-12
Original file line numberDiff line numberDiff line change
@@ -78,14 +78,33 @@ jobs:
7878
shell: ${{ matrix.shell }}
7979
nim_ref: ${{ matrix.nim.ref }}
8080

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.
8581

8682
- name: Install p2pd
8783
run: |
88-
V=1 bash scripts/build_p2pd.sh p2pdCache 124530a3
84+
mkdir -p .ci-bin
85+
if [ "${{ matrix.platform.os }}" = "windows" ]; then
86+
curl -sLO "https://github.com/libp2p/go-libp2p-daemon/releases/download/v0.9.1/p2pd-windows-amd64.exe"
87+
mv p2pd-windows-amd64.exe .ci-bin/p2pd.exe
88+
elif [ "${{ matrix.platform.os }}" = "macos" ]; then
89+
if [ "${{ matrix.platform.cpu }}" = "arm64" ]; then
90+
curl -sLO "https://github.com/libp2p/go-libp2p-daemon/releases/download/v0.9.1/p2pd-darwin-arm64"
91+
mv p2pd-darwin-arm64 .ci-bin/p2pd
92+
else
93+
curl -sLO "https://github.com/libp2p/go-libp2p-daemon/releases/download/v0.9.1/p2pd-darwin-amd64"
94+
mv p2pd-darwin-amd64 .ci-bin/p2pd
95+
fi
96+
chmod +x .ci-bin/p2pd
97+
else
98+
if [ "${{ matrix.platform.cpu }}" = "i386" ]; then
99+
echo "No official i386 build available for p2pd. Exiting..."
100+
exit 1
101+
else
102+
curl -sLO "https://github.com/libp2p/go-libp2p-daemon/releases/download/v0.9.1/p2pd-linux-amd64"
103+
mv p2pd-linux-amd64 .ci-bin/p2pd
104+
chmod +x .ci-bin/p2pd
105+
fi
106+
fi
107+
echo "${PWD}/.ci-bin" >> $GITHUB_PATH
89108
90109
- name: Restore deps from cache
91110
id: deps-cache
@@ -96,15 +115,10 @@ jobs:
96115
# The change happened on Nimble v0.14.0. Also forcing the deps to be reinstalled on each os and cpu.
97116
key: nimbledeps-${{ matrix.nim.ref }}-${{ matrix.builder }}-${{ matrix.platform.cpu }}-${{ hashFiles('.pinned') }} # hashFiles returns a different value on windows
98117

99-
- name: Setup python
100-
run: |
101-
mkdir .venv
102-
python -m venv .venv
103118

104119
- name: Install deps
105120
if: ${{ steps.deps-cache.outputs.cache-hit != 'true' }}
106121
run: |
107-
source .venv/bin/activate
108122
nimble install_pinned
109123
110124
- name: Use gcc 14
@@ -118,8 +132,6 @@ jobs:
118132
119133
- name: Run tests
120134
run: |
121-
source .venv/bin/activate
122-
123135
nim --version
124136
nimble --version
125137
gcc --version

0 commit comments

Comments
 (0)