From 36e25906dbd384a3069cdcf1714abdca91a23106 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 26 Oct 2026 13:25:42 +0000 Subject: [PATCH] ci: skip e2e tests when only markdown files change Add a `changes` job that detects whether a PR touches any non-markdown file and skip the E2E build/test jobs when it does not. Add a single `E2E Tests result` aggregator job that always reports, so branch rules can require it instead of the per-matrix checks (skipped matrix jobs never report their expanded check names). Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_015mG5hz7QECVCqv3AWMY1fi --- .github/workflows/e2e-tests.yml | 50 +++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/.github/workflows/e2e-tests.yml b/.github/workflows/e2e-tests.yml index 048d4138..c399e06e 100644 --- a/.github/workflows/e2e-tests.yml +++ b/.github/workflows/e2e-tests.yml @@ -10,9 +10,37 @@ on: - published jobs: + changes: + name: Detect non-markdown changes + runs-on: ubuntu-latest + permissions: + pull-requests: read + outputs: + code: ${{ steps.filter.outputs.code }} + steps: + - id: filter + env: + GH_TOKEN: ${{ github.token }} + PR: ${{ github.event.pull_request.number }} + run: | + if [[ "${{ github.event_name }}" != "pull_request" ]]; then + echo "code=true" >> "$GITHUB_OUTPUT" + exit 0 + fi + files=$(gh api "repos/$GITHUB_REPOSITORY/pulls/$PR/files" --paginate --jq '.[].filename') + echo "$files" + if grep -qvE '\.md$' <<< "$files"; then + echo "code=true" >> "$GITHUB_OUTPUT" + else + echo "Only markdown files changed, skipping E2E tests" + echo "code=false" >> "$GITHUB_OUTPUT" + fi + build-matrix: name: Build matrix with react-native versions runs-on: ubuntu-latest + needs: changes + if: needs.changes.outputs.code == 'true' outputs: react-native-matrix: ${{ steps.set-matrix.outputs.matrix }} steps: @@ -397,6 +425,8 @@ jobs: e2e-tests-web: name: Web E2E tests runs-on: ubuntu-24.04 + needs: changes + if: needs.changes.outputs.code == 'true' steps: - uses: actions/checkout@v7 @@ -435,3 +465,23 @@ jobs: DEFAULT_EU_DEFAULT_PRIVATE_KEY: ${{ secrets.DEFAULT_EU_DEFAULT_PRIVATE_KEY }} MINIMUM_US_SEALED_ENCRYPTION_KEY: ${{ secrets.MINIMUM_US_SEALED_ENCRYPTION_KEY }} MINIMUM_US_SEALED_PUBLIC_KEY: ${{ secrets.MINIMUM_US_SEALED_PUBLIC_KEY }} + + e2e-result: + name: E2E Tests result + runs-on: ubuntu-latest + if: always() + needs: + - changes + - e2e-tests-android + - e2e-tests-ios + - e2e-tests-web + steps: + - run: | + if [[ "${{ needs.changes.result }}" != "success" ]]; then + echo "Change detection failed" + exit 1 + fi + if [[ "${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') }}" == "true" ]]; then + echo "E2E tests failed or were cancelled" + exit 1 + fi