Skip to content
21 changes: 17 additions & 4 deletions .github/workflows/cspell.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 }}
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 }}
17 changes: 13 additions & 4 deletions .github/workflows/lint-changed.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
20 changes: 13 additions & 7 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}