-
Notifications
You must be signed in to change notification settings - Fork 236
106 lines (95 loc) · 3.76 KB
/
Copy pathbuild_xcode_preview.yml
File metadata and controls
106 lines (95 loc) · 3.76 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
name: Build | Xcode Preview (Beta)
# Early-warning signal for the next Xcode release.
#
# This runs against the `xcode-27` preview runner image, which ships a single
# beta Xcode as the image default. It intentionally does NOT use the
# get_platform_parameters composite action: that action allowlists only the
# Xcode versions Amplify Swift officially supports, and the preview image is
# deliberately outside that set.
#
# This workflow is advisory and non-blocking: every job sets continue-on-error,
# so a failure here surfaces the next Xcode's breakages on the PR that
# introduces them without ever blocking a merge. Preview images run a beta
# toolchain and can have constrained capacity, so they are not a merge gate.
on:
pull_request:
branches:
- main
push:
branches:
- main
workflow_dispatch:
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: ${{ github.ref_name != 'main' }}
jobs:
build-and-test:
name: ${{ matrix.platform }} on Xcode preview
# Preview images can have constrained capacity, so keep the matrix small.
runs-on: xcode-27
continue-on-error: true
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
include:
- platform: macOS
destination: 'platform=macOS,arch=arm64'
sdk: macosx
run_tests: true
- platform: iOS
# Generic destination rather than a named device: the preview image's
# simulator device lineup changes between beta rollouts. A generic
# destination cannot boot a simulator, so this leg is build-only.
destination: 'generic/platform=iOS Simulator'
sdk: iphonesimulator
run_tests: false
steps:
- name: Checkout Code
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 #v4.1.1
with:
persist-credentials: false
- name: Report toolchain under test
run: |
# Use the image default Xcode rather than a hardcoded path — the
# preview image's beta version string changes between rollouts.
xcodebuild -version
swift --version
- name: Install xcbeautify
run: brew list xcbeautify >/dev/null 2>&1 || brew install xcbeautify
- name: Build Amplify Swift for ${{ matrix.platform }}
run: |
set -o pipefail
xcodebuild build \
-scheme Amplify-Package \
-sdk '${{ matrix.sdk }}' \
-destination '${{ matrix.destination }}' \
-skipPackagePluginValidation \
| xcbeautify --renderer github-actions && exit ${PIPESTATUS[0]}
- name: Run unit tests for ${{ matrix.platform }}
if: ${{ matrix.run_tests }}
run: |
set -o pipefail
xcodebuild test \
-scheme Amplify-Package \
-sdk '${{ matrix.sdk }}' \
-destination '${{ matrix.destination }}' \
-skipPackagePluginValidation \
| xcbeautify --renderer github-actions && exit ${PIPESTATUS[0]}
report:
name: Report Preview Status
runs-on: ubuntu-latest
if: ${{ !cancelled() }}
needs: [ build-and-test ]
steps:
- name: Summarize
run: |
RESULT="${{ needs.build-and-test.result }}"
if [ "$RESULT" = "success" ]; then
echo "Amplify Swift builds and tests cleanly on the Xcode preview toolchain." >> $GITHUB_STEP_SUMMARY
else
echo "Amplify Swift hit failures on the Xcode preview toolchain (result: $RESULT)." >> $GITHUB_STEP_SUMMARY
echo "This is advisory only and does not block this PR. Investigate before the next Xcode reaches GA." >> $GITHUB_STEP_SUMMARY
fi