Major overhaul of the entire SQLKit package (#172) #334
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
SWIFT_DETERMINISTIC_HASHING: 1 | |
jobs: | |
unit-tests: | |
uses: vapor/ci/.github/workflows/run-unit-tests.yml@main | |
integration-tests: | |
if: ${{ !(github.event.pull_request.draft || false) }} | |
services: | |
mysql-a: | |
image: mysql:latest | |
env: { MYSQL_USER: test_username, MYSQL_PASSWORD: test_password, MYSQL_DATABASE: test_database, MYSQL_ALLOW_EMPTY_PASSWORD: true } | |
mysql-b: | |
image: mysql:latest | |
env: { MYSQL_USER: test_username, MYSQL_PASSWORD: test_password, MYSQL_DATABASE: test_database, MYSQL_ALLOW_EMPTY_PASSWORD: true } | |
psql-a: | |
image: postgres:latest | |
env: { POSTGRES_USER: test_username, POSTGRES_PASSWORD: test_password, POSTGRES_DB: test_database } | |
psql-b: | |
image: postgres:latest | |
env: { POSTGRES_USER: test_username, POSTGRES_PASSWORD: test_password, POSTGRES_DB: test_database } | |
strategy: | |
fail-fast: false | |
matrix: | |
swift-image: ['swift:5.10-jammy'] | |
driver: | |
- { sqlkit: 'sqlite-kit', fluent: 'fluent-sqlite-driver' } | |
- { sqlkit: 'mysql-kit', fluent: 'fluent-mysql-driver' } | |
- { sqlkit: 'postgres-kit', fluent: 'fluent-postgres-driver' } | |
runs-on: ubuntu-latest | |
container: ${{ matrix.swift-image }} | |
env: | |
SQLKIT_DRIVER: ${{ matrix.driver.sqlkit }} | |
FLUENT_DRIVER: ${{ matrix.driver.fluent }} | |
POSTGRES_HOSTNAME: psql-a | |
POSTGRES_HOSTNAME_A: psql-a | |
POSTGRES_HOSTNAME_B: psql-b | |
MYSQL_HOSTNAME: mysql-a | |
MYSQL_HOSTNAME_A: mysql-a | |
MYSQL_HOSTNAME_B: mysql-b | |
steps: | |
- name: Check out sql-kit | |
uses: actions/checkout@v4 | |
with: { path: sql-kit, repository: vapor/sql-kit } | |
- name: Check out SQLKit driver | |
uses: actions/checkout@v4 | |
with: | |
path: ${{ matrix.driver.sqlkit }} | |
repository: vapor/${{ matrix.driver.sqlkit }} | |
- name: Check out Fluent driver | |
uses: actions/checkout@v4 | |
with: | |
path: ${{ matrix.driver.fluent }} | |
repository: vapor/${{ matrix.driver.fluent }} | |
- name: Set up and run ${{ matrix.driver.sqlkit }} tests | |
run: | | |
swift package --package-path "${SQLKIT_DRIVER}" edit --path sql-kit sql-kit | |
swift test --package-path "${SQLKIT_DRIVER}" --sanitize=thread | |
- name: Set up and run ${{ matrix.driver.fluent }} tests | |
run: | | |
swift package --package-path "${FLUENT_DRIVER}" edit --path sql-kit sql-kit | |
swift test --package-path "${FLUENT_DRIVER}" --sanitize=thread |