-
-
Notifications
You must be signed in to change notification settings - Fork 58
71 lines (69 loc) · 2.72 KB
/
test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
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