diff --git a/.gitlab/ci/amazonlinux-2.yml b/.gitlab/ci/amazonlinux-2.yml deleted file mode 100644 index 703f8b8..0000000 --- a/.gitlab/ci/amazonlinux-2.yml +++ /dev/null @@ -1,14 +0,0 @@ -include: '/.gitlab/ci/test-template.yml' - -swift trunk: - extends: .unit-test - image: swiftlang/swift:nightly-master-amazonlinux2 - allow_failure: true - -swift 5.3: - extends: .unit-test - image: swift:5.3-amazonlinux2 - -swift 5.2: - extends: .unit-test - image: swift:5.2-amazonlinux2 diff --git a/.gitlab/ci/centos-7.yml b/.gitlab/ci/centos-7.yml index 81c8ab6..784b1ff 100644 --- a/.gitlab/ci/centos-7.yml +++ b/.gitlab/ci/centos-7.yml @@ -1,7 +1,7 @@ -include: '/.gitlab/ci/test-template.yml' +include: '/.gitlab/ci/platform-test.yml' -.centos7-test-workaround: - extends: .unit-test +.centos7: + extends: .platform-test before_script: - yum install -y make libcurl-devel - git clone https://github.com/git/git -bv2.28.0 --depth 1 @@ -9,14 +9,17 @@ include: '/.gitlab/ci/test-template.yml' - make prefix=/usr -j all install NO_OPENSSL=1 NO_EXPAT=1 NO_TCLTK=1 NO_GETTEXT=1 NO_PERL=1 swift trunk: - extends: .centos7-test-workaround - image: swiftlang/swift:nightly-master-centos7 - allow_failure: true + extends: .centos7 + image: swiftlang/swift:nightly-main-centos7 -swift 5.3: - extends: .centos7-test-workaround - image: swift:5.3-centos7 +swift 5.7: + extends: .centos7 + image: swiftlang/swift:nightly-5.7-centos7 -swift 5.2: - extends: .centos7-test-workaround - image: swift:5.2-centos7 +swift 5.6: + extends: .centos7 + image: swift:5.6-centos7 + +swift 5.5: + extends: .centos7 + image: swift:5.5-centos7 diff --git a/.gitlab/ci/centos-8.yml b/.gitlab/ci/centos-8.yml deleted file mode 100644 index cfda413..0000000 --- a/.gitlab/ci/centos-8.yml +++ /dev/null @@ -1,14 +0,0 @@ -include: '/.gitlab/ci/test-template.yml' - -swift trunk: - extends: .unit-test - image: swiftlang/swift:nightly-master-centos8 - allow_failure: true - -swift 5.3: - extends: .unit-test - image: swift:5.3-centos8 - -swift 5.2: - extends: .unit-test - image: swift:5.2-centos8 diff --git a/.gitlab/ci/eol-platforms-5.5.yml b/.gitlab/ci/eol-platforms-5.5.yml new file mode 100644 index 0000000..f85d824 --- /dev/null +++ b/.gitlab/ci/eol-platforms-5.5.yml @@ -0,0 +1,5 @@ +include: '/.gitlab/ci/platform-test.yml' + +swift 5.5: + extends: .platform-test + image: swift:5.5-${SWIFT_PLATFORM_NAME} diff --git a/.gitlab/ci/main.yml b/.gitlab/ci/main.yml index c92595c..ea824de 100644 --- a/.gitlab/ci/main.yml +++ b/.gitlab/ci/main.yml @@ -1,37 +1,8 @@ +include: '/.gitlab/ci/platform-test.yml' + stages: - Platform Tests - Quality Checks - - Docs - -pages: - stage: Docs - only: - - tags - image: norionomura/jazzy - tags: - - docker - variables: - MODULE_NAME: "RediStack" - REPO_URL: "https://gitlab.com/mordil/swift-redi-stack" - script: | - export VERSION=$(git describe --abbrev=0 --tags || echo "0.0.0") - swift build - sourcekitten doc --spm-module "$MODULE_NAME" > "./$MODULE_NAME.json" - jazzy --clean \ - --author "Nathan Harris (Mordil)" \ - --readme "./README.md" \ - --author_url "https://www.mordil.info" \ - --github_url "$REPO_URL" \ - --github-file-prefix "$REPO_URL/blob/$VERSION" \ - --root-url "https://mordil.gitlab.io/swift-redi-stack/" \ - --module "$MODULE_NAME" \ - --module-version "$VERSION" \ - --theme docs/theme \ - --sourcekitten-sourcefile "./$MODULE_NAME.json" \ - --output "./public" - artifacts: - paths: - - public Code Climate: only: @@ -58,38 +29,56 @@ Code Climate: reports: codequality: gl-code-quality-report.json -Ubuntu Bionic: +Code Coverage: + extends: .platform-test + stage: Quality Checks + allow_failure: false + image: swift:latest + rules: + - if: $CI_PIPELINE_SOURCE == "merge_request_event" + changes: + - '*.swift' + script: scripts/generate_code_coverage.sh + coverage: '/TOTAL.*(\s\d+\.\d+%)/' + +.standard-platform-test: + rules: + - if: $CI_PIPELINE_SOURCE == "push" stage: Platform Tests trigger: strategy: depend - include: '/.gitlab/ci/ubuntu-bionic.yml' + include: '/.gitlab/ci/standard-platforms.yml' Ubuntu Xenial: - stage: Platform Tests + extends: .standard-platform-test + variables: + SWIFT_PLATFORM_NAME: xenial trigger: - strategy: depend - include: '/.gitlab/ci/ubuntu-xenial.yml' + include: '/.gitlab/ci/eol-platforms-5.5.yml' + +Ubuntu Bionic: + extends: .standard-platform-test + variables: + SWIFT_PLATFORM_NAME: bionic Ubuntu Focal: - stage: Platform Tests - trigger: - strategy: depend - include: '/.gitlab/ci/ubuntu-focal.yml' + extends: .standard-platform-test + variables: + SWIFT_PLATFORM_NAME: focal CentOS 7: - stage: Platform Tests + extends: .standard-platform-test trigger: - strategy: depend include: '/.gitlab/ci/centos-7.yml' CentOS 8: - stage: Platform Tests + extends: .standard-platform-test + variables: + SWIFT_PLATFORM_NAME: centos8 trigger: - strategy: depend - include: '/.gitlab/ci/centos-8.yml' + include: '/.gitlab/ci/eol-platforms-5.5.yml' Amazon Linux 2: - stage: Platform Tests - trigger: - strategy: depend - include: '/.gitlab/ci/amazonlinux-2.yml' + extends: .standard-platform-test + variables: + SWIFT_PLATFORM_NAME: amazonlinux2 diff --git a/.gitlab/ci/test-template.yml b/.gitlab/ci/platform-test.yml similarity index 89% rename from .gitlab/ci/test-template.yml rename to .gitlab/ci/platform-test.yml index 76314da..fb59147 100644 --- a/.gitlab/ci/test-template.yml +++ b/.gitlab/ci/platform-test.yml @@ -1,8 +1,9 @@ stages: - Test -.unit-test: +.platform-test: stage: Test + allow_failure: true tags: - docker variables: diff --git a/.gitlab/ci/standard-platforms.yml b/.gitlab/ci/standard-platforms.yml new file mode 100644 index 0000000..7ca840d --- /dev/null +++ b/.gitlab/ci/standard-platforms.yml @@ -0,0 +1,17 @@ +include: '/.gitlab/ci/platform-test.yml' + +swift trunk: + extends: .platform-test + image: swiftlang/swift:nightly-main-${SWIFT_PLATFORM_NAME} + +swift 5.7: + extends: .platform-test + image: swiftlang/swift:nightly-5.7-${SWIFT_PLATFORM_NAME} + +swift 5.6: + extends: .platform-test + image: swift:5.6-${SWIFT_PLATFORM_NAME} + +swift 5.5: + extends: .platform-test + image: swift:5.5-${SWIFT_PLATFORM_NAME} diff --git a/.gitlab/ci/ubuntu-bionic.yml b/.gitlab/ci/ubuntu-bionic.yml deleted file mode 100644 index 5c9181e..0000000 --- a/.gitlab/ci/ubuntu-bionic.yml +++ /dev/null @@ -1,18 +0,0 @@ -include: '/.gitlab/ci/test-template.yml' - -swift trunk: - extends: .unit-test - image: swiftlang/swift:nightly-master-bionic - allow_failure: true - -swift 5.3: - extends: .unit-test - image: swift:5.3-bionic - -swift 5.2: - extends: .unit-test - image: swift:5.2-bionic - -swift 5.1: - extends: .unit-test - image: swift:5.1-bionic diff --git a/.gitlab/ci/ubuntu-focal.yml b/.gitlab/ci/ubuntu-focal.yml deleted file mode 100644 index d16ef9d..0000000 --- a/.gitlab/ci/ubuntu-focal.yml +++ /dev/null @@ -1,14 +0,0 @@ -include: '/.gitlab/ci/test-template.yml' - -swift trunk: - extends: .unit-test - image: swiftlang/swift:nightly-master-focal - allow_failure: true - -swift 5.3: - extends: .unit-test - image: swift:5.3-focal - -swift 5.2: - extends: .unit-test - image: swift:5.2-focal diff --git a/.gitlab/ci/ubuntu-xenial.yml b/.gitlab/ci/ubuntu-xenial.yml deleted file mode 100644 index d3336fb..0000000 --- a/.gitlab/ci/ubuntu-xenial.yml +++ /dev/null @@ -1,18 +0,0 @@ -include: '/.gitlab/ci/test-template.yml' - -swift trunk: - extends: .unit-test - image: swiftlang/swift:nightly-master-xenial - allow_failure: true - -swift 5.3: - extends: .unit-test - image: swift:5.3-xenial - -swift 5.2: - extends: .unit-test - image: swift:5.2-xenial - -swift 5.1: - extends: .unit-test - image: swift:5.1-xenial diff --git a/Package.swift b/Package.swift index 711135d..92f6b6d 100644 --- a/Package.swift +++ b/Package.swift @@ -1,4 +1,4 @@ -// swift-tools-version:5.1 +// swift-tools-version:5.5 //===----------------------------------------------------------------------===// // // This source file is part of the RediStack open source project @@ -28,11 +28,43 @@ let package = Package( .package(url: "https://github.com/apple/swift-nio.git", from: "2.43.0"), ], targets: [ - .target(name: "RediStack", dependencies: ["NIO", "Logging", "Metrics"]), + .target( + name: "RediStack", + dependencies: [ + .product(name: "NIO", package: "swift-nio"), + .product(name: "Logging", package: "swift-log"), + .product(name: "Metrics", package: "swift-metrics") + ] + ), .target(name: "RedisTypes", dependencies: ["RediStack"]), - .target(name: "RediStackTestUtils", dependencies: ["NIO", "RediStack"]), - .testTarget(name: "RediStackTests", dependencies: ["RediStack", "NIO", "RediStackTestUtils", "NIOTestUtils"]), - .testTarget(name: "RedisTypesTests", dependencies: ["RediStack", "NIO", "RediStackTestUtils", "RedisTypes"]), - .testTarget(name: "RediStackIntegrationTests", dependencies: ["RediStack", "NIO", "RediStackTestUtils"]) + .target( + name: "RediStackTestUtils", + dependencies: [ + .product(name: "NIO", package: "swift-nio"), + "RediStack" + ] + ), + .testTarget( + name: "RediStackTests", + dependencies: [ + "RediStack", "RediStackTestUtils", + .product(name: "NIO", package: "swift-nio"), + .product(name: "NIOTestUtils", package: "swift-nio") + ] + ), + .testTarget( + name: "RedisTypesTests", + dependencies: [ + "RediStack", "RedisTypes", "RediStackTestUtils", + .product(name: "NIO", package: "swift-nio") + ] + ), + .testTarget( + name: "RediStackIntegrationTests", + dependencies: [ + "RediStack", "RediStackTestUtils", + .product(name: "NIO", package: "swift-nio") + ] + ) ] ) diff --git a/README.md b/README.md index 29dfd5d..93b78ec 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@
@@ -32,6 +32,7 @@ The table below lists the major releases alongside their compatible language, de | RediStack Release | [Swift](https://swift.org/download) | [Redis](https://redis.io) | [SwiftNIO](https://github.com/apple/swift-nio) | [SwiftLog](https://github.com/apple/swift-log) | [SwiftMetrics](https://github.com/apple/swift-metrics) | |:-----------------:|:-----------------------------------:|:-------------------------:|:----------------------------------------------:|:----------------------------------------------:|:------------------------------:| | `from: "1.0.0"` | 5.1+ | 3.x**¹** < 6.x | 2.x | 1.x | 1.x ..< 3.0 | +| `from: "1.4.0"` | 5.5+ | 3.x**¹** < 6.x | 2.x | 1.x | 1.x ..< 3.0 | > **¹** _Use of newer Redis features on older Redis versions is done at your own risk. See Redis' release notes for [v5](https://raw.githubusercontent.com/antirez/redis/5.0/00-RELEASENOTES), [v4](https://raw.githubusercontent.com/antirez/redis/4.0/00-RELEASENOTES), and [v3](https://raw.githubusercontent.com/antirez/redis/3.0/00-RELEASENOTES) for what is supported for each version of Redis._ @@ -117,15 +118,18 @@ This policy is to balance the desire for as much backwards compatibility as poss The following table shows the combination of Swift language versions and operating systems that receive regular unit testing (either in development, or with CI). -| Platform | Swift 5.1 | 5.2 | 5.3 | Trunk | -|:----------------------|:------------------:|:------------------:|:------------------:|:------------------:| -| macOS Latest (Intel) | | | :white_check_mark: | | -| Ubuntu 20.04 (Focal) | | :white_check_mark: | :white_check_mark: | :white_check_mark: | -| Ubuntu 18.04 (Bionic) | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | -| Ubuntu 16.04 (Xenial) | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | -| Amazon Linux 2 | | :white_check_mark: | :white_check_mark: | :white_check_mark: | -| CentOS 7 | | :white_check_mark: | :white_check_mark: | :white_check_mark: | -| CentOS 8 | | :white_check_mark: | :white_check_mark: | :white_check_mark: | +| Platform | Swift 5.5 | 5.6 | 5.7 | Trunk | +|:----------------------------|:---------:|:---:|:---:|:-----:| +| macOS Latest (M1) | | | ✅ | | +| Ubuntu 20.04 (Focal) | ✅ | ✅ | ✅ | ✅ | +| Ubuntu 18.04 (Bionic) | ✅ | ✅ | ✅ | ✅ | +| Ubuntu 16.04 (Xenial)**³** | ✅ | ❌ | ❌ | ❌ | +| Amazon Linux 2 | ✅ | ✅ | ✅ | ✅ | +| CentOS 8**³** | ✅ | ❌ | ❌ | ❌ | +| CentOS 7 | ✅ | ✅ | ✅ | ✅ | + +> **³** _CentOS 8 and Ubuntu 16.04 are no longer officially supported by Swift after [Swift 5.5](https://github.com/apple/swift-docker/pull/273)._ + ## License