Skip to content

Commit 639224f

Browse files
committed
Use only one Swift version to build the examples
1 parent dd84d7c commit 639224f

File tree

2 files changed

+8
-48
lines changed

2 files changed

+8
-48
lines changed

.github/workflows/examples_matrix.yml

Lines changed: 6 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -11,35 +11,14 @@ on:
1111
# type: sequence
1212
# description: "The examples to run."
1313
# required: true
14-
matrix_linux_command_override:
15-
type: string
16-
description: "The command of the current Swift version linux matrix job to execute."
1714
matrix_linux_command:
1815
type: string
1916
description: "The command of the current Swift version linux matrix job to execute."
2017
required: true
21-
matrix_linux_nightly_6_0_enabled:
22-
type: boolean
23-
description: "Boolean to enable the nightly 6.0 Swift version matrix job. Defaults to true."
24-
default: true
25-
matrix_linux_nightly_6_0_container_image:
26-
type: string
27-
description: "Container image for the nightly 6.0 Swift version matrix job. Defaults to matching Swift Ubuntu image."
28-
default: "swiftlang/swift:nightly-6.0-jammy"
29-
matrix_linux_nightly_6_0_command_override:
30-
type: string
31-
description: "The command of the nightly 6.0 Swift version linux matrix job to execute."
32-
matrix_linux_nightly_main_enabled:
33-
type: boolean
34-
description: "Boolean to enable the nightly main Swift version matrix job. Defaults to true."
35-
default: true
36-
matrix_linux_nightly_main_container_image:
37-
type: string
38-
description: "Container image for the nightly main Swift version matrix job. Defaults to matching Swift Ubuntu image."
39-
default: "swiftlang/swift:nightly-main-jammy"
40-
matrix_linux_nightly_main_command_override:
18+
matrix_linux_swift_container_image:
4119
type: string
42-
description: "The command of the nightly main Swift version linux matrix job to execute."
20+
description: "Container image for the 6.0 Swift version matrix job. Defaults to matching latest Swift Ubuntu image."
21+
default: "swiftlang/swift:6.0.1-noble"
4322

4423
## We are cancelling previously triggered workflow runs
4524
concurrency:
@@ -57,33 +36,24 @@ jobs:
5736
examples : [ "HelloWorld", "APIGateway" ]
5837
# examples: ${{ inputs.examples }}
5938

60-
# We are specifying only the major and minor of the docker images to automatically pick up the latest patch release
39+
# We are using only one Swift version
6140
swift:
62-
- image: ${{ inputs.matrix_linux_nightly_6_0_container_image }}
63-
swift_version: "nightly-6.0"
64-
enabled: ${{ inputs.matrix_linux_nightly_6_0_enabled }}
65-
- image: ${{ inputs.matrix_linux_nightly_main_container_image }}
66-
swift_version: "nightly-main"
67-
enabled: ${{ inputs.matrix_linux_nightly_main_enabled }}
41+
- image: ${{ inputs.matrix_linux_swift_container_image }}
42+
swift_version: "6.0.1-noble"
6843
container:
6944
image: ${{ matrix.swift.image }}
7045
steps:
7146
- name: Checkout repository
72-
if: ${{ matrix.swift.enabled }}
7347
uses: actions/checkout@v4
7448
with:
7549
persist-credentials: false
7650
- name: Mark the workspace as safe
77-
if: ${{ matrix.swift.enabled }}
7851
# https://github.com/actions/checkout/issues/766
7952
run: git config --global --add safe.directory ${GITHUB_WORKSPACE}
8053
- name: Run matrix job
81-
if: ${{ matrix.swift.enabled }}
8254
env:
8355
SWIFT_VERSION: ${{ matrix.swift.swift_version }}
8456
COMMAND: ${{ inputs.matrix_linux_command }}
85-
COMMAND_OVERRIDE_NIGHTLY_6_0: ${{ inputs.matrix_linux_nightly_6_0_command_override }}
86-
COMMAND_OVERRIDE_NIGHTLY_MAIN: ${{ inputs.matrix_linux_nightly_main_command_override }}
8757
EXAMPLE: ${{ matrix.examples }}
8858
run: |
8959
apt-get -qq update && apt-get -qq -y install curl

scripts/integration_tests.sh

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -24,21 +24,11 @@ test -n "${COMMAND:-}" || fatal "COMMAND unset"
2424
test -n "${EXAMPLE:-}" || fatal "EXAMPLE unset"
2525
swift_version="$SWIFT_VERSION"
2626
command="$COMMAND"
27-
command_nightly_6_0="$COMMAND_OVERRIDE_NIGHTLY_6_0"
28-
command_nightly_main="$COMMAND_OVERRIDE_NIGHTLY_MAIN"
2927
example="$EXAMPLE"
3028

3129
pushd Examples/"$example" > /dev/null
3230

33-
if [[ "$swift_version" == "nightly-6.0" ]] && [[ -n "$command_nightly_6_0" ]]; then
34-
log "Running nightly 6.0 command override"
35-
eval "$command_nightly_6_0"
36-
elif [[ "$swift_version" == "nightly-main" ]] && [[ -n "$command_nightly_main" ]]; then
37-
log "Running nightly main command override"
38-
eval "$command_nightly_main"
39-
else
40-
log "Running default command"
41-
eval "$command"
42-
fi
31+
log "Running command with Swift $SWIFT_VERSION"
32+
eval "$command"
4333

4434
popd

0 commit comments

Comments
 (0)