Skip to content

Commit

Permalink
Tidy up package a bit (#103)
Browse files Browse the repository at this point in the history
* Bump Swift and swift-crypto versions
* CI update
* Add dependabot.yml
* Update README
* Add vapor-mysqlnio-logo.svg
* Add theme-settings.json
* Update api-docs.yml
* Add CODEOWNERS
  • Loading branch information
gwynne committed Jan 17, 2024
1 parent cf3ecfa commit 605fe1d
Show file tree
Hide file tree
Showing 8 changed files with 147 additions and 49 deletions.
6 changes: 6 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
* @gwynne
/.github/CONTRIBUTING.md @gwynne @0xTim
/.spi.yml @gwynne @0xTim
/.gitignore @gwynne @0xTim
/LICENSE @gwynne @0xTim
/README.md @gwynne @0xTim
21 changes: 21 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
version: 2
enable-beta-ecosystems: true
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
groups:
dependencies:
patterns:
- "*"
- package-ecosystem: "swift"
directory: "/"
schedule:
interval: "daily"
allow:
- dependency-type: all
groups:
all-dependencies:
patterns:
- "*"
2 changes: 1 addition & 1 deletion .github/workflows/api-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ jobs:
with:
package_name: mysql-nio
modules: MySQLNIO
pathsToInvalidate: /mysqlnio
pathsToInvalidate: /mysqlnio/*
89 changes: 61 additions & 28 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,64 @@ env:
MYSQL_HOSTNAME_B: 'mysql-b'

jobs:
dependency-graph:
if: ${{ github.event_name == 'push' }}
runs-on: ubuntu-latest
container: swift:jammy
permissions:
contents: write
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Fix Git configuration
run: |
git config --global --add safe.directory "${GITHUB_WORKSPACE}"
apt-get update && apt-get install -y curl
- name: Submit dependency graph
uses: vapor-community/swift-dependency-submission@v0.1
with:
path: ${{ github.workspace }}

api-breakage:
if: ${{ !(github.event.pull_request.draft || false) }}
runs-on: ubuntu-latest
container: swift:5.8-jammy
container: swift:jammy
steps:
- name: Check out code
uses: actions/checkout@v3
uses: actions/checkout@v4
with: { 'fetch-depth': 0 }
- name: Run API breakage check action
uses: vapor/ci/.github/actions/ci-swift-check-api-breakage@reusable-workflows
- name: Run API breakage check
run: |
git config --global --add safe.directory "${GITHUB_WORKSPACE}"
swift package diagnose-api-breaking-changes origin/main
gh-codeql:
if: ${{ !(github.event.pull_request.draft || false) }}
runs-on: ubuntu-latest
container:
image: swift:5.9-jammy
permissions: { actions: write, contents: read, security-events: write }
timeout-minutes: 60
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Mark repo safe in non-fake global config
run: |
git config --global --add safe.directory "${GITHUB_WORKSPACE}"
- name: Check Swift compatibility
id: swift-check
uses: vapor/ci/.github/actions/check-compatible-swift@main
- name: Initialize CodeQL
if: ${{ steps.swift-check.outputs.swift-compatible == 'true' }}
uses: github/codeql-action/init@v3
with: { languages: swift }
- name: Perform build
if: ${{ steps.swift-check.outputs.swift-compatible == 'true' }}
run: |
swift build
- name: Run CodeQL analyze
if: ${{ steps.swift-check.outputs.swift-compatible == 'true' }}
uses: github/codeql-action/analyze@v3

linux-all:
if: ${{ !(github.event.pull_request.draft || false) }}
Expand All @@ -40,15 +88,16 @@ jobs:
matrix:
dbimage:
- mysql:5.7
- mysql:8.0
- mysql:8.2
- mariadb:10.2
- mariadb:11
- percona:5.7
- percona:8.0
- percona:8
swiftver:
- swift:5.7-jammy
- swift:5.8-jammy
- swiftlang/swift:nightly-5.9-jammy
- swift:5.9-jammy
- swiftlang/swift:nightly-5.10-jammy
- swiftlang/swift:nightly-main-jammy
runs-on: ubuntu-latest
container: ${{ matrix.swiftver }}
Expand All @@ -61,27 +110,19 @@ jobs:
env: { MYSQL_ALLOW_EMPTY_PASSWORD: true, MYSQL_USER: test_username, MYSQL_PASSWORD: test_password, MYSQL_DATABASE: test_database }
steps:
- name: Check out package
uses: actions/checkout@v3
uses: actions/checkout@v4
with: { path: 'mysql-nio' }
- name: Run unit tests
run: swift test --package-path mysql-nio --enable-code-coverage --sanitize=thread
- name: Note Swift version
if: ${{ contains(matrix.swiftver, 'nightly') }}
run: |
echo "SWIFT_PLATFORM=$(. /etc/os-release && echo "${ID}${VERSION_ID}")" >>"${GITHUB_ENV}"
echo "SWIFT_VERSION=$(cat /.swift_tag)" >>"${GITHUB_ENV}"
- name: Upload code coverage
uses: vapor/swift-codecov-action@v0.2
env:
MYSQL_VERSION: ${{ matrix.dbimage }}
with:
package_path: 'mysql-nio'
cc_env_vars: 'SWIFT_VERSION,SWIFT_PLATFORM,RUNNER_OS,RUNNER_ARCH,MYSQL_VERSION'
- name: Check out mysql-kit dependent
uses: actions/checkout@v3
uses: actions/checkout@v4
with: { repository: 'vapor/mysql-kit', path: 'mysql-kit' }
- name: Check out fluent-mysql-driver dependent
uses: actions/checkout@v3
uses: actions/checkout@v4
with: { repository: 'vapor/fluent-mysql-driver', path: 'fluent-mysql-driver' }
- name: Use local package in dependents
run: |
Expand All @@ -98,7 +139,7 @@ jobs:
fail-fast: false
matrix:
dbimage: [mysql, mariadb, percona-server]
xcode: ['latest-stable']
xcode: ['~14.3', 'latest']
macos: ['macos-13']
include:
- { username: root }
Expand Down Expand Up @@ -126,16 +167,8 @@ jobs:
SQL
timeout-minutes: 5
- name: Check out code
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Run all tests
run: swift test --sanitize=thread --enable-code-coverage
- name: Record Swift and MySQL versions
run: |
echo "SWIFT_VERSION=$(swift package tools-version --version)" >>"${GITHUB_ENV}"
echo "MYSQL_VERSION=$(mysql --version)" >>"${GITHUB_ENV}"
- name: Upload code coverage
env:
SWIFT_PLATFORM: ${{ matrix.macos }}
uses: vapor/swift-codecov-action@v0.2
with:
cc_env_vars: 'MD_APPLE_SDK_ROOT,SWIFT_VERSION,SWIFT_PLATFORM,RUNNER_OS,RUNNER_ARCH,MYSQL_VERSION'
4 changes: 2 additions & 2 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// swift-tools-version:5.6
// swift-tools-version:5.7
import PackageDescription

let package = Package(
Expand All @@ -13,7 +13,7 @@ let package = Package(
.library(name: "MySQLNIO", targets: ["MySQLNIO"]),
],
dependencies: [
.package(url: "https://github.com/apple/swift-crypto.git", "1.0.0" ..< "3.0.0"),
.package(url: "https://github.com/apple/swift-crypto.git", "1.0.0" ..< "4.0.0"),
.package(url: "https://github.com/apple/swift-log.git", from: "1.0.0"),
.package(url: "https://github.com/apple/swift-nio.git", from: "2.0.0"),
.package(url: "https://github.com/apple/swift-nio-ssl.git", from: "2.14.0"),
Expand Down
31 changes: 13 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,17 @@
<p align="center">
<img src="https://user-images.githubusercontent.com/1342803/75577086-35280780-5a2f-11ea-8eb2-2044b0310f49.png" height="64" alt="MySQLNIO">
<br>
<br>
<a href="https://docs.vapor.codes/4.0/">
<img src="http://img.shields.io/badge/read_the-docs-2196f3.svg" alt="Documentation">
</a>
<a href="https://discord.gg/vapor">
<img src="https://img.shields.io/discord/431917998102675485.svg" alt="Team Chat">
</a>
<a href="LICENSE">
<img src="http://img.shields.io/badge/license-MIT-brightgreen.svg" alt="MIT License">
</a>
<a href="https://github.com/vapor/mysql-nio/actions/workflows/test.yml">
<img src="https://github.com/vapor/mysql-nio/actions/workflows/test.yml/badge.svg?event=push" alt="CI">
</a>
<a href="https://swift.org">
<img src="http://img.shields.io/badge/swift-5.6-brightgreen.svg" alt="Swift 5.5">
</a>
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://github.com/vapor/mysql-nio/assets/1130717/8ef2ef8b-070d-4026-a425-8e25159ca398">
<source media="(prefers-color-scheme: light)" srcset="https://github.com/vapor/mysql-nio/assets/1130717/595fbebd-8762-4a32-b990-3abde04a411c">
<img src="https://github.com/vapor/mysql-nio/assets/1130717/595fbebd-8762-4a32-b990-3abde04a411c" height="96" alt="MySQLNIO">
</picture>
<br>
<br>
<a href="https://docs.vapor.codes/4.0/"><img src="https://design.vapor.codes/images/readthedocs.svg" alt="Documentation"></a>
<a href="https://discord.gg/vapor"><img src="https://design.vapor.codes/images/discordchat.svg" alt="Team Chat"></a>
<a href="LICENSE"><img src="https://design.vapor.codes/images/mitlicense.svg" alt="MIT License"></a>
<a href="https://github.com/vapor/mysql-nio/actions/workflows/test.yml"><img src="https://img.shields.io/github/actions/workflow/status/vapor/mysql-nio/test.yml?event=push&style=plastic&logo=github&label=test&logoColor=%23ccc" alt="Continuous Integration"></a>
<a href="https://codecov.io/github/vapor/mysql-nio"><img src="https://img.shields.io/codecov/c/github/vapor/mysql-nio?style=plastic&logo=codecov&label=Codecov"></a>
<a href="https://swift.org"><img src="https://design.vapor.codes/images/swift57up.svg" alt="Swift 5.7+"></a>
</p>

<br>
Expand Down
22 changes: 22 additions & 0 deletions Sources/MySQLNIO/Docs.docc/images/vapor-mysqlnio-logo.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions Sources/MySQLNIO/Docs.docc/theme-settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"theme": {
"aside": { "border-radius": "6px", "border-style": "double", "border-width": "3px" },
"border-radius": "0",
"button": { "border-radius": "16px", "border-width": "1px", "border-style": "solid" },
"code": { "border-radius": "16px", "border-width": "1px", "border-style": "solid" },
"color": {
"mysql": "#02758f",
"documentation-intro-fill": "radial-gradient(circle at top, var(--color-mysql) 30%, #000 100%)",
"documentation-intro-accent": "var(--color-mysql)",
"logo-base": { "dark": "#fff", "light": "#000" },
"logo-shape": { "dark": "#000", "light": "#fff" },
"fill": { "dark": "#000", "light": "#fff" }
},
"icons": { "technology": "/mysqlnio/images/vapor-mysqlnio-logo.svg" }
},
"features": {
"quickNavigation": { "enable": true },
"i18n": { "enable": true }
}
}

0 comments on commit 605fe1d

Please sign in to comment.