From 177c5fffcd69a2ced5a6ef3a8b5427e5d2806eec Mon Sep 17 00:00:00 2001 From: Siarhei Yelin Date: Mon, 18 Dec 2023 11:44:24 +0300 Subject: [PATCH] Fix cache in qualityGate workflow --- .github/workflows/qualityGate.yml | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/.github/workflows/qualityGate.yml b/.github/workflows/qualityGate.yml index a8c9657547..89f148579b 100644 --- a/.github/workflows/qualityGate.yml +++ b/.github/workflows/qualityGate.yml @@ -28,14 +28,13 @@ env: jobs: quality_gate: runs-on: ubuntu-latest - container: node:20 steps: # By default, it checks out the "merge-commit" for "pull_request" events (https://github.com/actions/checkout) # I.e. the result of merging source branch to the target branch will be checked out. - name: 'Checkout the "merge commit" branch' uses: actions/checkout@v4 with: - path: ${{ env.MERGE_COMMIT_BRANCH_DIR }} + path: ${{ env.MERGE_COMMIT_BRANCH_DIR }} # Checkout the TARGET branch. - name: 'Checkout "target" branch' @@ -45,13 +44,15 @@ jobs: repository: ${{ github.event.pull_request.base.repo.full_name }} path: ${{ env.TARGET_BRANCH_DIR }} - - uses: actions/cache@v3 + - uses: actions/setup-node@v4 with: - path: | - node_modules - ./*/node_modules - key: v1-npm-deps-${{ hashFiles('**/yarn.lock') }} - restore-keys: v1-npm-deps- + node-version: '20.x' + cache: 'yarn' + cache-dependency-path: | + ${{ env.TARGET_BRANCH_DIR }}/yarn.lock + ${{ env.TARGET_BRANCH_DIR }}/*/yarn.lock + ${{ env.MERGE_COMMIT_BRANCH_DIR }}/yarn.lock + ${{ env.MERGE_COMMIT_BRANCH_DIR }}/*/yarn.lock - name: 'Install dependencies & Run "generate-components-api" (target branch)' working-directory: ${{ env.TARGET_BRANCH_DIR }}