From aef1f85aa9d579e24a1e3bd7c8dae2bd1a3fc84b Mon Sep 17 00:00:00 2001 From: Kurt Himebauch <136133082+xXJSONDeruloXx@users.noreply.github.com> Date: Wed, 28 Oct 2026 16:47:42 -0400 Subject: [PATCH] ci: run store engine host tests in a parallel job (#1735) * ci: run store engine host tests in a parallel non-gating job * ci: harden the store tests job permissions, timeout and exit status --- .github/workflows/build.yml | 64 +++++++++++++++++++++++++++++++++---- 1 file changed, 57 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4b805c86b..8fee8a691 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -546,13 +546,6 @@ jobs: git diff --exit-code -- app/src/main/rust/stores/Cargo.lock \ || { echo "::error::Cargo.lock changed during the build; commit the regenerated lockfile (uploaded as stores-cargo-lock)"; exit 1; } - - name: Store engines host unit tests - timeout-minutes: 10 - continue-on-error: true - run: | - cd app/src/main/rust/stores - cargo test --locked 2>&1 | tail -60 - - name: Upload the regenerated Cargo.lock if: failure() uses: actions/upload-artifact@v4 @@ -642,6 +635,63 @@ jobs: APK_OUTCOME: ${{ steps.apk-upload.outcome }} run: bash tools/release/report-build.sh + store-tests: + name: Store engines host tests + needs: source + if: ${{ github.event_name != 'pull_request' || !github.event.pull_request.draft }} + runs-on: ubuntu-24.04 + timeout-minutes: 15 + continue-on-error: true + permissions: + contents: read + actions: read + steps: + - uses: actions/checkout@v4 + with: + ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }} + fetch-depth: 0 + sparse-checkout: | + /* + !/docs/releases/media/ + sparse-checkout-cone-mode: false + persist-credentials: false + - name: Merge the pinned APK base + if: github.event_name == 'pull_request' + env: + BUILD_BASE_SHA: ${{ needs.source.outputs.base-sha }} + run: | + set -euo pipefail + git fetch --no-tags origin "$BUILD_BASE_SHA" + git config user.name "ci" + git config user.email "ci@users.noreply.github.com" + git merge --no-ff --no-edit FETCH_HEAD + - name: Verify backend and test source match + env: + XBOX_SOURCE_TREE: ${{ needs.source.outputs.tree-sha }} + run: test "$(git rev-parse 'HEAD^{tree}')" = "$XBOX_SOURCE_TREE" + - name: Rust toolchain + id: rust + run: echo "rustc=$(rustc -V | awk '{print $2}')" >> "$GITHUB_OUTPUT" + - name: Cache cargo registry and the host test target + uses: actions/cache@v4 + with: + path: | + ~/.cargo/registry/index + ~/.cargo/registry/cache + ~/.cargo/git/db + app/src/main/rust/stores/target + key: stores-host-v1-${{ runner.os }}-${{ runner.arch }}-${{ steps.rust.outputs.rustc }}-${{ hashFiles('app/src/main/rust/stores/Cargo.lock') }}-${{ hashFiles('app/src/main/rust/stores/src/**', 'app/src/main/rust/stores/Cargo.toml', 'app/src/main/rust/stores/build.rs') }} + restore-keys: | + stores-host-v1-${{ runner.os }}-${{ runner.arch }}-${{ steps.rust.outputs.rustc }}-${{ hashFiles('app/src/main/rust/stores/Cargo.lock') }}- + stores-host-v1-${{ runner.os }}-${{ runner.arch }}-${{ steps.rust.outputs.rustc }}- + - name: Store engines host unit tests + timeout-minutes: 10 + continue-on-error: true + run: | + set -o pipefail + cd app/src/main/rust/stores + cargo test --locked 2>&1 | tail -60 + python-tests: name: Python and native regression tests needs: source