Skip to content

Commit a4f9cd5

Browse files
committed
Merge branch 'master' into scram-sha-256-support
2 parents d363781 + 3cf2496 commit a4f9cd5

23 files changed

+774
-328
lines changed

.github/CODE_OF_CONDUCT.md

Lines changed: 0 additions & 59 deletions
This file was deleted.

.github/FUNDING.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
github: [tanner0101] # loganwright, joscdk
2-
open_collective: vapor
1+
github: [tanner0101]

.github/contributing.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Contributing to PostgresNIO
2+
3+
👋 Welcome to the Vapor team!
4+
5+
## Testing
6+
7+
To run this package's tests, you need to start a local Postgres database. The easiest way to do this is using Docker.
8+
9+
If you have Docker installed and running, you can use the `docker-compose` included with this package. The following command will download the required files and boot a local Postgres server:
10+
11+
```fish
12+
docker-compose up psql-12
13+
```
14+
15+
Run this in the project's root folder (where the `docker-compose.yml` file is). Check out that file to see the other versions of Postgres you can test against.
16+
17+
Once you have a server running, you can run the test suite from Xcode by hitting `CMD+u` or from the command line:
18+
19+
```fish
20+
swift test
21+
```
22+
23+
Make sure to add tests for any new code you write.
24+
25+
----------
26+
27+
Join us on Discord if you have any questions: [http://vapor.team](http://vapor.team).
28+
29+
— Thanks! 🙌

.github/workflows/api-docs.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: deploy-api-docs
2+
on:
3+
push:
4+
branches:
5+
- master
6+
7+
jobs:
8+
deploy:
9+
name: api.vapor.codes
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Deploy api-docs
13+
uses: appleboy/ssh-action@master
14+
with:
15+
host: vapor.codes
16+
username: vapor
17+
key: ${{ secrets.VAPOR_CODES_SSH_KEY }}
18+
script: ./github-actions/deploy-api-docs.sh

.github/workflows/test.yml

Lines changed: 116 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,64 +1,132 @@
11
name: test
2-
on:
3-
- pull_request
2+
on:
3+
- pull_request
4+
defaults:
5+
run:
6+
shell: bash
47
jobs:
5-
postgres-nio:
6-
container:
7-
image: vapor/swift:5.2
8+
dependents:
9+
runs-on: ubuntu-latest
810
services:
9-
psql:
10-
image: postgres
11-
ports:
12-
- 5432:5432
13-
env:
11+
psql-a:
12+
image: ${{ matrix.dbimage }}
13+
env:
1414
POSTGRES_USER: vapor_username
1515
POSTGRES_DB: vapor_database
1616
POSTGRES_PASSWORD: vapor_password
17-
runs-on: ubuntu-latest
18-
steps:
19-
- uses: actions/checkout@v1
20-
- run: swift test --enable-test-discovery --sanitize=thread
21-
postgres-kit:
22-
container:
23-
image: vapor/swift:5.2
24-
services:
25-
psql:
26-
image: postgres
27-
ports:
28-
- 5432:5432
29-
env:
17+
psql-b:
18+
image: ${{ matrix.dbimage }}
19+
env:
3020
POSTGRES_USER: vapor_username
3121
POSTGRES_DB: vapor_database
3222
POSTGRES_PASSWORD: vapor_password
33-
runs-on: ubuntu-latest
23+
container: swift:5.2-bionic
24+
strategy:
25+
fail-fast: false
26+
matrix:
27+
dbimage:
28+
- postgres:12
29+
- postgres:11
30+
dependent:
31+
- postgres-kit
32+
- fluent-postgres-driver
3433
steps:
35-
- run: git clone -b master https://github.com/vapor/postgres-kit.git
36-
working-directory: ./
37-
- run: swift package edit postgres-nio --revision ${{ github.sha }}
38-
working-directory: ./postgres-kit
39-
- run: swift test --enable-test-discovery --sanitize=thread
40-
working-directory: ./postgres-kit
41-
env:
42-
POSTGRES_HOSTNAME: psql
43-
fluent-postgres-driver:
44-
container:
45-
image: vapor/swift:5.2
34+
- name: Check out package
35+
uses: actions/checkout@v2
36+
with:
37+
path: package
38+
- name: Check out dependent
39+
uses: actions/checkout@v2
40+
with:
41+
repository: vapor/${{ matrix.dependent }}
42+
path: dependent
43+
- name: Use local package
44+
run: swift package edit postgres-nio --path ../package
45+
working-directory: dependent
46+
- name: Run tests with Thread Sanitizer
47+
run: swift test --enable-test-discovery --sanitize=thread
48+
working-directory: dependent
49+
env:
50+
POSTGRES_HOSTNAME: psql-a
51+
POSTGRES_HOSTNAME_A: psql-a
52+
POSTGRES_HOSTNAME_B: psql-b
53+
LOG_LEVEL: notice
54+
linux:
55+
strategy:
56+
fail-fast: false
57+
matrix:
58+
dbimage:
59+
- postgres:12
60+
- postgres:11
61+
runner:
62+
# 5.2 Stable
63+
- swift:5.2-xenial
64+
- swift:5.2-bionic
65+
# 5.2 Unstable
66+
- swiftlang/swift:nightly-5.2-xenial
67+
- swiftlang/swift:nightly-5.2-bionic
68+
# 5.3 Unstable
69+
- swiftlang/swift:nightly-5.3-xenial
70+
- swiftlang/swift:nightly-5.3-bionic
71+
# Master Unsable
72+
- swiftlang/swift:nightly-master-xenial
73+
- swiftlang/swift:nightly-master-bionic
74+
- swiftlang/swift:nightly-master-focal
75+
- swiftlang/swift:nightly-master-centos8
76+
- swiftlang/swift:nightly-master-amazonlinux2
77+
container: ${{ matrix.runner }}
78+
runs-on: ubuntu-latest
4679
services:
4780
psql:
48-
image: postgres
49-
ports:
50-
- 5432:5432
51-
env:
81+
image: ${{ matrix.dbimage }}
82+
env:
5283
POSTGRES_USER: vapor_username
5384
POSTGRES_DB: vapor_database
5485
POSTGRES_PASSWORD: vapor_password
55-
runs-on: ubuntu-latest
5686
steps:
57-
- run: git clone -b master https://github.com/vapor/fluent-postgres-driver.git
58-
working-directory: ./
59-
- run: swift package edit postgres-nio --revision ${{ github.sha }}
60-
working-directory: ./fluent-postgres-driver
61-
- run: swift test --enable-test-discovery --sanitize=thread
62-
working-directory: ./fluent-postgres-driver
63-
env:
64-
POSTGRES_HOSTNAME: psql
87+
- name: Check out code
88+
uses: actions/checkout@v2
89+
- name: Run tests with Thread Sanitizer
90+
run: swift test --enable-test-discovery --sanitize=thread
91+
env:
92+
POSTGRES_HOSTNAME: psql
93+
LOG_LEVEL: notice
94+
macOS:
95+
strategy:
96+
fail-fast: false
97+
matrix:
98+
include:
99+
- formula: postgresql@11
100+
datadir: postgresql@11
101+
- formula: postgresql@12
102+
datadir: postgres
103+
runs-on: macos-latest
104+
steps:
105+
- name: Select latest available Xcode
106+
uses: maxim-lobanov/setup-xcode@1.0
107+
with:
108+
xcode-version: latest
109+
- name: Replace Postgres install and start server
110+
run: |
111+
brew uninstall --force postgresql php && rm -rf /usr/local/{etc,var}/{postgres,pg}*
112+
brew install ${{ matrix.formula }} && brew link --force ${{ matrix.formula }}
113+
initdb --locale=C -E UTF-8 $(brew --prefix)/var/${{ matrix.datadir }}
114+
brew services start ${{ matrix.formula }}
115+
- name: Wait for server to be ready
116+
run: until pg_isready; do sleep 1; done
117+
timeout-minutes: 2
118+
- name: Setup users and databases for Postgres
119+
run: |
120+
createuser --createdb --login vapor_username
121+
for db in vapor_database_{a,b}; do
122+
createdb -Ovapor_username $db && psql $db <<<"ALTER SCHEMA public OWNER TO vapor_username;"
123+
done
124+
- name: Checkout code
125+
uses: actions/checkout@v2
126+
- name: Run tests with Thread Sanitizer
127+
run: swift test --enable-test-discovery --sanitize=thread
128+
env:
129+
POSTGRES_DATABASE: vapor_database_a
130+
POSTGRES_DATABASE_A: vapor_database_a
131+
POSTGRES_DATABASE_B: vapor_database_b
132+
LOG_LEVEL: notice

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@
55
DerivedData
66
Package.resolved
77
.swiftpm
8-
8+
Tests/LinuxMain.swift

0 commit comments

Comments
 (0)