Skip to content

Commit d2c8f37

Browse files
committed
renamed workflow to SDK Validation, constrained iOS checks to primary Xcode, updated CI docs
1 parent c38cd3d commit d2c8f37

2 files changed

Lines changed: 21 additions & 7 deletions

File tree

.github/ci/README.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@ This folder contains the source-of-truth config for the CI workflow:
99
## What Runs Automatically
1010

1111
- `pull_request` (`opened`, `reopened`, `synchronize`, `ready_for_review`): default PR pipeline
12-
- SDK build matrix (`swift build` for all library targets + iOS package build)
13-
- test app build matrix (`AdaptyRecipes-SwiftUI`)
12+
- SDK target build matrix (`swift build` for all library targets)
13+
- iOS package build (`Adapty-Package`) on primary Xcode (`sdk_tests.xcode`)
14+
- test app build (`AdaptyRecipes-SwiftUI`) on primary Xcode (`sdk_tests.xcode`)
1415
- one-Xcode macOS SDK build
1516
- SDK tests matrix (`swift test`)
1617
- `workflow_dispatch`: manual run with per-step toggles and optional JSON overrides
@@ -23,12 +24,12 @@ Note: there is no automatic `push` trigger for this workflow.
2324
`schema_version: 2` config keys:
2425

2526
- `build_sdk_targets` (`bool`): default enable SDK matrix build + macOS SDK build
26-
- `build_test_app` (`bool`): default enable test app matrix build
27+
- `build_test_app` (`bool`): default enable test app build on primary Xcode (`sdk_tests.xcode`)
2728
- `run_tests` (`bool`): default enable `swift test` matrix
2829
- `lint_pods` (`bool`): default disable CocoaPods lint job (can be enabled in manual runs)
2930
- `build_errors_whitelist` (`list`): allowlist for test app build failures only
3031
- `test_errors_whitelist` (`list`): allowlist for `swift test` failures
31-
- `build_matrix` (`list`): Xcode matrix for SDK/test-app jobs
32+
- `build_matrix` (`list`): Xcode matrix for SDK jobs (and for selecting primary-Xcode entry used by iOS package/test app builds)
3233
- `sdk_tests` (`object`): runner/Xcode for one-Xcode jobs (`macOS build`, `pod lib lint`)
3334
- `sdk_tests_matrix` (`list`): Xcode matrix for `swift test`
3435

@@ -58,6 +59,7 @@ Boolean defaults are duplicated in two places by design:
5859
- If matrix entry is `informational: true` and Xcode is unavailable, that entry is skipped with warning.
5960
- If matrix entry is `informational: false` and Xcode is unavailable, that entry fails.
6061
- One-Xcode jobs (`SDK macOS build`, `CocoaPods lint` when enabled) fail when configured Xcode is unavailable.
62+
- iOS-specific steps (iOS package build + test app build) run only on primary Xcode (`sdk_tests.xcode`).
6163
- Test app build does not patch placeholders with `sed`; CI writes a dedicated `AppConstants.swift` with dummy values before `xcodebuild`.
6264

6365
## Manual Run Inputs (`workflow_dispatch`)
@@ -81,6 +83,7 @@ Validation rules:
8183
- At least one toggle must be `true`.
8284
- Matrix override JSON must contain at least one matrix entry.
8385
- Matrix entries must be unique by `runner + xcode`.
86+
- If `build_sdk_targets=true` or `build_test_app=true`, build matrix must include primary Xcode (`sdk_tests.xcode`).
8487
- Empty whitelist input means "use values from `ci-run-config.json`".
8588

8689
## Manual Run Guide for QA
@@ -94,7 +97,7 @@ Validation rules:
9497
5. In `Use workflow from`, select the branch.
9598
6. Configure boolean toggles:
9699
- `build_sdk_targets`: run SDK matrix + iOS package + macOS SDK build.
97-
- `build_test_app`: run test app matrix build.
100+
- `build_test_app`: run test app build on primary Xcode (`sdk_tests.xcode`).
98101
- `run_tests`: run `swift test` matrix.
99102
- `lint_pods`: run `pod lib lint`.
100103
7. (Optional) Fill JSON override fields:

.github/workflows/sdk-validation.yml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -374,6 +374,17 @@ jobs:
374374
}
375375
}
376376
377+
if (runBuildSdkTargets || runBuildTestApp) {
378+
const hasPrimaryXcodeInBuildMatrix = effectiveBuildMatrix.some(
379+
(entry) => entry.xcode === sdkTests.xcode
380+
);
381+
if (!hasPrimaryXcodeInBuildMatrix) {
382+
fail(
383+
`build_matrix must include primary sdk_tests.xcode '${sdkTests.xcode}' when build_sdk_targets or build_test_app is enabled.`
384+
);
385+
}
386+
}
387+
377388
const githubOutput = process.env.GITHUB_OUTPUT;
378389
if (!githubOutput) fail("GITHUB_OUTPUT is not set.");
379390
@@ -490,7 +501,7 @@ jobs:
490501
done
491502
492503
- name: Build SDK package for iOS (xcodebuild)
493-
if: ${{ steps.setup_xcode.outcome == 'success' }}
504+
if: ${{ steps.setup_xcode.outcome == 'success' && matrix.xcode == needs.prepare_config.outputs.sdk_xcode }}
494505
shell: bash
495506
run: |
496507
set -euo pipefail
@@ -514,7 +525,7 @@ jobs:
514525
build_test_app_matrix:
515526
name: Test app build (Xcode ${{ matrix.xcode }})
516527
needs: prepare_config
517-
if: ${{ needs.prepare_config.outputs.run_build_test_app == 'true' }}
528+
if: ${{ needs.prepare_config.outputs.run_build_test_app == 'true' && matrix.xcode == needs.prepare_config.outputs.sdk_xcode }}
518529
runs-on: ${{ matrix.runner }}
519530
timeout-minutes: 30
520531
continue-on-error: ${{ matrix.informational }}

0 commit comments

Comments
 (0)