38
38
required : true
39
39
matrix_linux_swift_container_image :
40
40
type : string
41
- description : " Container image for the matrix job. Defaults to matching latest Swift 6.1 Amazon Linux 2 image."
42
- default : " swiftlang/swift:nightly-6.1-amazonlinux2"
41
+ # Note: we don't use Amazon Linux 2 here because zip is not installed by default.
42
+ description : " Container image for the matrix test jobs. Defaults to Swift 6.2 on Amazon Linux 2."
43
+ default : " swift:6.2-amazonlinux2"
43
44
44
45
# # We are cancelling previously triggered workflow runs
45
46
concurrency :
@@ -48,7 +49,7 @@ concurrency:
48
49
49
50
jobs :
50
51
test-examples :
51
- name : Test Examples/${{ matrix.examples }} on ${{ matrix.swift.swift_version }}
52
+ name : Test Examples/${{ matrix.examples }} on ${{ matrix.swift.image }}
52
53
if : ${{ inputs.examples_enabled }}
53
54
runs-on : ubuntu-latest
54
55
strategy :
@@ -105,14 +106,17 @@ jobs:
105
106
fail-fast : false
106
107
matrix :
107
108
examples : ${{ fromJson(inputs.archive_plugin_examples) }}
109
+ # These must run on Ubuntu and not in a container, because the plugin uses docker
108
110
steps :
109
111
- name : Checkout repository
110
112
uses : actions/checkout@v4
111
113
with :
112
114
persist-credentials : false
115
+
113
116
- name : Mark the workspace as safe
114
117
# https://github.com/actions/checkout/issues/766
115
118
run : git config --global --add safe.directory ${GITHUB_WORKSPACE}
119
+
116
120
- name : Test the archive plugin
117
121
env :
118
122
EXAMPLE : ${{ matrix.examples }}
@@ -123,14 +127,37 @@ jobs:
123
127
name : No dependencies on Foundation
124
128
if : ${{ inputs.check_foundation_enabled }}
125
129
runs-on : ubuntu-latest
130
+ container :
131
+ image : ${{ inputs.matrix_linux_swift_container_image }}
126
132
steps :
127
- - name : Checkout repository
128
- uses : actions/checkout@v4
129
- with :
130
- persist-credentials : false
133
+ # GitHub checkout action has a dep on NodeJS 20 which is not running on Amazonlinux2
134
+ # workaround is to manually checkout the repository
135
+ # https://github.com/actions/checkout/issues/1487
136
+ - name : Manually Clone repository and checkout PR
137
+ env :
138
+ PR_NUMBER : ${{ github.event.pull_request.number }}
139
+ run : |
140
+ # Clone the repository
141
+ git clone https://github.com/${{ github.repository }}
142
+ cd ${{ github.event.repository.name }}
143
+
144
+ # Fetch the pull request
145
+ git fetch origin +refs/pull/$PR_NUMBER/merge:
146
+
147
+ # Checkout the pull request
148
+ git checkout -qf FETCH_HEAD
149
+
150
+ # - name: Checkout repository
151
+ # uses: actions/checkout@v4
152
+ # with:
153
+ # persist-credentials: false
154
+
131
155
- name : Mark the workspace as safe
156
+ working-directory : ${{ github.event.repository.name }} # until we can use action/checkout@v4
132
157
# https://github.com/actions/checkout/issues/766
133
158
run : git config --global --add safe.directory ${GITHUB_WORKSPACE}
159
+
134
160
- name : Check for Foundation or ICU dependency
161
+ working-directory : ${{ github.event.repository.name }} # until we can use action/checkout@v4
135
162
run : |
136
163
.github/workflows/scripts/check-link-foundation.sh
0 commit comments