-
Notifications
You must be signed in to change notification settings - Fork 420
176 lines (176 loc) · 7.6 KB
/
ci.yaml
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
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
preflight:
name: License Header and Formatting Checks
runs-on: ubuntu-latest
container:
image: swiftlang/swift:nightly-6.0-jammy
steps:
- name: "Checkout repository"
uses: actions/checkout@v4
- name: Mark the workspace as safe
run: git config --global --add safe.directory ${GITHUB_WORKSPACE}
- name: "Install protoc"
run: apt update && apt install -y protobuf-compiler
- name: "Formatting, License Headers, and Generated Code check"
run: |
./scripts/sanity.sh
unit-tests:
strategy:
fail-fast: false
matrix:
include:
- image: swiftlang/swift:nightly-jammy
# No TSAN because of: https://github.com/apple/swift/issues/59068
# swift-test-flags: "--sanitize=thread"
- image: swiftlang/swift:nightly-6.0-jammy
# No TSAN because of: https://github.com/apple/swift/issues/59068
# swift-test-flags: "--sanitize=thread"
- image: swift:5.10.1-noble
# No TSAN because of: https://github.com/apple/swift/issues/59068
# swift-test-flags: "--sanitize=thread"
- image: swift:5.9-jammy
# No TSAN because of: https://github.com/apple/swift/issues/59068
# swift-test-flags: "--sanitize=thread"
- image: swift:5.8-focal
# No TSAN because of: https://github.com/apple/swift/issues/59068
# swift-test-flags: "--sanitize=thread"
name: Build and Test on ${{ matrix.image }}
runs-on: ubuntu-latest
container:
image: ${{ matrix.image }}
steps:
- uses: actions/checkout@v4
- name: 🔧 Build
run: swift build ${{ matrix.swift-build-flags }}
timeout-minutes: 20
- name: 🧪 Test
run: swift test ${{ matrix.swift-test-flags }}
timeout-minutes: 20
performance-tests:
strategy:
fail-fast: false
matrix:
include:
- image: swiftlang/swift:nightly-jammy
swift-version: 'main'
env:
MAX_ALLOCS_ALLOWED_bidi_1k_rpcs_10_requests: 323000
MAX_ALLOCS_ALLOWED_bidi_1k_rpcs_1_request: 161000
MAX_ALLOCS_ALLOWED_embedded_server_bidi_1k_rpcs_10_small_requests: 110000
MAX_ALLOCS_ALLOWED_embedded_server_bidi_1k_rpcs_1_small_request: 65000
MAX_ALLOCS_ALLOWED_embedded_server_unary_1k_rpcs_1_small_request: 61000
MAX_ALLOCS_ALLOWED_unary_1k_ping_pong: 163000
MAX_ALLOCS_ALLOWED_unary_1k_ping_pong_interceptors_client: 170000
MAX_ALLOCS_ALLOWED_unary_1k_ping_pong_interceptors_server: 170000
- image: swiftlang/swift:nightly-6.0-jammy
swift-version: '6.0'
env:
MAX_ALLOCS_ALLOWED_bidi_1k_rpcs_10_requests: 323000
MAX_ALLOCS_ALLOWED_bidi_1k_rpcs_1_request: 161000
MAX_ALLOCS_ALLOWED_embedded_server_bidi_1k_rpcs_10_small_requests: 110000
MAX_ALLOCS_ALLOWED_embedded_server_bidi_1k_rpcs_1_small_request: 65000
MAX_ALLOCS_ALLOWED_embedded_server_unary_1k_rpcs_1_small_request: 61000
MAX_ALLOCS_ALLOWED_unary_1k_ping_pong: 163000
MAX_ALLOCS_ALLOWED_unary_1k_ping_pong_interceptors_client: 170000
MAX_ALLOCS_ALLOWED_unary_1k_ping_pong_interceptors_server: 170000
- image: swift:5.10.1-noble
swift-version: '5.10'
env:
MAX_ALLOCS_ALLOWED_bidi_1k_rpcs_10_requests: 323000
MAX_ALLOCS_ALLOWED_bidi_1k_rpcs_1_request: 161000
MAX_ALLOCS_ALLOWED_embedded_server_bidi_1k_rpcs_10_small_requests: 110000
MAX_ALLOCS_ALLOWED_embedded_server_bidi_1k_rpcs_1_small_request: 65000
MAX_ALLOCS_ALLOWED_embedded_server_unary_1k_rpcs_1_small_request: 61000
MAX_ALLOCS_ALLOWED_unary_1k_ping_pong: 163000
MAX_ALLOCS_ALLOWED_unary_1k_ping_pong_interceptors_client: 170000
MAX_ALLOCS_ALLOWED_unary_1k_ping_pong_interceptors_server: 170000
- image: swift:5.9-jammy
swift-version: 5.9
env:
MAX_ALLOCS_ALLOWED_bidi_1k_rpcs_10_requests: 323000
MAX_ALLOCS_ALLOWED_bidi_1k_rpcs_1_request: 161000
MAX_ALLOCS_ALLOWED_embedded_server_bidi_1k_rpcs_10_small_requests: 110000
MAX_ALLOCS_ALLOWED_embedded_server_bidi_1k_rpcs_1_small_request: 65000
MAX_ALLOCS_ALLOWED_embedded_server_unary_1k_rpcs_1_small_request: 61000
MAX_ALLOCS_ALLOWED_unary_1k_ping_pong: 163000
MAX_ALLOCS_ALLOWED_unary_1k_ping_pong_interceptors_client: 170000
MAX_ALLOCS_ALLOWED_unary_1k_ping_pong_interceptors_server: 170000
- image: swift:5.8-focal
swift-version: 5.8
env:
MAX_ALLOCS_ALLOWED_bidi_1k_rpcs_10_requests: 323000
MAX_ALLOCS_ALLOWED_bidi_1k_rpcs_1_request: 161000
MAX_ALLOCS_ALLOWED_embedded_server_bidi_1k_rpcs_10_small_requests: 110000
MAX_ALLOCS_ALLOWED_embedded_server_bidi_1k_rpcs_1_small_request: 65000
MAX_ALLOCS_ALLOWED_embedded_server_unary_1k_rpcs_1_small_request: 61000
MAX_ALLOCS_ALLOWED_unary_1k_ping_pong: 163000
MAX_ALLOCS_ALLOWED_unary_1k_ping_pong_interceptors_client: 170000
MAX_ALLOCS_ALLOWED_unary_1k_ping_pong_interceptors_server: 170000
name: Performance Tests on ${{ matrix.image }}
runs-on: ubuntu-latest
container:
image: ${{ matrix.image }}
steps:
- uses: actions/checkout@v4
- name: 🧮 Allocation Counting Tests
run: ./Performance/allocations/test-allocation-counts.sh
env: ${{ matrix.env }}
timeout-minutes: 20
- name: Install jemalloc for benchmarking
if: ${{ matrix.swift-version == '6.0' || matrix.swift-version == 'main' }}
run: apt update && apt-get install -y libjemalloc-dev
timeout-minutes: 20
- name: Run Benchmarks
if: ${{ matrix.swift-version == '6.0' || matrix.swift-version == 'main' }}
working-directory: ./Performance/Benchmarks
run: swift package benchmark baseline check --no-progress --check-absolute-path Thresholds/${{ matrix.swift-version }}/
timeout-minutes: 20
integration-tests:
strategy:
fail-fast: false
matrix:
include:
- image: swiftlang/swift:nightly-jammy
swift-tools-version: '6.0'
supports-v2: true
- image: swiftlang/swift:nightly-6.0-jammy
swift-tools-version: '6.0'
supports-v2: true
- image: swift:5.10.1-noble
swift-tools-version: '5.10'
supports-v2: false
- image: swift:5.9-jammy
swift-tools-version: '5.9'
supports-v2: false
- image: swift:5.8-focal
swift-tools-version: '5.8'
supports-v2: false
name: Integration Tests on ${{ matrix.image }}
runs-on: ubuntu-latest
container:
image: ${{ matrix.image }}
steps:
- uses: actions/checkout@v4
- name: Install protoc
run: apt update && apt install -y protobuf-compiler
- name: SwiftPM plugin test (v1)
run: ./scripts/run-plugin-tests.sh ${{ matrix.swift-tools-version }} "v1"
- name: SwiftPM plugin test (v2)
if: ${{ matrix.supports-v2 }}
run: ./scripts/run-plugin-tests.sh ${{ matrix.swift-tools-version }} "v2"
- name: Build without NIOSSL
run: swift build
env:
GRPC_NO_NIO_SSL: 1
timeout-minutes: 20
- name: Test without NIOSSL
run: swift test
env:
GRPC_NO_NIO_SSL: 1
timeout-minutes: 20