Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit f846048

Browse files
authoredMar 31, 2020
Add CI for macOS, test multiple Postgres versions, update base images (#145)
* Add macOS CI, use matrix to test many versions Also update the `checkout` action and use the new `-ci` Vapor base images. * Force Brew to symlink the new formula Whoopsy - Brew refuses to link non-current versions of things by default, even if they don't conflict with anything. * Just specify the full path to the executables Why bother fighting with Homebrew over things, doesn't help. * Helps to get the paths right * Homebrew is an evil thing that makes life hard Installing postgresql@12 is apparently guaranteed to fail because `libpq` gets in the way. I don't trust what removing it might do, and there's no way to tell Brew not to try linking on install, so just ignore failures of the install command. If it fails for real, the services command will fail anyway. * Okay, I give up, just unlink libpq * Apparently unlinking libpq doesn't work, just overwrite... * Oh, and ignore errors ANYWAY because Brew is just awful * Just throw the kitchen sink at it... * Get rid of just a little repetition while getting rid of just a little repetition while fixing a typo or twenty
1 parent 8952103 commit f846048

File tree

1 file changed

+28
-20
lines changed

1 file changed

+28
-20
lines changed
 

‎.github/workflows/test.yml

Lines changed: 28 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2,30 +2,38 @@ name: test
22
on:
33
- pull_request
44
jobs:
5-
fluent-postgres-driver_xenial:
6-
container:
7-
image: vapor/swift:5.2-xenial
8-
services:
9-
psql:
10-
image: postgres
11-
ports:
12-
- 5432:5432
13-
env:
14-
POSTGRES_USER: vapor_username
15-
POSTGRES_DB: vapor_database
16-
POSTGRES_PASSWORD: vapor_password
17-
runs-on: ubuntu-latest
5+
fluent-postgres-driver_macos:
6+
strategy:
7+
fail-fast: false
8+
matrix:
9+
psql: ['postgresql@11', 'postgresql@12']
10+
runs-on: macos-latest
1811
steps:
19-
- uses: actions/checkout@v1
12+
- run: sudo xcode-select -s /Applications/Xcode_11.4.app/Contents/Developer
13+
- run: brew unlink libpq
14+
- run: brew install ${{ matrix.psql }}
15+
continue-on-error: true
16+
- run: brew link -f --overwrite ${{ matrix.psql }}
17+
- run: brew reinstall ${{ matrix.psql }}
18+
- run: brew postinstall ${{ matrix.psql }}
19+
- run: brew services start ${{ matrix.psql }}
20+
- run: sleep 4 # give the server a chance to settle
21+
- run: createuser -d -l -s vapor_username
22+
- run: createdb -O vapor_username vapor_database
23+
- uses: actions/checkout@v2
2024
- run: swift test --enable-test-discovery --sanitize=thread
21-
env:
22-
POSTGRES_HOSTNAME: psql
23-
fluent-postgres-driver_bionic:
25+
- run: brew services stop ${{ matrix.psql }}
26+
fluent-postgres-driver_ubuntu:
27+
strategy:
28+
fail-fast: false
29+
matrix:
30+
psql: ['11', '11-alpine', '12', '12-alpine']
31+
base: ['xenial', 'bionic']
2432
container:
25-
image: vapor/swift:5.2-bionic
33+
image: vapor/swift:5.2-${{ matrix.base }}-ci
2634
services:
2735
psql:
28-
image: postgres
36+
image: postgres:${{ matrix.psql }}
2937
ports:
3038
- 5432:5432
3139
env:
@@ -34,7 +42,7 @@ jobs:
3442
POSTGRES_PASSWORD: vapor_password
3543
runs-on: ubuntu-latest
3644
steps:
37-
- uses: actions/checkout@v1
45+
- uses: actions/checkout@v2
3846
- run: swift test --enable-test-discovery --sanitize=thread
3947
env:
4048
POSTGRES_HOSTNAME: psql

0 commit comments

Comments
 (0)
Please sign in to comment.