diff --git a/.github/workflows/js.yml b/.github/workflows/js.yml index 60e880101f3bf..7e8ef31b49cb6 100644 --- a/.github/workflows/js.yml +++ b/.github/workflows/js.yml @@ -80,7 +80,7 @@ jobs: name: AMD64 macOS 11 NodeJS ${{ matrix.node }} runs-on: macos-latest if: github.event_name == 'push' - timeout-minutes: 60 + timeout-minutes: 90 strategy: fail-fast: false matrix: @@ -90,6 +90,12 @@ jobs: uses: actions/checkout@v3 with: fetch-depth: 0 + - name: Jest Cache + uses: actions/cache@v3 + with: + path: js/.jest-cache + key: js-jest-cache-${{ runner.os }}-${{ hashFiles('js/src/**/*.ts', 'js/test/**/*.ts', 'js/yarn.lock') }} + restore-keys: js-jest-cache-${{ runner.os }}- - name: Install NodeJS uses: actions/setup-node@v3 with: @@ -114,6 +120,12 @@ jobs: uses: actions/checkout@v3 with: fetch-depth: 0 + - name: Jest Cache + uses: actions/cache@v3 + with: + path: js/.jest-cache + key: js-jest-cache-${{ runner.os }}-${{ hashFiles('js/src/**/*.ts', 'js/test/**/*.ts', 'js/yarn.lock') }} + restore-keys: js-jest-cache-${{ runner.os }}- - name: Install NodeJS uses: actions/setup-node@v3 with: diff --git a/js/.gitignore b/js/.gitignore index 5b8e0dcc7eba2..5752f9249f034 100644 --- a/js/.gitignore +++ b/js/.gitignore @@ -84,5 +84,8 @@ test/bundle/**/*-bundle.js* # jest snapshots (too big) test/__snapshots__/ +# jest cache +.jest-cache/ + # VSCode !.vscode diff --git a/js/jest.config.js b/js/jest.config.js index 8aaf60a0ff4a2..5a004ef8e928e 100644 --- a/js/jest.config.js +++ b/js/jest.config.js @@ -22,6 +22,7 @@ export default { roots: [ "/test/", ], + cacheDirectory: ".jest-cache", extensionsToTreatAsEsm: [".ts"], moduleFileExtensions: ["js", "mjs", "ts"], coverageReporters: ["lcov", "json",],