Skip to content

Commit

Permalink
Misc cleanups (#40)
Browse files Browse the repository at this point in the history
* Update projectboard.yml
* Update test.yml
* Update Exports.swift
* Delete .swift-version
* Update Package.swift (min Swift and package versions)
* Update README.md
  • Loading branch information
gwynne committed May 30, 2023
1 parent fe81158 commit 09fac77
Show file tree
Hide file tree
Showing 6 changed files with 58 additions and 63 deletions.
28 changes: 4 additions & 24 deletions .github/workflows/projectboard.yml
Expand Up @@ -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
67 changes: 38 additions & 29 deletions .github/workflows/test.yml
@@ -1,57 +1,66 @@
name: test
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on:
pull_request: { branches: ['*'] }
push: { branches: ['main'] }
pull_request: { types: [opened, reopened, synchronize, ready_for_review] }
push: { branches: [ main ] }

env:
LOG_LEVEL: debug
LOG_LEVEL: info
SWIFT_DETERMINISTIC_HASHING: 1
REDIS_HOSTNAME: redis

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
runs-on: ubuntu-latest
container: ${{ matrix.container }}
services:
redis:
image: redis:6
image: ${{ matrix.redis }}
ports: ["6379:6379"]
runs-on: ubuntu-latest
steps:
- name: Save Redis version to env
run: |
echo REDIS_VERSION='${{ matrix.redis }}' >> $GITHUB_ENV
- name: Display versions
shell: bash
run: |
if [[ '${{ contains(matrix.container, 'nightly') }}' == 'true' ]]; then
SWIFT_PLATFORM="$(source /etc/os-release && echo "${ID}${VERSION_ID}")" SWIFT_VERSION="$(cat /.swift_tag)"
printf 'SWIFT_PLATFORM=%s\nSWIFT_VERSION=%s\n' "${SWIFT_PLATFORM}" "${SWIFT_VERSION}" >>"${GITHUB_ENV}"
fi
printf 'OS: %s\nTag: %s\nVersion:\n' "${SWIFT_PLATFORM}-${RUNNER_ARCH}" "${SWIFT_VERSION}" && swift --version
- 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 source
uses: actions/checkout@v3
- name: Run unit tests with Thread Sanitizer and coverage
run: swift test --sanitize=thread --enable-code-coverage
- name: Submit coverage report to Codecov.io
uses: vapor/swift-codecov-action@v0.2
with:
fetch-depth: 0
- name: Build
run: swift build -Xswiftc -DBUILDING_DOCC
cc_env_vars: 'SWIFT_VERSION,SWIFT_PLATFORM,RUNNER_OS,RUNNER_ARCH,REDIS_VERSION'
cc_fail_ci_if_error: false
1 change: 0 additions & 1 deletion .swift-version

This file was deleted.

8 changes: 4 additions & 4 deletions Package.swift
@@ -1,4 +1,4 @@
// swift-tools-version:5.5.2
// swift-tools-version:5.6
import PackageDescription

let package = Package(
Expand All @@ -16,9 +16,9 @@ let package = Package(
)
],
dependencies: [
.package(url: "https://github.com/vapor/vapor.git", from: "4.0.0"),
.package(url: "https://github.com/vapor/queues.git", from: "1.0.0"),
.package(url: "https://github.com/vapor/redis.git", from: "4.0.0"),
.package(url: "https://github.com/vapor/vapor.git", from: "4.76.3"),
.package(url: "https://github.com/vapor/queues.git", from: "1.12.1"),
.package(url: "https://github.com/vapor/redis.git", from: "4.8.0"),
],
targets: [
.target(
Expand Down
9 changes: 6 additions & 3 deletions README.md
Expand Up @@ -15,10 +15,13 @@
<a href="LICENSE">
<img src="http://img.shields.io/badge/license-MIT-brightgreen.svg" alt="MIT License">
</a>
<a href="https://github.com/vapor/queues-redis-driver/actions">
<img src="https://github.com/vapor/queues-redis-driver/workflows/test/badge.svg" alt="Continuous Integration">
<a href="https://github.com/vapor/queues-redis-driver/actions/workflows/test.yml">
<img src="https://github.com/vapor/queues-redis-driver/actions/workflows/test.yml/badge.svg?event=push" alt="Continuous Integration">
</a>
<a href="https://swift.org">
<img src="http://img.shields.io/badge/swift-5.5-brightgreen.svg" alt="Swift 5.5">
<img src="http://img.shields.io/badge/swift-5.6-brightgreen.svg" alt="Swift 5.6">
</a>
<a href="https://swift.org">
<img src="http://img.shields.io/badge/swift-5.8-brightgreen.svg" alt="Swift 5.8">
</a>
</p>
8 changes: 6 additions & 2 deletions Sources/QueuesRedisDriver/Exports.swift
@@ -1,5 +1,9 @@
#if !BUILDING_DOCC
#if swift(>=5.8)

@_documentation(visibility: internal) @_exported import Redis

#else

@_exported import Redis

#endif
#endif

0 comments on commit 09fac77

Please sign in to comment.