diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0a7b8b8..1cb1fda 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -158,10 +158,55 @@ jobs: uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 with: node-version: 22.x + - name: Cache node_modules + id: cache-node-modules + uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 + with: + path: node_modules + key: node-modules-${{ runner.os }}-${{ hashFiles('yarn.lock') }} + - name: Cache agent venv + id: cache-agent-venv + uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 + with: + path: agent/.venv + key: agent-venv-${{ runner.os }}-${{ hashFiles('agent/uv.lock') }} + - name: Cache Jest transforms + id: cache-jest + uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 + with: + path: cdk/.jest-cache + key: jest-${{ runner.os }}-${{ hashFiles('yarn.lock') }}-${{ github.sha }} + restore-keys: | + jest-${{ runner.os }}-${{ hashFiles('yarn.lock') }}- + - name: Cache TypeScript build info + id: cache-tsc + uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 + with: + path: | + cdk/tsconfig.tsbuildinfo + cli/tsconfig.tsbuildinfo + key: tsc-${{ runner.os }}-${{ hashFiles('cdk/src/**', 'cdk/tsconfig.json', 'cdk/tsconfig.dev.json', 'cli/src/**', 'cli/tsconfig.json') }} + restore-keys: | + tsc-${{ runner.os }}- - name: Install dependencies - run: mise run install + env: + CACHE_NODE: ${{ steps.cache-node-modules.outputs.cache-hit }} + CACHE_VENV: ${{ steps.cache-agent-venv.outputs.cache-hit }} + CACHE_JEST: ${{ steps.cache-jest.outputs.cache-hit }} + run: | + echo "::group::Cache status" + echo "node_modules: ${CACHE_NODE:-MISS}" + echo "agent .venv: ${CACHE_VENV:-MISS}" + echo "jest transforms: ${CACHE_JEST:-MISS}" + echo "::endgroup::" + SECONDS=0 + mise run install + echo "::notice::Install completed in ${SECONDS}s (node_modules=${CACHE_NODE:-miss}, venv=${CACHE_VENV:-miss}, jest=${CACHE_JEST:-miss})" - name: build - run: mise run build + run: | + SECONDS=0 + mise run build + echo "::notice::Build completed in ${SECONDS}s" - name: Upload CDK artifact (${{ matrix.compute_type }}) uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 with: diff --git a/.gitignore b/.gitignore index ff85180..5c67d39 100644 --- a/.gitignore +++ b/.gitignore @@ -22,6 +22,8 @@ pids coverage *.lcov .nyc_output +.jest-cache +*.tsbuildinfo lib-cov report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json /test-reports/ diff --git a/cdk/package.json b/cdk/package.json index b76339a..fecad53 100644 --- a/cdk/package.json +++ b/cdk/package.json @@ -65,6 +65,7 @@ "node": ">= 20.x <= 24.x" }, "jest": { + "cacheDirectory": "/.jest-cache", "coverageProvider": "v8", "testMatch": [ "/@(src|test)/**/*(*.)@(spec|test).ts?(x)", diff --git a/cdk/tsconfig.json b/cdk/tsconfig.json index 0d414c0..eca6683 100644 --- a/cdk/tsconfig.json +++ b/cdk/tsconfig.json @@ -1,5 +1,6 @@ { "compilerOptions": { + "incremental": true, "rootDir": "src", "outDir": "lib", "alwaysStrict": true, diff --git a/cli/tsconfig.json b/cli/tsconfig.json index 28bd075..b6f7394 100644 --- a/cli/tsconfig.json +++ b/cli/tsconfig.json @@ -1,5 +1,6 @@ { "compilerOptions": { + "incremental": true, "rootDir": "src", "outDir": "lib", "alwaysStrict": true, diff --git a/mise.toml b/mise.toml index acafafc..274342f 100644 --- a/mise.toml +++ b/mise.toml @@ -160,7 +160,6 @@ run = [ "MISE_EXPERIMENTAL=1 mise //cdk:build", "MISE_EXPERIMENTAL=1 mise //cli:build", "MISE_EXPERIMENTAL=1 mise //docs:build", - "MISE_EXPERIMENTAL=1 mise //docs:sync", ] [tasks.default]