Skip to content

Commit 7ddabf8

Browse files
authored
Enable release mode builds (#198)
### Motivation: Some errors do not show up in debug builds. Enabling release mode builds improves the CI coverage. ### Modifications: Enable release mode builds for pull requests and scheduled builds on main. ### Result: Improved CI coverage.
1 parent 4b4bc0c commit 7ddabf8

File tree

3 files changed

+116
-0
lines changed

3 files changed

+116
-0
lines changed

.github/workflows/main.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,7 @@ jobs:
1616
linux_6_1_arguments_override: "--explicit-target-dependency-import-check error"
1717
linux_nightly_next_arguments_override: "--explicit-target-dependency-import-check error"
1818
linux_nightly_main_arguments_override: "--explicit-target-dependency-import-check error"
19+
20+
release-builds:
21+
name: Release builds
22+
uses: ./.github/workflows/release_builds.yml

.github/workflows/pull_request.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,7 @@ jobs:
4545
with:
4646
name: "Cxx interop"
4747
matrix_string: '${{ needs.construct-cxx-matrix.outputs.cxx-interop-matrix }}'
48+
49+
release-builds:
50+
name: Release builds
51+
uses: ./.github/workflows/release_builds.yml

.github/workflows/release_builds.yml

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
name: Release builds
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
linux_5_9_enabled:
7+
type: boolean
8+
description: "Boolean to enable the Linux 5.9 Swift version matrix job. Defaults to false."
9+
default: false
10+
linux_5_9_arguments_override:
11+
type: string
12+
description: "The arguments passed to swift build in the Linux 5.9 Swift version matrix job."
13+
default: ""
14+
linux_5_10_enabled:
15+
type: boolean
16+
description: "Boolean to enable the Linux 5.10 Swift version matrix job. Defaults to true."
17+
default: true
18+
linux_5_10_arguments_override:
19+
type: string
20+
description: "The arguments passed to swift build in the Linux 5.10 Swift version matrix job."
21+
default: ""
22+
linux_6_0_enabled:
23+
type: boolean
24+
description: "Boolean to enable the Linux 6.0 Swift version matrix job. Defaults to true."
25+
default: true
26+
linux_6_0_arguments_override:
27+
type: string
28+
description: "The arguments passed to swift build in the Linux 6.0 Swift version matrix job."
29+
default: ""
30+
linux_6_1_enabled:
31+
type: boolean
32+
description: "Boolean to enable the Linux 6.1 Swift version matrix job. Defaults to true."
33+
default: true
34+
linux_6_1_arguments_override:
35+
type: string
36+
description: "The arguments passed to swift build in the Linux 6.1 Swift version matrix job."
37+
default: ""
38+
linux_nightly_next_enabled:
39+
type: boolean
40+
description: "Boolean to enable the Linux nightly next Swift version matrix job. Defaults to true."
41+
default: true
42+
linux_nightly_next_arguments_override:
43+
type: string
44+
description: "The arguments passed to swift build in the Linux nightly next Swift version matrix job."
45+
default: ""
46+
linux_nightly_main_enabled:
47+
type: boolean
48+
description: "Boolean to enable the Linux nightly main Swift version matrix job. Defaults to true."
49+
default: true
50+
linux_nightly_main_arguments_override:
51+
type: string
52+
description: "The arguments passed to swift build in the Linux nightly main Swift version matrix job."
53+
default: ""
54+
55+
jobs:
56+
release-builds:
57+
name: Release builds (${{ matrix.swift.swift_version }})
58+
runs-on: ubuntu-latest
59+
strategy:
60+
fail-fast: false
61+
matrix:
62+
# We are specifying only the major and minor of the docker images to automatically pick up the latest patch release
63+
swift:
64+
- image: "swift:5.9-jammy"
65+
swift_version: "5.9"
66+
enabled: ${{ inputs.linux_5_9_enabled }}
67+
- image: "swift:5.10-jammy"
68+
swift_version: "5.10"
69+
enabled: ${{ inputs.linux_5_10_enabled }}
70+
- image: "swift:6.0-jammy"
71+
swift_version: "6.0"
72+
enabled: ${{ inputs.linux_6_0_enabled }}
73+
- image: "swift:6.1-jammy"
74+
swift_version: "6.1"
75+
enabled: ${{ inputs.linux_6_1_enabled }}
76+
- image: "swiftlang/swift:nightly-6.1-jammy"
77+
swift_version: "nightly-6.1"
78+
enabled: ${{ inputs.linux_nightly_next_enabled }}
79+
- image: "swiftlang/swift:nightly-main-jammy"
80+
swift_version: "nightly-main"
81+
enabled: ${{ inputs.linux_nightly_main_enabled }}
82+
steps:
83+
- name: Checkout repository
84+
if: ${{ matrix.swift.enabled }}
85+
uses: actions/checkout@v4
86+
with:
87+
persist-credentials: false
88+
submodules: true
89+
- name: Mark the workspace as safe
90+
if: ${{ matrix.swift.enabled }}
91+
# https://github.com/actions/checkout/issues/766
92+
run: git config --global --add safe.directory ${GITHUB_WORKSPACE}
93+
- name: Run matrix job
94+
if: ${{ matrix.swift.enabled }}
95+
env:
96+
SWIFT_VERSION: ${{ matrix.swift.swift_version }}
97+
COMMAND: "swift build -c release"
98+
COMMAND_OVERRIDE_5_9: "swift build -c release ${{ inputs.linux_5_9_arguments_override }}"
99+
COMMAND_OVERRIDE_5_10: "swift build -c release ${{ inputs.linux_5_10_arguments_override }}"
100+
COMMAND_OVERRIDE_6_0: "swift build -c release ${{ inputs.linux_6_0_arguments_override }}"
101+
COMMAND_OVERRIDE_6_1: "swift build -c release ${{ inputs.linux_6_1_arguments_override }}"
102+
COMMAND_OVERRIDE_NIGHTLY_NEXT: "swift build -c release ${{ inputs.linux_nightly_next_arguments_override }}"
103+
COMMAND_OVERRIDE_NIGHTLY_MAIN: "swift build -c release ${{ inputs.linux_nightly_main_arguments_override }}"
104+
run: |
105+
apt-get -qq update && apt-get -qq -y install curl && apt-get -y install libsasl2-dev libssl-dev
106+
curl -s https://raw.githubusercontent.com/apple/swift-nio/main/scripts/check-matrix-job.sh | bash
107+
container:
108+
image: ${{ matrix.swift.image }}

0 commit comments

Comments
 (0)