Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
120 changes: 9 additions & 111 deletions .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,118 +9,16 @@ env:

# This is the default pipeline – it will build and test the app
steps:
#################
# Build the app
#################
- label: ":pipeline: Build"
key: build
command: .buildkite/commands/build-for-testing.sh
plugins: [$CI_TOOLKIT]
notify:
- github_commit_status:
context: Build

#################
# Create Prototype Build
#################
- label: ":hammer_and_wrench: Prototype Build"
command: .buildkite/commands/prototype-build.sh
plugins: [$CI_TOOLKIT]
if: build.pull_request.id != null
notify:
- github_commit_status:
context: Prototype Build

#################
# Run Unit Tests
#################
- label: ":microscope: Unit Tests"
command: .buildkite/commands/run-unit-tests.sh
depends_on: build
plugins: [$CI_TOOLKIT]
artifact_paths:
- fastlane/test_output/*
notify:
- github_commit_status:
context: Unit Tests

- label: ":microscope: Standalone WordPressAuthenticator Unit Tests"
command: .buildkite/commands/run-wordpress-authenticator-tests.sh
plugins: [$CI_TOOLKIT]
artifact_paths:
- fastlane/test_output/*
notify:
- github_commit_status:
context: WordPressAuthenticator Unit Tests

#################
# Linters
#################
- group: Linters
- group: ":rocket: Prototype Build"
if: build.branch == "test-fad-from-trunk"
steps:
- label: ":radioactive_sign: Danger - PR Check"
command: danger
key: danger
if: build.pull_request.id != null
retry:
manual:
permit_on_passed: true
agents:
queue: linter
notify:
- github_commit_status:
context: Danger - PR Check

- label: ":swift: SwiftLint"
command: swiftlint
notify:
- github_commit_status:
context: SwiftLint
agents:
queue: linter


- label: 🧹 Lint Translations
command: gplint /workdir/WooCommerce/Resources/AppStoreStrings.pot
plugins:
- docker#v3.8.0:
image: public.ecr.aws/automattic/glotpress-validator:1.0.0
agents:
queue: default
notify:
- github_commit_status:
context: Lint Translations

- label: ":sleuth_or_spy: Lint Localized Strings Format"
command: .buildkite/commands/lint-localized-strings-format.sh
- input: Deploy Prototype Build
prompt: Share a Prototype Build via Firebase App Distribution?
key: prototype_triggered
- label: Prototype Build
depends_on: prototype_triggered
command: .buildkite/commands/prototype-build.sh
plugins: [$CI_TOOLKIT]
notify:
- github_commit_status:
context: Lint Localized Strings Format

#################
# UI Tests
#################
- 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\//
plugins: [$CI_TOOLKIT]
artifact_paths:
- fastlane/test_output/*
notify:
- github_commit_status:
context: UI Tests (iPhone)

- label: ":microscope: UI Tests (iPad)"
command: .buildkite/commands/run-ui-tests.sh UITests "iPad Pro 13-inch (M4)"
depends_on: build
# Only run on `trunk` and `release/*` -- See p91TBi-cBM-p2#comment-13736
if: build.branch == "trunk" || build.branch =~ /^release\//
plugins: [$CI_TOOLKIT]
artifact_paths:
- fastlane/test_output/*
notify:
- github_commit_status:
context: UI Tests (iPad)
context: Prototype Build From Trunk
15 changes: 6 additions & 9 deletions fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -777,10 +777,10 @@ platform :ios do
build_for_prototype_build

release_notes = <<~NOTES
Pull Request: ##{pull_request_number || 'N/A'}
Branch: `#{ENV.fetch('BUILDKITE_BRANCH', 'N/A')}`
Commit: #{ENV.fetch('BUILDKITE_COMMIT', 'N/A')[0...7]}
NOTES
release_notes += "Pull Request: ##{PULL_REQUEST_NUMBER}" unless PULL_REQUEST_NUMBER.nil?

firebase_app_distribution(
app: FIREBASE_APP_ID,
Expand All @@ -796,13 +796,13 @@ platform :ios do
dsym_path: './build/WooCommerce.app.dSYM.zip'
)

next if pull_request_number.nil?
next if PULL_REQUEST_NUMBER.nil?

# PR Comment
comment_body = prototype_build_details_comment(app_display_name: 'WooCommerce iOS Prototype')
comment_on_pr(
project: GITHUB_REPO,
pr_number: pull_request_number,
pr_number: PULL_REQUEST_NUMBER,
reuse_identifier: 'prototype-build-link',
body: comment_body
)
Expand All @@ -812,7 +812,7 @@ platform :ios do
lane :build_for_prototype_build do |fetch_code_signing: true|
update_certs_and_profiles_enterprise if fetch_code_signing

pr_prefix = pull_request_number&.then { |num| "pr#{num}" }
pr_prefix = PULL_REQUEST_NUMBER&.then { |num| "pr#{num}" }
commit_short_hash = ENV.fetch('BUILDKITE_COMMIT', '0')[0...7]
build_number = [pr_prefix, commit_short_hash].compact.join('-')

Expand Down Expand Up @@ -1526,11 +1526,8 @@ TEST_ANALYTICS_ENVIRONMENT = %w[
# Release Management Utils
# -----------------------------------------------------------------------------------

def pull_request_number
# Buildkite sets this env var to the PR number if on a PR, but to 'false' (and not nil) if not on a PR
pr_num = ENV.fetch('BUILDKITE_PULL_REQUEST', 'false')
pr_num == 'false' ? nil : Integer(pr_num)
end
# Buildkite sets this env var to the PR number if on a PR, but to 'false' (and not nil) if not on a PR
PULL_REQUEST_NUMBER = ENV['BUILDKITE_PULL_REQUEST']&.then { |n| n == 'false' ? nil : Integer(n) }

def create_backmerge_pr
version = release_version_current
Expand Down