diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index 95c4309529..f21bed1b22 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -18,11 +18,17 @@ jobs: with: node-version: 17 + - name: Get yarn cache directory path + id: yarn-cache-dir-path + run: echo "::set-output name=dir::$(yarn cache dir)" + - name: Cache Yarn uses: actions/cache@v2 with: - path: '**/node_modules' - key: ${{ runner.os }}-17-16-yarn-${{ hashFiles('yarn.lock') }}-${{ hashFiles('patches/*.patch') }} + path: ${{ steps.yarn-cache-dir-path.outputs.dir }} + key: ${{ runner.os }}-17-16-yarn-${{ hashFiles('yarn.lock') }} + restore-keys: | + ${{ runner.os }}-17-16-yarn- - name: Install Dependencies using Yarn run: yarn install --ignore-engines && git checkout yarn.lock diff --git a/.github/workflows/canary.yml b/.github/workflows/canary.yml index e798796d57..978359666e 100644 --- a/.github/workflows/canary.yml +++ b/.github/workflows/canary.yml @@ -28,11 +28,16 @@ jobs: run: echo "//registry.npmjs.org/:_authToken=$NODE_AUTH_TOKEN" >> ~/.npmrc env: NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }} + - name: Get yarn cache directory path + id: yarn-cache-dir-path + run: echo "::set-output name=dir::$(yarn cache dir)" - name: Cache Yarn uses: actions/cache@v2 with: - path: '**/node_modules' - key: ${{ runner.os }}-17-16-yarn-${{ hashFiles('yarn.lock') }}-${{ hashFiles('patches/*.patch') }} + path: ${{ steps.yarn-cache-dir-path.outputs.dir }} + key: ${{ runner.os }}-17-16-yarn-${{ hashFiles('yarn.lock') }} + restore-keys: | + ${{ runner.os }}-17-16-yarn- - name: Install Dependencies using Yarn run: yarn install --ignore-engines && git checkout yarn.lock - name: Release Canary diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 687ea67a3c..7cee30ba1e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -31,11 +31,16 @@ jobs: run: echo "//registry.npmjs.org/:_authToken=$NODE_AUTH_TOKEN" >> ~/.npmrc env: NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }} + - name: Get yarn cache directory path + id: yarn-cache-dir-path + run: echo "::set-output name=dir::$(yarn cache dir)" - name: Cache Yarn uses: actions/cache@v2 with: - path: '**/node_modules' - key: ${{ runner.os }}-17-16-yarn-${{ hashFiles('yarn.lock') }}-${{ hashFiles('patches/*.patch') }} + path: ${{ steps.yarn-cache-dir-path.outputs.dir }} + key: ${{ runner.os }}-17-16-yarn-${{ hashFiles('yarn.lock') }} + restore-keys: | + ${{ runner.os }}-17-16-yarn- - name: Install Dependencies using Yarn run: yarn install --ignore-engines && git checkout yarn.lock - name: Create Release Pull Request or Publish to npm diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index f7e7b5adee..914dec0d24 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -17,11 +17,16 @@ jobs: uses: actions/setup-node@master with: node-version: 17 + - name: Get yarn cache directory path + id: yarn-cache-dir-path + run: echo "::set-output name=dir::$(yarn cache dir)" - name: Cache Yarn uses: actions/cache@v2 with: - path: '**/node_modules' - key: ${{ runner.os }}-17-16-yarn-${{ hashFiles('yarn.lock') }}-${{ hashFiles('patches/*.patch') }} + path: ${{ steps.yarn-cache-dir-path.outputs.dir }} + key: ${{ runner.os }}-17-16-yarn-${{ hashFiles('yarn.lock') }} + restore-keys: | + ${{ runner.os }}-17-16-yarn- - name: Install Dependencies using Yarn run: yarn install --ignore-engines && git checkout yarn.lock - name: Lint @@ -42,11 +47,16 @@ jobs: uses: actions/setup-node@master with: node-version: 17 + - name: Get yarn cache directory path + id: yarn-cache-dir-path + run: echo "::set-output name=dir::$(yarn cache dir)" - name: Cache Yarn uses: actions/cache@v2 with: - path: '**/node_modules' - key: ${{ runner.os }}-16-${{matrix.graphql_version}}-yarn-${{ hashFiles('yarn.lock') }}-${{ hashFiles('patches/*.patch') }} + path: ${{ steps.yarn-cache-dir-path.outputs.dir }} + key: ${{ runner.os }}-16-${{matrix.graphql_version}}-yarn-${{ hashFiles('yarn.lock') }} + restore-keys: | + ${{ runner.os }}-16-yarn- - name: Use GraphQL v${{matrix.graphql_version}} run: node ./scripts/match-graphql.js ${{matrix.graphql_version}} - name: Install Dependencies using Yarn @@ -71,11 +81,16 @@ jobs: uses: actions/setup-node@master with: node-version: ${{ matrix.node-version }} + - name: Get yarn cache directory path + id: yarn-cache-dir-path + run: echo "::set-output name=dir::$(yarn cache dir)" - name: Cache Yarn uses: actions/cache@v2 with: - path: '**/node_modules' - key: ${{ runner.os }}-${{matrix.node-version}}-${{matrix.graphql_version}}-yarn-${{ hashFiles('yarn.lock') }}-${{ hashFiles('patches/*.patch') }} + path: ${{ steps.yarn-cache-dir-path.outputs.dir }} + key: ${{ runner.os }}-${{matrix.node-version}}-${{matrix.graphql_version}}-yarn-${{ hashFiles('yarn.lock') }} + restore-keys: | + ${{ runner.os }}-${{matrix.node-version}}-${{matrix.graphql_version}}-yarn- - name: Use GraphQL v${{matrix.graphql_version}} run: node ./scripts/match-graphql.js ${{matrix.graphql_version}} - name: Install Dependencies using Yarn @@ -99,11 +114,14 @@ jobs: uses: actions/setup-node@master with: node-version: 17 + - name: Get yarn cache directory path + id: yarn-cache-dir-path + run: echo "::set-output name=dir::$(yarn cache dir)" - name: Cache Yarn uses: actions/cache@v2 with: - path: '**/node_modules' - key: ${{ runner.os }}-17-16-yarn-${{ hashFiles('yarn.lock') }}-${{ hashFiles('patches/*.patch') }} + path: ${{ steps.yarn-cache-dir-path.outputs.dir }} + key: ${{ runner.os }}-17-16-yarn-${{ hashFiles('yarn.lock') }} - name: Install Dependencies using Yarn run: yarn install --ignore-engines && git checkout yarn.lock - name: Build Packages