diff --git a/.github/workflows/auto_assign.yaml b/.github/workflows/auto_assign.yaml index 6c4476bd..765e8ab3 100644 --- a/.github/workflows/auto_assign.yaml +++ b/.github/workflows/auto_assign.yaml @@ -25,25 +25,10 @@ jobs: node-version: lts/* check-latest: true cache: npm - - name: Generate cache primary key based on nodejs's and npm's version and package-lock.json's hash - id: version - shell: bash - run: echo "hash=node@$(node -v | grep -oP '(?<=^v)\d+')_npm@$(npm -v | grep -oP '^\d+')_package-lock@$(openssl dgst -sha3-512 package-lock.json | grep -oP '[\da-f]{128}')" >> $GITHUB_OUTPUT && cat $GITHUB_OUTPUT - - uses: actions/cache/restore@v3 - name: Try to restore node_modules from cache - id: cache + - name: Installing the dependencies + uses: AnnAngela/cached_node-modules@v1 with: - path: node_modules - key: ${{ steps.version.outputs.hash }} - - name: Install dependencies if no cache for node_modules - run: npm run ci - if: success() && steps.cache.outputs.cache-hit != 'true' - - uses: actions/cache/save@v3 - if: success() && steps.cache.outputs.cache-hit != 'true' - name: Save node_modules to cache - with: - path: node_modules - key: ${{ steps.version.outputs.hash }} + command: npm run ci - name: add assignees and reviewers run: | node scripts/autoAssign/index.js diff --git a/.github/workflows/detectHardcodedOutdatedNPMPackages.yaml b/.github/workflows/detectHardcodedOutdatedNPMPackages.yaml index aff57acf..023d6243 100644 --- a/.github/workflows/detectHardcodedOutdatedNPMPackages.yaml +++ b/.github/workflows/detectHardcodedOutdatedNPMPackages.yaml @@ -23,24 +23,9 @@ jobs: node-version: lts/* check-latest: true cache: npm - - name: Generate cache primary key based on nodejs's and npm's version and package-lock.json's hash - id: version - shell: bash - run: echo "hash=node@$(node -v | grep -oP '(?<=^v)\d+')_npm@$(npm -v | grep -oP '^\d+')_package-lock@$(openssl dgst -sha3-512 package-lock.json | grep -oP '[\da-f]{128}')" >> $GITHUB_OUTPUT && cat $GITHUB_OUTPUT - - uses: actions/cache/restore@v3 - name: Try to restore node_modules from cache - id: cache + - name: Installing the dependencies + uses: AnnAngela/cached_node-modules@v1 with: - path: node_modules - key: ${{ steps.version.outputs.hash }} - - name: Install dependencies if no cache for node_modules - run: npm run ci - if: success() && steps.cache.outputs.cache-hit != 'true' - - uses: actions/cache/save@v3 - if: success() && steps.cache.outputs.cache-hit != 'true' - name: Save node_modules to cache - with: - path: node_modules - key: ${{ steps.version.outputs.hash }} + command: npm run ci - name: Detect hardcoded-outdated NPM packages run: node scripts/detectHardcodedOutdatedNPMPackages/index.js diff --git a/.github/workflows/generateConfiguration.yaml b/.github/workflows/generateConfiguration.yaml index 9a2960af..30927685 100644 --- a/.github/workflows/generateConfiguration.yaml +++ b/.github/workflows/generateConfiguration.yaml @@ -23,25 +23,10 @@ jobs: node-version: lts/* check-latest: true cache: npm - - name: Generate cache primary key based on nodejs's and npm's version and package-lock.json's hash - id: version - shell: bash - run: echo "hash=node@$(node -v | grep -oP '(?<=^v)\d+')_npm@$(npm -v | grep -oP '^\d+')_package-lock@$(openssl dgst -sha3-512 package-lock.json | grep -oP '[\da-f]{128}')" >> $GITHUB_OUTPUT && cat $GITHUB_OUTPUT - - uses: actions/cache/restore@v3 - name: Try to restore node_modules from cache - id: cache + - name: Installing the dependencies + uses: AnnAngela/cached_node-modules@v1 with: - path: node_modules - key: ${{ steps.version.outputs.hash }} - - name: Install dependencies if no cache for node_modules - run: npm run ci - if: success() && steps.cache.outputs.cache-hit != 'true' - - uses: actions/cache/save@v3 - if: success() && steps.cache.outputs.cache-hit != 'true' - name: Save node_modules to cache - with: - path: node_modules - key: ${{ steps.version.outputs.hash }} + command: npm run ci - name: Prepare git run: node scripts/postCommit/prepareGit.js - name: Expose GitHub Runtime diff --git a/.github/workflows/postCommit.yaml b/.github/workflows/postCommit.yaml index 10bc650e..9a9f98b4 100644 --- a/.github/workflows/postCommit.yaml +++ b/.github/workflows/postCommit.yaml @@ -76,25 +76,10 @@ jobs: node-version: lts/* check-latest: true cache: npm - - name: Generate cache primary key based on nodejs's and npm's version and package-lock.json's hash - id: version - shell: bash - run: echo "hash=node@$(node -v | grep -oP '(?<=^v)\d+')_npm@$(npm -v | grep -oP '^\d+')_package-lock@$(openssl dgst -sha3-512 package-lock.json | grep -oP '[\da-f]{128}')" >> $GITHUB_OUTPUT && cat $GITHUB_OUTPUT - - uses: actions/cache/restore@v3 - name: Try to restore node_modules from cache - id: cache + - name: Installing the dependencies + uses: AnnAngela/cached_node-modules@v1 with: - path: node_modules - key: ${{ steps.version.outputs.hash }} - - name: Install dependencies if no cache for node_modules - run: npm run ci - if: success() && steps.cache.outputs.cache-hit != 'true' - - uses: actions/cache/save@v3 - if: success() && steps.cache.outputs.cache-hit != 'true' - name: Save node_modules to cache - with: - path: node_modules - key: ${{ steps.version.outputs.hash }} + command: npm run ci - name: If needs to skip, skip now run: node scripts/skip/index.js id: skip @@ -116,25 +101,10 @@ jobs: node-version: lts/* check-latest: true cache: npm - - name: Generate cache primary key based on nodejs's and npm's version and package-lock.json's hash - id: version - shell: bash - run: echo "hash=node@$(node -v | grep -oP '(?<=^v)\d+')_npm@$(npm -v | grep -oP '^\d+')_package-lock@$(openssl dgst -sha3-512 package-lock.json | grep -oP '[\da-f]{128}')" >> $GITHUB_OUTPUT && cat $GITHUB_OUTPUT - - uses: actions/cache/restore@v3 - name: Try to restore node_modules from cache - id: cache - with: - path: node_modules - key: ${{ steps.version.outputs.hash }} - - name: Install dependencies if no cache for node_modules - run: npm run ci - if: success() && steps.cache.outputs.cache-hit != 'true' - - uses: actions/cache/save@v3 - if: success() && steps.cache.outputs.cache-hit != 'true' - name: Save node_modules to cache + - name: Installing the dependencies + uses: AnnAngela/cached_node-modules@v1 with: - path: node_modules - key: ${{ steps.version.outputs.hash }} + command: npm run ci - name: Git config run: node scripts/postCommit/prepareGit.js - name: Expose GitHub Runtime @@ -177,25 +147,10 @@ jobs: node-version: lts/* check-latest: true cache: npm - - name: Generate cache primary key based on nodejs's and npm's version and package-lock.json's hash - id: version - shell: bash - run: echo "hash=node@$(node -v | grep -oP '(?<=^v)\d+')_npm@$(npm -v | grep -oP '^\d+')_package-lock@$(openssl dgst -sha3-512 package-lock.json | grep -oP '[\da-f]{128}')" >> $GITHUB_OUTPUT && cat $GITHUB_OUTPUT - - uses: actions/cache/restore@v3 - name: Try to restore node_modules from cache - id: cache + - name: Installing the dependencies + uses: AnnAngela/cached_node-modules@v1 with: - path: node_modules - key: ${{ steps.version.outputs.hash }} - - name: Install dependencies if no cache for node_modules - run: npm run ci - if: success() && steps.cache.outputs.cache-hit != 'true' - - uses: actions/cache/save@v3 - if: success() && steps.cache.outputs.cache-hit != 'true' - name: Save node_modules to cache - with: - path: node_modules - key: ${{ steps.version.outputs.hash }} + command: npm run ci - name: Reload the linter cache uses: actions/cache@v3 with: @@ -229,25 +184,10 @@ jobs: node-version: lts/* check-latest: true cache: npm - - name: Generate cache primary key based on nodejs's and npm's version and package-lock.json's hash - id: version - shell: bash - run: echo "hash=node@$(node -v | grep -oP '(?<=^v)\d+')_npm@$(npm -v | grep -oP '^\d+')_package-lock@$(openssl dgst -sha3-512 package-lock.json | grep -oP '[\da-f]{128}')" >> $GITHUB_OUTPUT && cat $GITHUB_OUTPUT - - uses: actions/cache/restore@v3 - name: Try to restore node_modules from cache - id: cache - with: - path: node_modules - key: ${{ steps.version.outputs.hash }} - - name: Install dependencies if no cache for node_modules - run: npm run ci - if: success() && steps.cache.outputs.cache-hit != 'true' - - uses: actions/cache/save@v3 - if: success() && steps.cache.outputs.cache-hit != 'true' - name: Save node_modules to cache + - name: Installing the dependencies + uses: AnnAngela/cached_node-modules@v1 with: - path: node_modules - key: ${{ steps.version.outputs.hash }} + command: npm run ci - name: Fire the webhook of AnnAngela's server run: node scripts/fireWebhook/index.js env: