3838 required : true
3939 matrix_linux_swift_container_image :
4040 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"
4344
4445# # We are cancelling previously triggered workflow runs
4546concurrency :
@@ -48,7 +49,7 @@ concurrency:
4849
4950jobs :
5051 test-examples :
51- name : Test Examples/${{ matrix.examples }} on ${{ matrix.swift.swift_version }}
52+ name : Test Examples/${{ matrix.examples }} on ${{ matrix.swift.image }}
5253 if : ${{ inputs.examples_enabled }}
5354 runs-on : ubuntu-latest
5455 strategy :
@@ -105,14 +106,17 @@ jobs:
105106 fail-fast : false
106107 matrix :
107108 examples : ${{ fromJson(inputs.archive_plugin_examples) }}
109+ # These must run on Ubuntu and not in a container, because the plugin uses docker
108110 steps :
109111 - name : Checkout repository
110112 uses : actions/checkout@v4
111113 with :
112114 persist-credentials : false
115+
113116 - name : Mark the workspace as safe
114117 # https://github.com/actions/checkout/issues/766
115118 run : git config --global --add safe.directory ${GITHUB_WORKSPACE}
119+
116120 - name : Test the archive plugin
117121 env :
118122 EXAMPLE : ${{ matrix.examples }}
@@ -123,14 +127,37 @@ jobs:
123127 name : No dependencies on Foundation
124128 if : ${{ inputs.check_foundation_enabled }}
125129 runs-on : ubuntu-latest
130+ container :
131+ image : ${{ inputs.matrix_linux_swift_container_image }}
126132 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+
131155 - name : Mark the workspace as safe
156+ working-directory : ${{ github.event.repository.name }} # until we can use action/checkout@v4
132157 # https://github.com/actions/checkout/issues/766
133158 run : git config --global --add safe.directory ${GITHUB_WORKSPACE}
159+
134160 - name : Check for Foundation or ICU dependency
161+ working-directory : ${{ github.event.repository.name }} # until we can use action/checkout@v4
135162 run : |
136163 .github/workflows/scripts/check-link-foundation.sh
0 commit comments