Skip to content
This repository was archived by the owner on Oct 23, 2022. It is now read-only.

Commit 9b316a3

Browse files
bors[bot]Joonas Koivunen
andauthored
Merge #268
268: ci: caching updates r=aphelionz a=koivunej node_modules: It's quite slow on windows (about 3min), linux (50s) and mac is in the between. This is a bit hacky given the patching and whatnot, but I think the hashFiles combination is good. ~/.cargo: this was never cached, but now it should be cached correctly `hashFiles(Cargo.lock)`. Co-authored-by: Joonas Koivunen <joonas@equilibrium.co>
2 parents c6b68cc + 4208dec commit 9b316a3

File tree

2 files changed

+29
-10
lines changed

2 files changed

+29
-10
lines changed

.github/workflows/ci.yml

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,27 @@ jobs:
6363
uses: actions/checkout@v2
6464

6565
- name: Cache cargo folder
66-
uses: actions/cache@v1
66+
uses: actions/cache@v2
6767
with:
68-
path: ~/.cargo
69-
key: ${{ matrix.platform.target }}-cargo-${{ matrix.toolchain.rust }}
68+
path: |
69+
~/.cargo/registry
70+
~/.cargo/git
71+
key: ${{ matrix.platform.target }}-dot-cargo-parts-${{ hashFiles('Cargo.lock') }}
72+
73+
- name: Get npm cache directory
74+
id: npm-cache
75+
if: matrix.platform.cross == false
76+
run: |
77+
echo "::set-output name=dir::$(npm config get cache)"
78+
79+
- name: Cache npm (non-cross targets)
80+
uses: actions/cache@v2
81+
if: matrix.platform.cross == false
82+
with:
83+
path: ${{ steps.npm-cache.outputs.dir }}
84+
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json', '**/setup.sh', '**/*.patch') }}
85+
restore-keys: |
86+
${{ runner.os }}-node-
7087
7188
- name: Install dependencies ubuntu
7289
if: matrix.platform.host == 'ubuntu-latest'
@@ -151,10 +168,10 @@ jobs:
151168
uses: actions/checkout@v2
152169

153170
- name: Cache cargo folder
154-
uses: actions/cache@v1
171+
uses: actions/cache@v2
155172
with:
156173
path: ~/.cargo
157-
key: lint-cargo
174+
key: lint-cargo-${{ hashFiles('Cargo.lock') }}
158175

159176
- name: Install rust toolchain
160177
uses: hecrj/setup-rust-action@v1
@@ -175,10 +192,10 @@ jobs:
175192
uses: actions/checkout@v2
176193

177194
- name: Cache cargo folder
178-
uses: actions/cache@v1
195+
uses: actions/cache@v2
179196
with:
180197
path: ~/.cargo
181-
key: readme-doctest
198+
key: readme-doctest-${{ hashFiles('Cargo.lock') }}
182199

183200
- name: Install rust toolchain
184201
uses: hecrj/setup-rust-action@v1

conformance/setup.sh

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@ if ! [ -f "./package.json" ]; then
88
exit 1
99
fi
1010

11+
if [ -d "node_modules" ]; then
12+
echo "Directory exists already: node_modules/" >&2
13+
exit 1
14+
fi
15+
1116
# production will skip the dev dependencies
1217
npm install --production
1318

@@ -16,9 +21,6 @@ if [ -d "patches" ]; then
1621
# as we want to apply the patches create in a js-ipfs checkout to our node_modules
1722
# we'll need to remove a few leading path segments to match
1823
# a/packages/interface-ipfs-core/src/refs.js to node_modules/interface-ipfs-core/src/refs.js
19-
#
20-
# cannot use git automation any longer as it will skip any ignored file apparently,
21-
# and node_modules are ignored.
2224
for p in patches/*; do
2325
echo "Applying $(basename "$p")..." >&2
2426
patch -d node_modules/ -p1 < "$p"

0 commit comments

Comments
 (0)