From 408f8481529cb194dba4ccc62ddee32351078cb7 Mon Sep 17 00:00:00 2001 From: sm47916 Date: Thu, 30 Nov 2023 14:54:07 +0000 Subject: [PATCH] add actions cache --- .github/workflows/docker-image.yml | 48 ++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 38d106c4..72ce8be8 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -58,10 +58,58 @@ jobs: cp -r ethlance-config/config . ls -lah config/ + - name: Run ganache service + run: | + docker run --rm -d --name ganache trufflesuite/ganache:v7.9.1 -v -m "easy leave proof verb wait patient fringe laptop intact opera slab shine" -p 8550 -b 0.5 --chain.allowUnlimitedContractSize=true + - name: Run ganache service run: | docker run --rm -d --name ganache trufflesuite/ganache:v7.9.1 -v -m "easy leave proof verb wait patient fringe laptop intact opera slab shine" -p 8550 -b 0.5 --chain.allowUnlimitedContractSize=true + - name: Get yarn cache directory for top-level ethlance packages + id: yarn-cache-top-level-path + run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT + + - name: Get yarn cache directory for ethlance Server packages + id: yarn-cache-server-path + run: | + cd server + echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT + + - name: Get yarn cache directory for ethlance UI packages + id: yarn-cache-ui-path + run: | + cd server + echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT + cd .. + + - name: Restore Top level cache directory for Ethlance + uses: actions/cache@v3 + id: yarn-cache-top-level # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) + with: + path: ${{ steps.yarn-cache-top-level-path.outputs.dir }} + key: ${{ runner.os }}-ethlance-top-level-yarn-${{ hashFiles('**/yarn.lock') }} + restore-keys: | + ${{ runner.os }}-ethlance-top-level-yarn- + + - name: Install ethlance top-level node modules + run: | + yarn install + + + - name: Restore server cache directory for Ethlance + uses: actions/cache@v3 + id: yarn-cache-server # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) + with: + path: ${{ steps.yarn-cache-server-path.outputs.dir }} + key: ${{ runner.os }}-ethlance-server-yarn-${{ hashFiles('**/yarn.lock') }} + restore-keys: | + ${{ runner.os }}-ethlance-server-yarn- + + - name: Install ethlance server node modules + run: | + cd server && yarn install + # docker_build: # strategy: