From 2a8d3e4639b90b39b74309b54216bdfd9cb52b41 Mon Sep 17 00:00:00 2001 From: Gwynne Raskind Date: Tue, 20 Jun 2023 11:32:15 -0500 Subject: [PATCH] Correct RediStack URL and match Vapor's minimum Swift version (#211) * Correct RediStack URL and match Vapor's min Swift version * Update Exports.swift * Delete .swiftlint.yml --- .github/workflows/projectboard.yml | 28 ++------------ .github/workflows/test.yml | 60 +++++++++++++++--------------- .swiftlint.yml | 13 ------- Package.swift | 4 +- README.md | 4 +- Sources/Redis/Docs.docc/index.md | 2 +- Sources/Redis/Exports.swift | 9 ++++- 7 files changed, 46 insertions(+), 74 deletions(-) delete mode 100644 .swiftlint.yml diff --git a/.github/workflows/projectboard.yml b/.github/workflows/projectboard.yml index 0e4e66f..a0e6d98 100644 --- a/.github/workflows/projectboard.yml +++ b/.github/workflows/projectboard.yml @@ -5,27 +5,7 @@ on: types: [reopened, closed, labeled, unlabeled, assigned, unassigned] jobs: - setup_matrix_input: - runs-on: ubuntu-latest - - steps: - - id: set-matrix - run: | - output=$(curl ${{ github.event.issue.url }}/labels | jq '.[] | .name') || output="" - - echo '======================' - echo 'Process incoming data' - echo '======================' - json=$(echo $output | sed 's/"\s"/","/g') - echo $json - echo "::set-output name=matrix::$(echo $json)" - outputs: - issueTags: ${{ steps.set-matrix.outputs.matrix }} - - Manage_project_issues: - needs: setup_matrix_input - uses: vapor/ci/.github/workflows/issues-to-project-board.yml@main - with: - labelsJson: ${{ needs.setup_matrix_input.outputs.issueTags }} - secrets: - PROJECT_BOARD_AUTOMATION_PAT: "${{ secrets.PROJECT_BOARD_AUTOMATION_PAT }}" + update_project_boards: + name: Update project boards + uses: vapor/ci/.github/workflows/update-project-boards-for-issue.yml@reusable-workflows + secrets: inherit diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 80a18c8..3e00f1f 100755 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,10 +1,12 @@ name: test on: - pull_request: { branches: ['*'] } - push: { branches: ['main'] } - + pull_request: { types: [opened, reopened, synchronize, ready_for_review] } + push: { branches: [ main ] } +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true env: - LOG_LEVEL: debug + LOG_LEVEL: info SWIFT_DETERMINISTIC_HASHING: 1 REDIS_HOSTNAME: redis REDIS_PORT: 6379 @@ -13,50 +15,46 @@ env: jobs: api-breakage: - if: github.event_name == 'pull_request' + if: ${{ !(github.event.pull_request.draft || false) }} runs-on: ubuntu-latest - container: swift:5.7-jammy + container: swift:5.8-jammy steps: - - name: Check out package + - name: Check out code uses: actions/checkout@v3 - with: - fetch-depth: 0 - # https://github.com/actions/checkout/issues/766 - - name: Mark the workspace as safe - run: git config --global --add safe.directory ${GITHUB_WORKSPACE} - - name: Check for API breaking changes - run: swift package diagnose-api-breaking-changes origin/main + with: { 'fetch-depth': 0 } + - name: Run API breakage check action + uses: vapor/ci/.github/actions/ci-swift-check-api-breakage@reusable-workflows linux-unit: + if: ${{ !(github.event.pull_request.draft || false) }} strategy: fail-fast: false matrix: container: - - swift:5.5-bionic - swift:5.6-focal - swift:5.7-jammy + - swift:5.8-jammy + - swiftlang/swift:nightly-5.9-jammy + - swiftlang/swift:nightly-main-jammy + redis: + - redis:6 + - redis:7 container: ${{ matrix.container }} services: redis: - image: redis:6 + image: ${{ matrix.redis }} redis-2: - image: redis:6 + image: ${{ matrix.redis }} runs-on: ubuntu-latest steps: + - name: Save Redis version to env + run: | + echo REDIS_VERSION='${{ matrix.redis }}' >> $GITHUB_ENV - name: Check out package uses: actions/checkout@v3 - name: Run unit tests with Thread Sanitizer - run: swift test --sanitize=thread - - # TODO: Use reusable workflow - - test-exports: - name: Test exports - runs-on: ubuntu-latest - steps: - - name: Check out Vapor - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Build - run: swift build -Xswiftc -DBUILDING_DOCC + run: swift test --sanitize=thread --enable-code-coverage + - name: Upload code coverage + uses: vapor/swift-codecov-action@v0.2 + with: + cc_env_vars: 'SWIFT_VERSION,SWIFT_PLATFORM,RUNNER_OS,RUNNER_ARCH,REDIS_VERSION' diff --git a/.swiftlint.yml b/.swiftlint.yml deleted file mode 100644 index 0673cc8..0000000 --- a/.swiftlint.yml +++ /dev/null @@ -1,13 +0,0 @@ -excluded: - - .build - -nesting: - type_level: 2 - -opt_in_rules: - - closure_end_indentation - - literal_expression_end_indentation - -identifier_name: - excluded: - - id diff --git a/Package.swift b/Package.swift index 83c8770..5b60819 100644 --- a/Package.swift +++ b/Package.swift @@ -1,4 +1,4 @@ -// swift-tools-version:5.5.2 +// swift-tools-version:5.6 import PackageDescription let package = Package( @@ -13,7 +13,7 @@ let package = Package( .library(name: "Redis", targets: ["Redis"]) ], dependencies: [ - .package(url: "https://gitlab.com/swift-server-community/RediStack.git", from: "1.4.1"), + .package(url: "https://github.com/swift-server/RediStack.git", from: "1.4.1"), .package(url: "https://github.com/vapor/vapor.git", from: "4.50.0"), ], targets: [ diff --git a/README.md b/README.md index 12b0993..34cff5c 100644 --- a/README.md +++ b/README.md @@ -15,8 +15,8 @@ CI - Swift 5.5 + Swift 5.6 -This project is based off the Redis driver RediStack. For the majority of API documentation, refer to docs.redistack.info. +This project is based off the Redis driver RediStack. For the majority of API documentation, refer to the RediStack documentation homepage.

