Skip to content

Several very long overdue crash fixes #132

Several very long overdue crash fixes

Several very long overdue crash fixes #132

Workflow file for this run

name: test
on:
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: into
SWIFT_DETERMINISTIC_HASHING: 1
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'
jobs:
api-breakage:
if: ${{ !(github.event.pull_request.draft || false) }}
runs-on: ubuntu-latest
container: swift:5.8-jammy
steps:
- name: Check out code
uses: actions/checkout@v3
with: { 'fetch-depth': 0 }
- name: Run API breakage check action
uses: vapor/ci/.github/actions/ci-swift-check-api-breakage@reusable-workflows
linux-all:
if: ${{ !(github.event.pull_request.draft || false) }}
strategy:
fail-fast: false
matrix:
dbimage:
- mysql:5.7
- mysql:8.0
- mariadb:10.4
- mariadb:10.11
- percona:8.0
swiftver:
- swift:5.6-focal
- swift:5.7-jammy
- swift:5.8-jammy
- swiftlang/swift:nightly-5.9-jammy
- swiftlang/swift:nightly-main-jammy
container: ${{ matrix.swiftver }}
runs-on: ubuntu-latest
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: Check out package
uses: actions/checkout@v3
with: { path: 'mysql-nio' }
- name: Run unit tests
run: swift test --package-path mysql-nio --enable-code-coverage --sanitize=thread
- name: Upload code coverage
uses: vapor/swift-codecov-action@v0.2
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
with: { repository: 'vapor/mysql-kit', path: 'mysql-kit' }
- name: Check out fluent-mysql-driver dependent
uses: actions/checkout@v3
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
xcode:
- latest-stable
macos:
- macos-13
include:
- username: root
- dbimage: mariadb
username: runner
runs-on: ${{ matrix.macos }}
env:
LOG_LEVEL: debug
MYSQL_HOSTNAME: '127.0.0.1'
steps:
- name: Select latest available Xcode
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: ${{ matrix.xcode }}
- name: Install MySQL, setup DB and auth, and wait for server start
shell: bash
run: |
brew install ${{ matrix.dbimage }} && brew link --force ${{ matrix.dbimage }}
brew services start ${{ matrix.dbimage }}
until echo | mysql -u${{ matrix.username }}; do sleep 1; done
mysql -u${{ matrix.username }} --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: Record Swift toolchain and MySQL versions
run: |
echo "SWIFT_VERSION=$(swift package tools-version --version)" >> "${GITHUB_ENV}"
echo 'SWIFT_PLATFORM=${{ matrix.macos }}' >> "${GITHUB_ENV}"
echo "MYSQL_VERSION=$(mysql --version)" >> "${GITHUB_ENV}"
- name: Check out code
uses: actions/checkout@v3
- name: Run all tests
run: swift test --sanitize=thread --enable-code-coverage
- name: Upload code coverage
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'