1
+ name : ExamplesMatrix
2
+
3
+ on :
4
+ workflow_call :
5
+ inputs :
6
+ name :
7
+ type : string
8
+ description : " The name of the workflow used for the concurrency group."
9
+ required : true
10
+ matrix_linux_command :
11
+ type : string
12
+ description : " The command of the current Swift version linux matrix job to execute."
13
+ required : true
14
+ matrix_linux_nightly_6_0_enabled :
15
+ type : boolean
16
+ description : " Boolean to enable the nightly 6.0 Swift version matrix job. Defaults to true."
17
+ default : true
18
+ matrix_linux_nightly_6_0_container_image :
19
+ type : string
20
+ description : " Container image for the nightly 6.0 Swift version matrix job. Defaults to matching Swift Ubuntu image."
21
+ default : " swiftlang/swift:nightly-6.0-jammy"
22
+ matrix_linux_nightly_6_0_command_override :
23
+ type : string
24
+ description : " The command of the nightly 6.0 Swift version linux matrix job to execute."
25
+ matrix_linux_nightly_main_enabled :
26
+ type : boolean
27
+ description : " Boolean to enable the nightly main Swift version matrix job. Defaults to true."
28
+ default : true
29
+ matrix_linux_nightly_main_container_image :
30
+ type : string
31
+ description : " Container image for the nightly main Swift version matrix job. Defaults to matching Swift Ubuntu image."
32
+ default : " swiftlang/swift:nightly-main-jammy"
33
+ matrix_linux_nightly_main_command_override :
34
+ type : string
35
+ description : " The command of the nightly main Swift version linux matrix job to execute."
36
+
37
+ # # We are cancelling previously triggered workflow runs
38
+ concurrency :
39
+ group : ${{ github.workflow }}-${{ github.ref }}-${{ inputs.name }}
40
+ cancel-in-progress : true
41
+
42
+ jobs :
43
+ linux :
44
+ name : Linux (${{ matrix.swift.swift_version }})
45
+ runs-on : ubuntu-latest
46
+ strategy :
47
+ fail-fast : false
48
+ matrix :
49
+ examples : [ "HelloWorld", "APIGateway" ]
50
+ # We are specifying only the major and minor of the docker images to automatically pick up the latest patch release
51
+ swift :
52
+ - image : ${{ inputs.matrix_linux_nightly_6_0_container_image }}
53
+ swift_version : " nightly-6.0"
54
+ enabled : ${{ inputs.matrix_linux_nightly_6_0_enabled }}
55
+ - image : ${{ inputs.matrix_linux_nightly_main_container_image }}
56
+ swift_version : " nightly-main"
57
+ enabled : ${{ inputs.matrix_linux_nightly_main_enabled }}
58
+ container :
59
+ image : ${{ matrix.swift.image }}
60
+ steps :
61
+ - name : Checkout repository
62
+ if : ${{ matrix.swift.enabled }}
63
+ uses : actions/checkout@v4
64
+ with :
65
+ persist-credentials : false
66
+ - name : Mark the workspace as safe
67
+ if : ${{ matrix.swift.enabled }}
68
+ # https://github.com/actions/checkout/issues/766
69
+ run : git config --global --add safe.directory ${GITHUB_WORKSPACE}
70
+ - name : Run matrix job
71
+ if : ${{ matrix.swift.enabled }}
72
+ env :
73
+ SWIFT_VERSION : ${{ matrix.swift.swift_version }}
74
+ COMMAND : ${{ inputs.matrix_linux_command }}
75
+ COMMAND_OVERRIDE_NIGHTLY_6_0 : ${{ inputs.matrix_linux_nightly_6_0_command_override }}
76
+ COMMAND_OVERRIDE_NIGHTLY_MAIN : ${{ inputs.matrix_linux_nightly_main_command_override }}
77
+ EXAMPLE : ${{ matrix.examples }}
78
+ run : |
79
+ apt-get -qq update && apt-get -qq -y install curl
80
+ ./scripts/integration_tests.sh
0 commit comments