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>
This commit is contained in:
commit
9b316a3e27
31
.github/workflows/ci.yml
vendored
31
.github/workflows/ci.yml
vendored
@ -63,10 +63,27 @@ jobs:
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Cache cargo folder
|
||||
uses: actions/cache@v1
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: ~/.cargo
|
||||
key: ${{ matrix.platform.target }}-cargo-${{ matrix.toolchain.rust }}
|
||||
path: |
|
||||
~/.cargo/registry
|
||||
~/.cargo/git
|
||||
key: ${{ matrix.platform.target }}-dot-cargo-parts-${{ hashFiles('Cargo.lock') }}
|
||||
|
||||
- name: Get npm cache directory
|
||||
id: npm-cache
|
||||
if: matrix.platform.cross == false
|
||||
run: |
|
||||
echo "::set-output name=dir::$(npm config get cache)"
|
||||
|
||||
- name: Cache npm (non-cross targets)
|
||||
uses: actions/cache@v2
|
||||
if: matrix.platform.cross == false
|
||||
with:
|
||||
path: ${{ steps.npm-cache.outputs.dir }}
|
||||
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json', '**/setup.sh', '**/*.patch') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-node-
|
||||
|
||||
- name: Install dependencies ubuntu
|
||||
if: matrix.platform.host == 'ubuntu-latest'
|
||||
@ -151,10 +168,10 @@ jobs:
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Cache cargo folder
|
||||
uses: actions/cache@v1
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: ~/.cargo
|
||||
key: lint-cargo
|
||||
key: lint-cargo-${{ hashFiles('Cargo.lock') }}
|
||||
|
||||
- name: Install rust toolchain
|
||||
uses: hecrj/setup-rust-action@v1
|
||||
@ -175,10 +192,10 @@ jobs:
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Cache cargo folder
|
||||
uses: actions/cache@v1
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: ~/.cargo
|
||||
key: readme-doctest
|
||||
key: readme-doctest-${{ hashFiles('Cargo.lock') }}
|
||||
|
||||
- name: Install rust toolchain
|
||||
uses: hecrj/setup-rust-action@v1
|
||||
|
@ -8,6 +8,11 @@ if ! [ -f "./package.json" ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -d "node_modules" ]; then
|
||||
echo "Directory exists already: node_modules/" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# production will skip the dev dependencies
|
||||
npm install --production
|
||||
|
||||
@ -16,9 +21,6 @@ if [ -d "patches" ]; then
|
||||
# as we want to apply the patches create in a js-ipfs checkout to our node_modules
|
||||
# we'll need to remove a few leading path segments to match
|
||||
# a/packages/interface-ipfs-core/src/refs.js to node_modules/interface-ipfs-core/src/refs.js
|
||||
#
|
||||
# cannot use git automation any longer as it will skip any ignored file apparently,
|
||||
# and node_modules are ignored.
|
||||
for p in patches/*; do
|
||||
echo "Applying $(basename "$p")..." >&2
|
||||
patch -d node_modules/ -p1 < "$p"
|
||||
|
Loading…
x
Reference in New Issue
Block a user