-
Notifications
You must be signed in to change notification settings - Fork 17
150 lines (142 loc) · 5.72 KB
/
ci.yml
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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
name: CI
on:
push:
branches-ignore:
- 'main'
env:
BUILDER_VERSION: v0.9.73
BUILDER_SOURCE: releases
BUILDER_HOST: https://d19elf31gohf1l.cloudfront.net
PACKAGE_NAME: aws-crt-swift
RUN: ${{ github.run_id }}-${{ github.run_number }}
CRT_CI_ROLE: ${{ secrets.CRT_CI_ROLE_ARN }}
AWS_DEFAULT_REGION: us-east-1
permissions:
id-token: write # This is required for requesting the JWT
jobs:
lint:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- name: GitHub Action for SwiftLint
uses: norio-nomura/[email protected]
linux:
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
image:
- ubuntu-x64
- al2-x64
# issue to fix centos opened against apple here: https://github.com/apple/swift-docker/issues/258
# - centos-x64
steps:
- uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ env.CRT_CI_ROLE }}
aws-region: ${{ env.AWS_DEFAULT_REGION }}
- name: Build ${{ env.PACKAGE_NAME }}
run: |
aws s3 cp --debug s3://aws-crt-test-stuff/ci/${{ env.BUILDER_VERSION }}/linux-container-ci.sh ./linux-container-ci.sh && chmod a+x ./linux-container-ci.sh
./linux-container-ci.sh ${{ env.BUILDER_VERSION }} aws-crt-swift-5-${{ matrix.image }} build -p ${{ env.PACKAGE_NAME }}
macos:
runs-on: ${{ matrix.runner }}
env:
DEVELOPER_DIR: /Applications/Xcode.app
XCODE_DESTINATION: 'OS X'
NSUnbufferedIO: YES
strategy:
fail-fast: false
matrix:
# This matrix runs tests on Mac, on oldest & newest supported Xcodes
runner:
- macos-13 # x64
- macos-14
- macos-13-xlarge
- macos-14-large #x64
steps:
- uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ env.CRT_CI_ROLE }}
aws-region: ${{ env.AWS_DEFAULT_REGION }}
- name: Build ${{ env.PACKAGE_NAME }} + consumers
run: |
python3 -c "from urllib.request import urlretrieve; urlretrieve('${{ env.BUILDER_HOST }}/${{ env.BUILDER_SOURCE }}/${{ env.BUILDER_VERSION }}/builder.pyz?run=${{ env.RUN }}', 'builder')"
chmod a+x builder
./builder build -p ${{ env.PACKAGE_NAME }}
devices:
runs-on: ${{ matrix.runner }}
env:
DEVELOPER_DIR: /Applications/${{ matrix.xcode }}.app/Contents/Developer
XCODE_DESTINATION: ${{matrix.target.destination}}
NSUnbufferedIO: YES
strategy:
fail-fast: false
matrix:
# This matrix runs tests on iOS, tvOS & watchOS, on oldest & newest supported Xcodes
runner:
- macos-13 # x64
- macos-14
- macos-13-xlarge
- macos-14-large #x64
target:
[{ os: ios, destination: 'iOS Simulator,OS=16.1,name=iPhone 14'},
{ os: ios, destination: 'iOS Simulator,OS=17.2,name=iPhone 15'},
{ os: tvos, destination: 'tvOS Simulator,OS=16.1,name=Apple TV 4K (3rd generation) (at 1080p)'},
{ os: tvos, destination: 'tvOS Simulator,OS=17.2,name=Apple TV 4K (3rd generation) (at 1080p)'},
{ os: watchos, destination: 'watchOS Simulator,OS=10.2,name=Apple Watch SE (40mm) (2nd generation)'},
{ os: watchos, destination: 'watchOS Simulator,OS=9.1,name=Apple Watch Series 5 (40mm)'}]
xcode:
- Xcode_14.1
- Xcode_15.2
exclude:
# Don't run old macOS with new Xcode
- runner: macos-13-xlarge
xcode: Xcode_15.2
- runner: macos-13
xcode: Xcode_15.2
# Don't run new macOS with old Xcode
- runner: macos-14-large
xcode: Xcode_14.1
- runner: macos-14
xcode: Xcode_14.1
# Don't run old simulators with new Xcode
- target: { os: tvos, destination: 'tvOS Simulator,OS=16.1,name=Apple TV 4K (3rd generation) (at 1080p)'}
xcode: Xcode_15.2
- target: { os: ios, destination: 'iOS Simulator,OS=16.1,name=iPhone 14'}
xcode: Xcode_15.2
# Don't run new simulators with old Xcode
- target: { os: tvos, destination: 'tvOS Simulator,OS=17.2,name=Apple TV 4K (3rd generation) (at 1080p)'}
xcode: Xcode_14.1
- target: { os: ios, destination: 'iOS Simulator,OS=17.2,name=iPhone 15'}
xcode: Xcode_14.1
- target: { os: watchos, destination: 'watchOS Simulator,OS=10.2,name=Apple Watch SE (40mm) (2nd generation)'}
xcode: Xcode_14.1
- target: { os: watchos, destination: 'watchOS Simulator,OS=9.1,name=Apple Watch Series 5 (40mm)'}
xcode: Xcode_15.2
steps:
- uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ env.CRT_CI_ROLE }}
aws-region: ${{ env.AWS_DEFAULT_REGION }}
- name: Build ${{ env.PACKAGE_NAME }} + consumers
run: |
python3 -c "from urllib.request import urlretrieve; urlretrieve('${{ env.BUILDER_HOST }}/${{ env.BUILDER_SOURCE }}/${{ env.BUILDER_VERSION }}/builder.pyz?run=${{ env.RUN }}', 'builder')"
chmod a+x builder
./builder build -p ${{ env.PACKAGE_NAME }} --target=${{ matrix.target.os }}-armv8
check-submodules:
runs-on: ubuntu-24.04 # latest
steps:
- uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ env.CRT_CI_ROLE }}
aws-region: ${{ env.AWS_DEFAULT_REGION }}
- name: Checkout Source
uses: actions/checkout@v4
with:
submodules: true
fetch-depth: 0
- name: Check Submodules
# note: using "@main" because "@${{env.BUILDER_VERSION}}" doesn't work
# https://github.com/actions/runner/issues/480
uses: awslabs/aws-crt-builder/.github/actions/check-submodules@main