Skip to content

Commit b5c0bc8

Browse files
committed
Bump minimum supported Swift version to 5.5
## Motivation RediStack 1.x is going to be supported at least until 2.x is released, which is a few months away. Developers who are on later versions of Swift will adopt later versions of NIO and other libraries, and after we merged !183 we required NIO 2.42.x which has a minimum Swift version of 5.5 ## Changes This back ports the CI config from `master` into this branch, with updates to the README to reflect the changes
1 parent 68ccc40 commit b5c0bc8

12 files changed

+129
-156
lines changed

.gitlab/ci/amazonlinux-2.yml

Lines changed: 0 additions & 14 deletions
This file was deleted.

.gitlab/ci/centos-7.yml

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,25 @@
1-
include: '/.gitlab/ci/test-template.yml'
1+
include: '/.gitlab/ci/platform-test.yml'
22

3-
.centos7-test-workaround:
4-
extends: .unit-test
3+
.centos7:
4+
extends: .platform-test
55
before_script:
66
- yum install -y make libcurl-devel
77
- git clone https://github.com/git/git -bv2.28.0 --depth 1
88
- cd git
99
- make prefix=/usr -j all install NO_OPENSSL=1 NO_EXPAT=1 NO_TCLTK=1 NO_GETTEXT=1 NO_PERL=1
1010

1111
swift trunk:
12-
extends: .centos7-test-workaround
13-
image: swiftlang/swift:nightly-master-centos7
14-
allow_failure: true
12+
extends: .centos7
13+
image: swiftlang/swift:nightly-main-centos7
1514

16-
swift 5.3:
17-
extends: .centos7-test-workaround
18-
image: swift:5.3-centos7
15+
swift 5.7:
16+
extends: .centos7
17+
image: swiftlang/swift:nightly-5.7-centos7
1918

20-
swift 5.2:
21-
extends: .centos7-test-workaround
22-
image: swift:5.2-centos7
19+
swift 5.6:
20+
extends: .centos7
21+
image: swift:5.6-centos7
22+
23+
swift 5.5:
24+
extends: .centos7
25+
image: swift:5.5-centos7

.gitlab/ci/centos-8.yml

Lines changed: 0 additions & 14 deletions
This file was deleted.

.gitlab/ci/eol-platforms-5.5.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
include: '/.gitlab/ci/platform-test.yml'
2+
3+
swift 5.5:
4+
extends: .platform-test
5+
image: swift:5.5-${SWIFT_PLATFORM_NAME}

.gitlab/ci/main.yml

Lines changed: 38 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,8 @@
1+
include: '/.gitlab/ci/platform-test.yml'
2+
13
stages:
24
- Platform Tests
35
- Quality Checks
4-
- Docs
5-
6-
pages:
7-
stage: Docs
8-
only:
9-
- tags
10-
image: norionomura/jazzy
11-
tags:
12-
- docker
13-
variables:
14-
MODULE_NAME: "RediStack"
15-
REPO_URL: "https://gitlab.com/mordil/swift-redi-stack"
16-
script: |
17-
export VERSION=$(git describe --abbrev=0 --tags || echo "0.0.0")
18-
swift build
19-
sourcekitten doc --spm-module "$MODULE_NAME" > "./$MODULE_NAME.json"
20-
jazzy --clean \
21-
--author "Nathan Harris (Mordil)" \
22-
--readme "./README.md" \
23-
--author_url "https://www.mordil.info" \
24-
--github_url "$REPO_URL" \
25-
--github-file-prefix "$REPO_URL/blob/$VERSION" \
26-
--root-url "https://mordil.gitlab.io/swift-redi-stack/" \
27-
--module "$MODULE_NAME" \
28-
--module-version "$VERSION" \
29-
--theme docs/theme \
30-
--sourcekitten-sourcefile "./$MODULE_NAME.json" \
31-
--output "./public"
32-
artifacts:
33-
paths:
34-
- public
356

