Skip to content

Commit

Permalink
Skip running UI tests if there are no relevant changes
Browse files Browse the repository at this point in the history
  • Loading branch information
iangmaia committed Feb 6, 2025
1 parent ceb70bd commit 22b2014
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
10 changes: 6 additions & 4 deletions .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,9 @@ steps:
- label: ":microscope: UI Tests (iPhone)"
command: .buildkite/commands/run-ui-tests.sh UITests 'iPhone 16'
depends_on: build
# Only run on `trunk` and `release/*` -- See p91TBi-cBM-p2#comment-13736
if: build.branch == 'trunk' || build.branch =~ /^release\//
# Only run on `trunk` and `release/*` (see p91TBi-cBM-p2#comment-13736) and when code changes are detected
if: |
(build.branch == 'trunk' || build.branch =~ /^release\//) && $SKIP_UI_TESTS != 'true'
plugins: [$CI_TOOLKIT]
artifact_paths:
- fastlane/test_output/*
Expand All @@ -106,8 +107,9 @@ steps:
- label: ":microscope: UI Tests (iPad)"
command: .buildkite/commands/run-ui-tests.sh UITests "iPad (10th generation)"
depends_on: build
# Only run on `trunk` and `release/*` -- See p91TBi-cBM-p2#comment-13736
if: build.branch == 'trunk' || build.branch =~ /^release\//
# Only run on `trunk` and `release/*` (see p91TBi-cBM-p2#comment-13736) and when code changes are detected
if: |
(build.branch == 'trunk' || build.branch =~ /^release\//) && $SKIP_UI_TESTS != 'true'
plugins: [$CI_TOOLKIT]
artifact_paths:
- fastlane/test_output/*
Expand Down
5 changes: 4 additions & 1 deletion .buildkite/shared-pipeline-vars
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,11 @@
# to set up some variables that will be interpolated in the `.yml` pipeline before uploading it.

XCODE_VERSION=$(sed 's/^~> *//' .xcode-version)
CI_TOOLKIT_PLUGIN_VERSION="3.9.1"
CI_TOOLKIT_PLUGIN_VERSION="iangmaia/pr-changed-files"

# Note: `-v4` suffix was added to use xcode-16.1-v4 image; remember to remove that suffix during the next Xcode update
export IMAGE_ID="xcode-$XCODE_VERSION-v4"
export CI_TOOLKIT="automattic/a8c-ci-toolkit#$CI_TOOLKIT_PLUGIN_VERSION"

# Skip UI tests if changes are limited to docs, assets, or other non-code files
export SKIP_UI_TESTS=$(pr_changed_files --all-match "*.md" "docs/**" "*.txt" "*.pot" "*.strings" "fastlane/**" ".github/**" ".buildkite/**")

0 comments on commit 22b2014

Please sign in to comment.