77 workflow_dispatch :
88
99env :
10- BUILDER_VERSION : v0.9.11
11- BUILDER_SOURCE : releases
12- # host owned by CRT team to host aws-crt-builder releases. Contact their on-call with any issues
13- BUILDER_HOST : https://d19elf31gohf1l.cloudfront.net
14- PACKAGE_NAME : smithy-swift
15- LINUX_BASE_IMAGE : ubuntu-16-x64
16- RUN : ${{ github.run_id }}-${{ github.run_number }}
17- AWS_SDK_SWIFT_CI_DIR : /Users/runner/work/smithy-swift/smithy-swift/target/build/deps/aws-sdk-swift
18- AWS_CRT_SWIFT_CI_DIR : /Users/runner/work/smithy-swift/smithy-swift/target/build/deps/aws-crt-swift
19- SMITHY_SWIFT_CI_DIR : /Users/runner/work/smithy-swift/smithy-swift
10+ AWS_SWIFT_SDK_USE_LOCAL_DEPS : 1
2011
2112jobs :
2213 downstream :
23- runs-on : macos-13
14+ runs-on : ${{ matrix.runner }}
2415 env :
25- DEVELOPER_DIR : /Applications/Xcode_14.3.app/Contents/Developer
16+ DEVELOPER_DIR : /Applications/${{ matrix.xcode }}.app/Contents/Developer
17+ strategy :
18+ fail-fast : false
19+ matrix :
20+ # This matrix runs tests on iOS sim & Mac, on oldest & newest supported Xcodes
21+ runner :
22+ - macos-12
23+ - macos-13
24+ xcode :
25+ - Xcode_14.0.1
26+ - Xcode_15.0
27+ destination :
28+ - ' platform=iOS Simulator,OS=16.0,name=iPhone 13'
29+ - ' platform=iOS Simulator,OS=17.0,name=iPhone 15'
30+ - ' platform=OS X'
31+ exclude :
32+ # Don't run old macOS with new Xcode
33+ - runner : macos-12
34+ xcode : Xcode_15.0
35+ # Don't run new macOS with old Xcode
36+ - runner : macos-13
37+ xcode : Xcode_14.0.1
38+ # Don't run old iOS simulator with new Xcode
39+ - destination : ' platform=iOS Simulator,OS=16.0,name=iPhone 13'
40+ xcode : Xcode_15.0
41+ # Don't run new iOS simulator with old Xcode
42+ - destination : ' platform=iOS Simulator,OS=17.0,name=iPhone 15'
43+ xcode : Xcode_14.0.1
2644 steps :
27- - name : Checkout sources
45+ - name : Checkout smithy-swift
2846 uses : actions/checkout@v3
29- - uses : actions/cache@v3
47+ - name : Select aws-sdk-swift branch
48+ run : |
49+ ORIGINAL_REPO_HEAD_REF="$GITHUB_HEAD_REF" \
50+ DEPENDENCY_REPO_URL="https://github.com/awslabs/aws-sdk-swift.git" \
51+ ./scripts/ci_steps/select_dependency_branch.sh
52+ - name : Checkout aws-sdk-swift
53+ uses : actions/checkout@v3
54+ with :
55+ repository : awslabs/aws-sdk-swift
56+ ref : ${{ env.DEPENDENCY_REPO_SHA }}
57+ path : aws-sdk-swift
58+ - name : Move aws-sdk-swift into place
59+ run : mv aws-sdk-swift ..
60+ - name : Cache Gradle
61+ uses : actions/cache@v3
3062 with :
3163 path : |
3264 ~/.gradle/caches
3365 ~/.gradle/wrapper
34- key : ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
66+ key : 1-${{ runner.os }}-gradle-${{ hashFiles('settings.gradle.kts', 'gradle/wrapper/gradle-wrapper.properties') }}
67+ restore-keys : |
68+ 1-${{ runner.os }}-gradle-${{ hashFiles('settings.gradle.kts', 'gradle/wrapper/gradle-wrapper.properties') }}
69+ 1-${{ runner.os }}-gradle-
70+ - name : Cache Swift
71+ uses : actions/cache@v3
72+ with :
73+ path : |
74+ ~/Library/Caches/org.swift.swiftpm
75+ ~/.cache/org.swift.swiftpm
76+ key : 1-${{ runner.os }}-${{ matrix.xcode }}-spm-${{ hashFiles('Package.swift') }}
3577 restore-keys : |
36- ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
37- ${{ runner.os }}-gradle-
38- - uses : actions/setup-java@v3
78+ 1-${{ runner.os }}-${{ matrix.xcode }}-spm-${{ hashFiles('Package.swift') }}
79+ 1-${{ runner.os }}-${{ matrix.xcode }}-spm-
80+ - name : Setup Java
81+ uses : actions/setup-java@v3
3982 with :
4083 distribution : corretto
4184 java-version : 17
42- - name : Build and Test ${{ env.PACKAGE_NAME }} Downstream Consumers
85+ - name : Tools Versions
86+ run : |
87+ cd ../aws-sdk-swift
88+ ./scripts/ci_steps/log_tool_versions.sh
89+ - name : Build & Run smithy-swift Kotlin Unit Tests
90+ run : ./gradlew build
91+ - name : Build & Run smithy-swift Swift Unit Tests
92+ run : |
93+ set -o pipefail && \
94+ NSUnbufferedIO=YES xcodebuild \
95+ -scheme smithy-swift-Package \
96+ -destination '${{ matrix.destination }}' \
97+ test 2>&1 \
98+ | xcpretty
99+ - name : Prepare aws-sdk-swift Protocol & Unit Tests
43100 run : |
44- python3 -c "from urllib.request import urlretrieve; urlretrieve('${{ env.BUILDER_HOST }}/${{ env.BUILDER_SOURCE }}/${{ env.BUILDER_VERSION }}/builder.pyz?run=${{ env.RUN }}', 'builder')"
45- chmod a+x builder
46- AWS_CRT_SWIFT_CI_DIR="${{ env.AWS_CRT_SWIFT_CI_DIR }}" AWS_SDK_SWIFT_CI_DIR="${{ env.AWS_SDK_SWIFT_CI_DIR }}" SMITHY_SWIFT_CI_DIR="${{ env.SMITHY_SWIFT_CI_DIR }}" AWS_SWIFT_SDK_USE_LOCAL_DEPS=1 ./builder build -p ${{ env.PACKAGE_NAME }} --spec downstream
101+ cd ../aws-sdk-swift
102+ ./scripts/ci_steps/prepare_protocol_and_unit_tests.sh
103+ - name : Build and Run aws-sdk-swift Protocol & Unit Tests
104+ run : |
105+ cd ../aws-sdk-swift
106+ set -o pipefail && \
107+ NSUnbufferedIO=YES xcodebuild \
108+ -scheme aws-sdk-swift \
109+ -destination '${{ matrix.destination }}' \
110+ test 2>&1 \
111+ | xcpretty
112+
47113 linux :
48114 runs-on : ubuntu-latest
49115 strategy :
@@ -57,14 +123,41 @@ jobs:
57123 container :
58124 image : swift:${{ matrix.swift }}
59125 steps :
126+ - name : Checkout Sources
127+ uses : actions/checkout@v3
60128 - name : Install openssl
61129 run : |
62130 if [ -x "$(command -v apt)" ]; then
63131 apt-get update && apt-get install -y libssl-dev
64132 else
65- yum install -y openssl-devel
133+ yum install -y openssl-devel which
66134 fi
67- - name : Checkout Sources
68- uses : actions/checkout@v3
69- - name : Build and Test
135+ - name : Cache Gradle
136+ uses : actions/cache@v3
137+ with :
138+ path : |
139+ ~/.gradle/caches
140+ ~/.gradle/wrapper
141+ key : 1-${{ runner.os }}-gradle-${{ hashFiles('settings.gradle.kts', 'gradle/wrapper/gradle-wrapper.properties') }}
142+ restore-keys : |
143+ 1-${{ runner.os }}-gradle-${{ hashFiles('settings.gradle.kts', 'gradle/wrapper/gradle-wrapper.properties') }}
144+ 1-${{ runner.os }}-gradle-
145+ - name : Cache Swift
146+ uses : actions/cache@v3
147+ with :
148+ path : |
149+ ~/Library/Caches/org.swift.swiftpm
150+ ~/.cache/org.swift.swiftpm
151+ key : 1-${{ runner.os }}-${{ matrix.xcode }}-spm-${{ hashFiles('Package.swift') }}
152+ restore-keys : |
153+ 1-${{ runner.os }}-${{ matrix.xcode }}-spm-${{ hashFiles('Package.swift') }}
154+ 1-${{ runner.os }}-${{ matrix.xcode }}-spm-
155+ - name : Setup Java
156+ uses : actions/setup-java@v3
157+ with :
158+ distribution : corretto
159+ java-version : 17
160+ - name : Build & Run Kotlin Unit Tests
161+ run : ./gradlew build
162+ - name : Build & Run Swift Unit Tests
70163 run : swift test
0 commit comments