diff --git a/.github/workflows/_ci-build-tauri-apps.reusable.yml b/.github/workflows/_ci-build-tauri-apps.reusable.yml index 75386f27..ef0d0dc0 100644 --- a/.github/workflows/_ci-build-tauri-apps.reusable.yml +++ b/.github/workflows/_ci-build-tauri-apps.reusable.yml @@ -63,6 +63,13 @@ jobs: - name: ๐Ÿฆ€ Install Rust Toolchain uses: dtolnay/rust-toolchain@stable + - name: ๐Ÿฆ€ Rust Cache + uses: Swatinem/rust-cache@v2 + with: + workspaces: '.' + cache-on-failure: true + cache-targets: false + # Install Tauri dependencies on Linux - name: ๐Ÿ”ง Fix ARM64 Package Sources (Linux) if: runner.os == 'Linux' && runner.arch == 'ARM64' diff --git a/.github/workflows/_ci-build-tauri-e2e-app.reusable.yml b/.github/workflows/_ci-build-tauri-e2e-app.reusable.yml index 41c1d8f6..3a833657 100644 --- a/.github/workflows/_ci-build-tauri-e2e-app.reusable.yml +++ b/.github/workflows/_ci-build-tauri-e2e-app.reusable.yml @@ -68,6 +68,13 @@ jobs: - name: ๐Ÿฆ€ Install Rust Toolchain uses: dtolnay/rust-toolchain@stable + - name: ๐Ÿฆ€ Rust Cache + uses: Swatinem/rust-cache@v2 + with: + workspaces: '.' + cache-on-failure: true + cache-targets: false + - name: ๐Ÿ”ง Fix ARM64 Package Sources (Linux) if: runner.os == 'Linux' && runner.arch == 'ARM64' shell: bash diff --git a/.github/workflows/_ci-build-tauri-package-app.reusable.yml b/.github/workflows/_ci-build-tauri-package-app.reusable.yml index d62052d9..c045f884 100644 --- a/.github/workflows/_ci-build-tauri-package-app.reusable.yml +++ b/.github/workflows/_ci-build-tauri-package-app.reusable.yml @@ -79,6 +79,13 @@ jobs: - name: ๐Ÿฆ€ Install Rust Toolchain uses: dtolnay/rust-toolchain@stable + - name: ๐Ÿฆ€ Rust Cache + uses: Swatinem/rust-cache@v2 + with: + workspaces: '.' + cache-on-failure: true + cache-targets: false + - name: ๐Ÿ”ง Fix ARM64 Package Sources (Linux) if: runner.os == 'Linux' && runner.arch == 'ARM64' shell: bash diff --git a/.github/workflows/_ci-build.reusable.yml b/.github/workflows/_ci-build.reusable.yml index ebaabd7c..93a73455 100644 --- a/.github/workflows/_ci-build.reusable.yml +++ b/.github/workflows/_ci-build.reusable.yml @@ -64,12 +64,16 @@ jobs: echo "build_id=$(date +%s)-${{ github.run_id }}" >> $GITHUB_OUTPUT echo "build_date=$(date -u +"%Y-%m-%dT%H:%M:%SZ")" >> $GITHUB_OUTPUT - # Build all packages using Turbo - # This creates the dist/ directories with compiled code + - name: Turbo Cache (GitHub Native) + uses: dtinth/setup-github-actions-caching-for-turbo@v1 + - name: ๐Ÿ—๏ธ Build All Packages run: pnpm run build shell: bash + - name: Cache Report + run: echo "Check turbo summary above for HIT/MISS" + # Upload build artifacts, but only from Linux # This is because Linux builds are most consistent and used by all other jobs # The artifacts include all dist/ and dist-js/ directories from all packages diff --git a/.github/workflows/_ci-e2e.reusable.yml b/.github/workflows/_ci-e2e.reusable.yml index 7f0d11c4..4bd2e28c 100644 --- a/.github/workflows/_ci-e2e.reusable.yml +++ b/.github/workflows/_ci-e2e.reusable.yml @@ -84,8 +84,12 @@ jobs: run: | echo "::notice::Build artifact: ID=${{ inputs.build_id }}, Size=${{ inputs.artifact_size }} bytes" + - name: Turbo Cache (GitHub Native) + uses: rharkor/caching-for-turbo@v1 + with: + turbo-cache-path: .turbo/cache + # Dynamically generate the Turbo filter for building test applications - # This converts the scenario input into Turbo filter syntax - name: ๐Ÿช„ Generate Build Filter for Test Apps id: gen-build uses: actions/github-script@v8 diff --git a/.github/workflows/_ci-package.reusable.yml b/.github/workflows/_ci-package.reusable.yml index 4da35bbd..dd20cff8 100644 --- a/.github/workflows/_ci-package.reusable.yml +++ b/.github/workflows/_ci-package.reusable.yml @@ -132,6 +132,9 @@ jobs: echo "::warning::No dist directories found, build extraction may have failed" fi + - name: Turbo Cache (GitHub Native) + uses: rharkor/caching-for-turbo@v1 + # Pack services from downloaded artifacts so --skip-build can use them # This creates the .tgz files that the test script expects when --skip-build is used - name: ๐Ÿ“ฆ Pack Services from Artifacts @@ -243,3 +246,6 @@ jobs: if: failure() with: timeout: '180000' + + - name: Cache Report + run: echo "Check turbo summary above for HIT/MISS" diff --git a/.github/workflows/_ci-unit.reusable.yml b/.github/workflows/_ci-unit.reusable.yml index bfac915f..68ee9143 100644 --- a/.github/workflows/_ci-unit.reusable.yml +++ b/.github/workflows/_ci-unit.reusable.yml @@ -74,8 +74,14 @@ jobs: echo "::warning::No dist directories found, build extraction may have failed" fi + - name: Turbo Cache (GitHub Native) + uses: rharkor/caching-for-turbo@v1 + # Run unit and integration tests using Turbo # The --only flag ensures we only run tests for the packages that have changed - name: ๐Ÿงช Execute Unit and Integration Tests run: pnpm run test:unit test:integration --only shell: bash + + - name: Cache Report + run: echo "Check turbo summary above for HIT/MISS" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b04a6c30..bb6e9a72 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -40,13 +40,11 @@ jobs: with: os: 'ubuntu-latest' - # Run linting after build to use the build artifacts + # Run linting after change detection lint: name: Lint [Linux] - needs: [detect-changes, build] + needs: [detect-changes] uses: ./.github/workflows/_ci-lint.reusable.yml - with: - cache_key: ${{ needs.build.outputs.cache_key }} # Run unit tests in parallel with lint - both only need build artifacts unit-matrix: @@ -129,11 +127,7 @@ jobs: artifact_size: ${{ needs.build.outputs.artifact_size }} cache_key: ${{ needs.build.outputs.cache_key }} - # Run package tests after unit tests to ensure the package is built correctly - # Split Electron and Tauri tests across separate jobs for better parallelization and clarity - # Electron apps are built inline on the test runner (faster builds, Turbo caching handles it) - # Tauri apps are built separately due to longer build times and system dependencies - # Electron package tests are split by module type (CJS/ESM) for better error isolation + # Electron package tests run in parallel with linting package-electron-matrix: name: Package - Electron needs: [detect-changes, build] @@ -249,7 +243,7 @@ jobs: with: distro: ${{ matrix.distro }} - # Run build tests outside of the main Linux build job + # Run build tests in parallel with linting build-matrix: name: Build needs: [detect-changes, build] @@ -440,7 +434,7 @@ jobs: cache_key: ${{ needs.build.outputs.cache_key }} tauri_cache_key: '' - # Universal binary verification - Electron only + # Universal binary verification - Electron only (runs in parallel with linting) package-electron-mac-universal: name: Package - Electron [macOS-Universal-Verify] needs: [detect-changes, build]