From db8bec889c22b9dc9875bad55aa54bfa8a438b43 Mon Sep 17 00:00:00 2001 From: m0ar Date: Thu, 21 Mar 2024 12:31:00 +0100 Subject: [PATCH] Add caching of node deps in workflows --- .github/workflows/build-and-test.yaml | 10 ++++++++-- .github/workflows/build-server.yaml | 9 +++++++-- .github/workflows/contracts-test.yaml | 7 +++++-- .github/workflows/models-build-and-test.yaml | 9 ++++++--- 4 files changed, 26 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build-and-test.yaml b/.github/workflows/build-and-test.yaml index db887c2e..e0d8aa0d 100644 --- a/.github/workflows/build-and-test.yaml +++ b/.github/workflows/build-and-test.yaml @@ -37,9 +37,15 @@ jobs: - name: Set up the environment # Replace this line with the appropriate setup for your project # Examples: - uses: actions/setup-node@v2 + uses: actions/setup-node@v4 with: - node-version: 18 + node-version-file: ".nvmrc" + check-latest: false + cache: "yarn" + cache-dependency-path: | + desci-models/yarn.lock + desci-server/yarn.lock + desci-repo/yarn.lock - name: Set up docker-compose run: | diff --git a/.github/workflows/build-server.yaml b/.github/workflows/build-server.yaml index 2973b2c2..ecce58cd 100644 --- a/.github/workflows/build-server.yaml +++ b/.github/workflows/build-server.yaml @@ -40,9 +40,14 @@ jobs: - name: Set up the environment # Replace this line with the appropriate setup for your project # Examples: - uses: actions/setup-node@v2 + uses: actions/setup-node@v4 with: - node-version: 18 + node-version-file: ".nvmrc" + check-latest: false + cache: "yarn" + cache-dependency-path: | + desci-models/yarn.lock + desci-server/yarn.lock - name: Set up docker-compose run: | diff --git a/.github/workflows/contracts-test.yaml b/.github/workflows/contracts-test.yaml index bb54f3c6..42f2dbb2 100644 --- a/.github/workflows/contracts-test.yaml +++ b/.github/workflows/contracts-test.yaml @@ -25,9 +25,12 @@ jobs: - name: Set up the environment # Replace this line with the appropriate setup for your project # Examples: - uses: actions/setup-node@v2 + uses: actions/setup-node@v4 with: - node-version: 18 + node-version-file: ".nvmrc" + check-latest: false + cache: "yarn" + cache-dependency-path: "desci-contracts/yarn.lock" - name: Install dependencies run: cd desci-contracts && npm i -g yarn && yarn && yarn build diff --git a/.github/workflows/models-build-and-test.yaml b/.github/workflows/models-build-and-test.yaml index c4ca65bb..8ac34444 100644 --- a/.github/workflows/models-build-and-test.yaml +++ b/.github/workflows/models-build-and-test.yaml @@ -25,9 +25,12 @@ jobs: - name: Set up the environment # Replace this line with the appropriate setup for your project # Examples: - uses: actions/setup-node@v2 + uses: actions/setup-node@v4 with: - node-version: 16 + node-version-file: ".nvmrc" + check-latest: false + cache: "yarn" + cache-dependency-path: "desci-models/yarn.lock" - name: Set up docker-compose run: | @@ -40,4 +43,4 @@ jobs: - name: Run tests run: | - cd desci-models && yarn generate && yarn test \ No newline at end of file + cd desci-models && yarn generate && yarn test