diff --git a/.github/workflows/cspell.yml b/.github/workflows/cspell.yml index 5ec1d97d33d1..4cad8725e66e 100644 --- a/.github/workflows/cspell.yml +++ b/.github/workflows/cspell.yml @@ -14,13 +14,18 @@ jobs: - name: Setup Node uses: ./.github/actions/composite/setupNode + - name: Remove E/App version from package-lock.json + shell: bash + run: jq 'del(.version, .packages[""].version)' package-lock.json > normalized-package-lock.json + - name: Restore cspell cache # v4 - uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 + uses: actions/cache/restore@1bd1e32a3bdc45362d1e726936510720a7c30a57 with: path: .cspellcache - key: cspell-${{ runner.os }}-${{ hashFiles('cspell.json') }} + key: cspell-${{ runner.os }}-${{ hashFiles('cspell.json', 'normalized-package-lock.json') }}-${{ github.sha }} restore-keys: | + cspell-${{ runner.os }}-${{ hashFiles('cspell.json', 'normalized-package-lock.json') }}- cspell-${{ runner.os }}- - name: Get changed files @@ -34,9 +39,17 @@ jobs: - name: Filter out dot files id: filtered-files run: | - FILES=$(echo "${{ steps.changed-files.outputs.files }}" | tr ' ' '\n' | grep -v '^\.' | tr '\n' ' ') + FILES=$(echo "${{ steps.changed-files.outputs.files }}" | tr ' ' '\n' | grep -v '^\.' | xargs) echo "files=$FILES" >> "$GITHUB_OUTPUT" - name: Spell check if: steps.filtered-files.outputs.files != '' - run: npm run spell-changed -- ${{ steps.filtered-files.outputs.files }} \ No newline at end of file + run: npm run spell-changed -- ${{ steps.filtered-files.outputs.files }} + + - name: Save cspell cache + # v4 + uses: actions/cache/save@1bd1e32a3bdc45362d1e726936510720a7c30a57 + if: always() + with: + path: .cspellcache + key: cspell-${{ runner.os }}-${{ hashFiles('cspell.json', 'normalized-package-lock.json') }}-${{ github.sha }} \ No newline at end of file diff --git a/.github/workflows/lint-changed.yml b/.github/workflows/lint-changed.yml index fe57838568de..62971f8627ff 100644 --- a/.github/workflows/lint-changed.yml +++ b/.github/workflows/lint-changed.yml @@ -57,18 +57,27 @@ jobs: with: IS_DESKTOP_BUILD: true - - name: Remove E/App version from package-lock.json (For cache invalidation) + - name: Remove E/App version from package-lock.json shell: bash run: jq 'del(.version, .packages[""].version)' package-lock.json > normalized-package-lock.json - - name: Cache ESLint + - name: Restore ESLint cache # v4 - uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 + uses: actions/cache/restore@1bd1e32a3bdc45362d1e726936510720a7c30a57 with: path: node_modules/.cache/eslint-changed - key: ${{ runner.os }}-eslint-changed-${{ hashFiles('eslint.changed.config.*', 'normalized-package-lock.json') }} + key: ${{ runner.os }}-eslint-changed-${{ hashFiles('eslint.changed.config.*', 'normalized-package-lock.json') }}-${{ github.sha }} restore-keys: | + ${{ runner.os }}-eslint-changed-${{ hashFiles('eslint.changed.config.*', 'normalized-package-lock.json') }}- ${{ runner.os }}-eslint-changed- - name: Run ESLint to check for deprecation warnings run: npm run lint-changed + + - name: Save ESLint cache + # v4 + uses: actions/cache/save@1bd1e32a3bdc45362d1e726936510720a7c30a57 + if: always() + with: + path: node_modules/.cache/eslint-changed + key: ${{ runner.os }}-eslint-changed-${{ hashFiles('eslint.changed.config.*', 'normalized-package-lock.json') }}-${{ github.sha }} diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 3fb111e90cdf..a41635bfa918 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -26,23 +26,29 @@ jobs: with: IS_DESKTOP_BUILD: true - - name: Remove E/App version from package-lock.json (For cache invalidation) + - name: Remove E/App version from package-lock.json shell: bash - # Remove App version from package-lock.json to avoid cache invalidation when the App version changes run: jq 'del(.version, .packages[""].version)' package-lock.json > normalized-package-lock.json - - name: Cache ESLint + - name: Restore ESLint cache # v4 - uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 + uses: actions/cache/restore@1bd1e32a3bdc45362d1e726936510720a7c30a57 with: path: node_modules/.cache/eslint - # Only invalidate the cache if the eslint ruleset change (from eslint.config.mjs or the normalized-package-lock.json), we use --cache-strategy content to handle cache invalidation - # See https://eslint.org/docs/latest/use/command-line-interface#--cache-strategy for more information - key: ${{ runner.os }}-eslint-${{ hashFiles('eslint.config.*', 'normalized-package-lock.json') }} + key: ${{ runner.os }}-eslint-${{ hashFiles('eslint.config.*', 'normalized-package-lock.json') }}-${{ github.sha }} restore-keys: | + ${{ runner.os }}-eslint-${{ hashFiles('eslint.config.*', 'normalized-package-lock.json') }}- ${{ runner.os }}-eslint- - name: Lint JavaScript and Typescript with ESLint run: npm run lint env: CI: true + + - name: Save ESLint cache + # v4 + uses: actions/cache/save@1bd1e32a3bdc45362d1e726936510720a7c30a57 + if: always() + with: + path: node_modules/.cache/eslint + key: ${{ runner.os }}-eslint-${{ hashFiles('eslint.config.*', 'normalized-package-lock.json') }}-${{ github.sha }}