367
Code Climate:
378
only:
@@ -58,38 +29,56 @@ Code Climate:
5829
reports:
5930
codequality: gl-code-quality-report.json
6031

61-
Ubuntu Bionic:
32+
Code Coverage:
33+
extends: .platform-test
34+
stage: Quality Checks
35+
allow_failure: false
36+
image: swift:latest
37+
rules:
38+
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
39+
changes:
40+
- '*.swift'
41+
script: scripts/generate_code_coverage.sh
42+
coverage: '/TOTAL.*(\s\d+\.\d+%)/'
43+
44+
.standard-platform-test:
45+
rules:
46+
- if: $CI_PIPELINE_SOURCE == "push"
6247
stage: Platform Tests
6348
trigger:
6449
strategy: depend
65-
include: '/.gitlab/ci/ubuntu-bionic.yml'
50+
include: '/.gitlab/ci/standard-platforms.yml'
6651

6752
Ubuntu Xenial:
68-
stage: Platform Tests
53+
extends: .standard-platform-test
54+
variables:
55+
SWIFT_PLATFORM_NAME: xenial
6956
trigger:
70-
strategy: depend
71-
include: '/.gitlab/ci/ubuntu-xenial.yml'
57+
include: '/.gitlab/ci/eol-platforms-5.5.yml'
58+
59+
Ubuntu Bionic:
60+
extends: .standard-platform-test
61+
variables:
62+
SWIFT_PLATFORM_NAME: bionic
7263

7364
Ubuntu Focal:
74-
stage: Platform Tests
75-
trigger:
76-
strategy: depend
77-
include: '/.gitlab/ci/ubuntu-focal.yml'
65+
extends: .standard-platform-test
66+
variables:
67+
SWIFT_PLATFORM_NAME: focal
7868

7969
CentOS 7:
80-
stage: Platform Tests
70+
extends: .standard-platform-test
8171
trigger:
82-
strategy: depend
8372
include: '/.gitlab/ci/centos-7.yml'
8473

8574
CentOS 8:
86-
stage: Platform Tests
75+
extends: .standard-platform-test
76+
variables:
77+
SWIFT_PLATFORM_NAME: centos8
8778
trigger:
88-
strategy: depend
89-
include: '/.gitlab/ci/centos-8.yml'
79+
include: '/.gitlab/ci/eol-platforms-5.5.yml'
9080

9181
Amazon Linux 2:
92-
stage: Platform Tests
93-
trigger:
94-
strategy: depend
95-
include: '/.gitlab/ci/amazonlinux-2.yml'
82+
extends: .standard-platform-test
83+
variables:
84+
SWIFT_PLATFORM_NAME: amazonlinux2

.gitlab/ci/test-template.yml renamed to .gitlab/ci/platform-test.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
stages:
22
- Test
33

4-
.unit-test:
4+
.platform-test:
55
stage: Test
6+
allow_failure: true
67
tags:
78
- docker
89
variables:

.gitlab/ci/standard-platforms.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
include: '/.gitlab/ci/platform-test.yml'
2+
3+
swift trunk:
4+
extends: .platform-test
5+
image: swiftlang/swift:nightly-main-${SWIFT_PLATFORM_NAME}
6+
7+
swift 5.7:
8+
extends: .platform-test
9+
image: swiftlang/swift:nightly-5.7-${SWIFT_PLATFORM_NAME}
10+
11+
swift 5.6:
12+
extends: .platform-test
13+
image: swift:5.6-${SWIFT_PLATFORM_NAME}
14+
15+
swift 5.5:
16+
extends: .platform-test
17+
image: swift:5.5-${SWIFT_PLATFORM_NAME}

.gitlab/ci/ubuntu-bionic.yml

Lines changed: 0 additions & 18 deletions
This file was deleted.

.gitlab/ci/ubuntu-focal.yml

Lines changed: 0 additions & 14 deletions
This file was deleted.

.gitlab/ci/ubuntu-xenial.yml

Lines changed: 0 additions & 18 deletions
This file was deleted.

0 commit comments

Comments
 (0)