-
Notifications
You must be signed in to change notification settings - Fork 26
133 lines (130 loc) · 5.82 KB
/
swift_matrix.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
name: Matrix
on:
workflow_call:
inputs:
name:
type: string
description: "The name of the workflow used for the concurrency group."
required: true
matrix_linux_command:
type: string
description: "The command of the current Swift version linux matrix job to execute."
required: true
matrix_linux_5_9_enabled:
type: boolean
description: "Boolean to enable the 5.9 Swift version matrix job. Defaults to true."
default: true
matrix_linux_5_9_container_image:
type: string
description: "Container image for the 5.9 Swift version matrix job. Defaults to matching Swift Ubuntu image."
default: "swift:5.9-jammy"
matrix_linux_5_9_command_override:
type: string
description: "The command of the 5.9 Swift version linux matrix job to execute."
matrix_linux_5_10_enabled:
type: boolean
description: "Boolean to enable the 5.10 Swift version matrix job. Defaults to true."
default: true
matrix_linux_5_10_container_image:
type: string
description: "Container image for the 5.10 Swift version matrix job. Defaults to matching Swift Ubuntu image."
default: "swift:5.10-jammy"
matrix_linux_5_10_command_override:
type: string
description: "The command of the 5.10 Swift version linux matrix job to execute."
matrix_linux_6_0_enabled:
type: boolean
description: "Boolean to enable the 6.0 Swift version matrix job. Defaults to true."
default: true
matrix_linux_6_0_container_image:
type: string
description: "Container image for the 6.0 Swift version matrix job. Defaults to matching Swift Ubuntu image."
default: "swift:6.0-jammy"
matrix_linux_6_0_command_override:
type: string
description: "The command of the 6.0 Swift version linux matrix job to execute."
matrix_linux_nightly_6_0_enabled:
type: boolean
description: "Boolean to enable the nightly 6.0 Swift version matrix job. Defaults to true."
default: true
matrix_linux_nightly_6_0_container_image:
type: string
description: "Container image for the nightly 6.0 Swift version matrix job. Defaults to matching Swift Ubuntu image."
default: "swiftlang/swift:nightly-6.0-jammy"
matrix_linux_nightly_6_0_command_override:
type: string
description: "The command of the nightly 6.0 Swift version linux matrix job to execute."
matrix_linux_nightly_main_enabled:
type: boolean
description: "Boolean to enable the nightly main Swift version matrix job. Defaults to true."
default: true
matrix_linux_nightly_main_container_image:
type: string
description: "Container image for the nightly main Swift version matrix job. Defaults to matching Swift Ubuntu image."
default: "swiftlang/swift:nightly-main-jammy"
matrix_linux_nightly_main_command_override:
type: string
description: "The command of the nightly main Swift version linux matrix job to execute."
# We are cancelling previously triggered workflow runs
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ inputs.name }}
cancel-in-progress: true
jobs:
linux:
name: Linux (${{ matrix.swift.swift_version }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
# We are specifying only the major and minor of the docker images to automatically pick up the latest patch release
swift:
- image: ${{ inputs.matrix_linux_5_9_container_image }}
swift_version: "5.9"
enabled: ${{ inputs.matrix_linux_5_9_enabled }}
- image: ${{ inputs.matrix_linux_5_10_container_image }}
swift_version: "5.10"
enabled: ${{ inputs.matrix_linux_5_10_enabled }}
- image: ${{ inputs.matrix_linux_6_0_container_image }}
swift_version: "6.0"
enabled: ${{ inputs.matrix_linux_6_0_enabled }}
- image: ${{ inputs.matrix_linux_nightly_6_0_container_image }}
swift_version: "nightly-6.0"
enabled: ${{ inputs.matrix_linux_nightly_6_0_enabled }}
- image: ${{ inputs.matrix_linux_nightly_main_container_image }}
swift_version: "nightly-main"
enabled: ${{ inputs.matrix_linux_nightly_main_enabled }}
container:
image: ${{ matrix.swift.image }}
steps:
- name: Checkout repository
if: ${{ matrix.swift.enabled }}
uses: actions/checkout@v4
with:
persist-credentials: false
submodules: true
- name: Mark the workspace as safe
if: ${{ matrix.swift.enabled }}
# https://github.com/actions/checkout/issues/766
run: git config --global --add safe.directory ${GITHUB_WORKSPACE}
- name: Run matrix job
if: ${{ matrix.swift.enabled }}
env:
SWIFT_VERSION: ${{ matrix.swift.swift_version }}
COMMAND: ${{ inputs.matrix_linux_command }}
COMMAND_OVERRIDE_5_9: ${{ inputs.matrix_linux_5_9_command_override }}
COMMAND_OVERRIDE_5_10: ${{ inputs.matrix_linux_5_10_command_override }}
COMMAND_OVERRIDE_6_0: ${{ inputs.matrix_linux_6_0_command_override }}
COMMAND_OVERRIDE_NIGHTLY_6_0: ${{ inputs.matrix_linux_nightly_6_0_command_override }}
COMMAND_OVERRIDE_NIGHTLY_MAIN: ${{ inputs.matrix_linux_nightly_main_command_override }}
run: |
apt-get -qq update && apt-get -qq -y install curl && apt-get -y install libsasl2-dev
curl -s https://raw.githubusercontent.com/apple/swift-nio/main/scripts/check-matrix-job.sh | bash
services:
zookeeper:
image: ubuntu/zookeeper
kafka:
image: ubuntu/kafka
env:
ZOOKEEPER_HOST: zookeeper
env:
KAFKA_HOST: kafka