diff --git a/Sources/Redis/Docs.docc/index.md b/Sources/Redis/Docs.docc/index.md index 92ba631..21b7435 100644 --- a/Sources/Redis/Docs.docc/index.md +++ b/Sources/Redis/Docs.docc/index.md @@ -1,6 +1,6 @@ # ``Redis`` -Redis is a library to integrate [RediStack](https://gitlab.com/swift-server-community/RediStack) with Vapor. It provides a number of extensions to both make configuring a Vapor application with Redis simple and to provide Redis implementations for Vapor protocols, such as the cache. +Redis is a library to integrate [RediStack](https://github.com/swift-server/RediStack) with Vapor. It provides a number of extensions to both make configuring a Vapor application with Redis simple and to provide Redis implementations for Vapor protocols, such as the cache. ## Overview diff --git a/Sources/Redis/Exports.swift b/Sources/Redis/Exports.swift index 57dc76f..d663d90 100644 --- a/Sources/Redis/Exports.swift +++ b/Sources/Redis/Exports.swift @@ -1,4 +1,11 @@ -#if !BUILDING_DOCC +#if swift(>=5.8) + +@_documentation(visibility: internal) @_exported import RediStack +@_documentation(visibility: internal) @_exported import struct Foundation.URL +@_documentation(visibility: internal) @_exported import struct Logging.Logger +@_documentation(visibility: internal) @_exported import struct NIO.TimeAmount + +#else @_exported import RediStack @_exported import struct Foundation.URL