Skip to content

Fix which set of column info is used for binary resultset decoding #183

Fix which set of column info is used for binary resultset decoding

Fix which set of column info is used for binary resultset decoding #183

Workflow file for this run

name: test
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on:
pull_request: { types: [opened, reopened, synchronize, ready_for_review] }
push: { branches: [ main ] }
env:
LOG_LEVEL: info
MYSQL_DATABASE: 'test_database'
MYSQL_DATABASE_A: 'test_database'
MYSQL_DATABASE_B: 'test_database'
MYSQL_USERNAME: 'test_username'
MYSQL_USERNAME_A: 'test_username'
MYSQL_USERNAME_B: 'test_username'
MYSQL_PASSWORD: 'test_password'
MYSQL_PASSWORD_A: 'test_password'
MYSQL_PASSWORD_B: 'test_password'
MYSQL_HOSTNAME: 'mysql-a'
MYSQL_HOSTNAME_A: 'mysql-a'
MYSQL_HOSTNAME_B: 'mysql-b'
permissions:
contents: read
jobs:
api-breakage:
if: ${{ !(github.event.pull_request.draft || false) }}
runs-on: ubuntu-latest
container: swift:noble
steps:
- name: Check out code
uses: actions/checkout@v6
with: { 'fetch-depth': 0 }
- name: Run API breakage check
run: |
git config --global --add safe.directory "${GITHUB_WORKSPACE}"
swift package diagnose-api-breaking-changes origin/main
linux-insecure-test:
if: ${{ !(github.event.pull_request.draft || false) }}
strategy:
fail-fast: false
matrix:
dbimage:
- mysql:9.5
swiftver:
- swift:6.2-noble
runs-on: ubuntu-latest
container:
image: ${{ matrix.swiftver }}
volumes: [ 'mysqlshare:/var/run/mysqld' ]
services:
mysql-a:
image: ${{ matrix.dbimage }}
volumes: [ 'mysqlshare:/var/run/mysqld' ]
env: { MYSQL_ALLOW_EMPTY_PASSWORD: true, MYSQL_USER: test_username, MYSQL_PASSWORD: test_password, MYSQL_DATABASE: test_database }
steps:
- name: Force MySQL server to disallow TLS
shell: bash
run: |
apt-get update && apt-get install -y 'mysql-client-core-*' curl
i=0; while ((i<10)); do
{ mysql -BS/var/run/mysqld/mysqld.sock <<<"SET PERSIST ssl_ca='',ssl_cert='',ssl_key='';ALTER INSTANCE RELOAD TLS NO ROLLBACK ON ERROR;" ; } && break
sleep 2
i=$((i+1))
done
((i<10))
- name: Check out package
uses: actions/checkout@v6
- name: Run unit tests
run: swift test --enable-code-coverage
- name: Upload code coverage
uses: vapor/swift-codecov-action@v0.3
with:
codecov_token: ${{ secrets.CODECOV_TOKEN }}
linux-all:
if: ${{ !(github.event.pull_request.draft || false) }}
strategy:
fail-fast: false
matrix:
dbimage:
- mysql:5.7
- mysql:9.5
- mariadb:10.6
- mariadb:12
- percona:5.7
- percona:8
swiftver:
- swift:6.0-jammy
- swift:6.1-noble
- swift:6.2-noble
- swiftlang/swift:nightly-main-noble
runs-on: ubuntu-latest
container: ${{ matrix.swiftver }}
services:
mysql-a:
image: ${{ matrix.dbimage }}
env: { MYSQL_ALLOW_EMPTY_PASSWORD: true, MYSQL_USER: test_username, MYSQL_PASSWORD: test_password, MYSQL_DATABASE: test_database }
mysql-b:
image: ${{ matrix.dbimage }}
env: { MYSQL_ALLOW_EMPTY_PASSWORD: true, MYSQL_USER: test_username, MYSQL_PASSWORD: test_password, MYSQL_DATABASE: test_database }
steps:
- name: Install curl
run: apt-get update -y -q && apt-get install -y curl
- name: Check out package
uses: actions/checkout@v6
with: { path: 'mysql-nio' }
- name: Run unit tests
run: swift test --package-path mysql-nio --enable-code-coverage
- name: Upload code coverage
uses: vapor/swift-codecov-action@v0.3
with:
codecov_token: ${{ secrets.CODECOV_TOKEN }}
package_path: 'mysql-nio'
- name: Check out mysql-kit dependent
uses: actions/checkout@v6
with: { repository: 'vapor/mysql-kit', path: 'mysql-kit' }
- name: Check out fluent-mysql-driver dependent
uses: actions/checkout@v6
with: { repository: 'vapor/fluent-mysql-driver', path: 'fluent-mysql-driver' }
- name: Use local package in dependents
run: |
swift package --package-path mysql-kit edit mysql-nio --path mysql-nio
swift package --package-path fluent-mysql-driver edit mysql-nio --path mysql-nio
- name: Run mysql-kit tests
run: swift test --package-path mysql-kit
- name: Run fluent-mysql-driver tests
run: swift test --package-path fluent-mysql-driver
macos-all:
if: ${{ !(github.event.pull_request.draft || false) }}
strategy:
fail-fast: false
matrix:
dbimage: [mysql, mariadb, percona-server]
macos-version: ['macos-15', 'macos-26']
include:
- { username: root }
- { dbimage: mariadb, username: runner }
- { macos-version: 'macos-15', xcode-version: 'latest-stable' }
- { macos-version: 'macos-26', xcode-version: 'latest-stable' }
runs-on: ${{ matrix.macos-version }}
env: { MYSQL_HOSTNAME: '127.0.0.1' }
steps:
- name: Select latest available Xcode
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: ${{ matrix.xcode-version }}
- name: Install MySQL, setup DB and auth, and wait for server start
env:
FORMULA: ${{ matrix.dbimage }}
RUNAS_USER: ${{ matrix.username }}
shell: bash
run: |
brew install "${FORMULA}" && brew link --force "${FORMULA}"
brew services start "${FORMULA}"
until echo | mysql -u"${RUNAS_USER}"; do sleep 1; done
mysql -u"${RUNAS_USER}" --batch <<-SQL
CREATE USER ${MYSQL_USERNAME}@localhost IDENTIFIED BY '${MYSQL_PASSWORD}';
CREATE DATABASE ${MYSQL_DATABASE};
GRANT ALL PRIVILEGES ON ${MYSQL_DATABASE}.* TO ${MYSQL_USERNAME}@localhost;
SQL
timeout-minutes: 5
- name: Check out code
uses: actions/checkout@v6
- name: Run all tests
run: swift test --enable-code-coverage
- name: Upload code coverage
uses: vapor/swift-codecov-action@v0.3
with:
codecov_token: ${{ secrets.CODECOV_TOKEN }}