-
-
Notifications
You must be signed in to change notification settings - Fork 70
Remove use of legacy codepath when establishing Postgres connections #249
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,100 +27,120 @@ jobs: | |
api-breakage: | ||
if: ${{ !(github.event.pull_request.draft || false) }} | ||
runs-on: ubuntu-latest | ||
container: swift:5.8-jammy | ||
container: swift: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 | ||
uses: vapor/ci/.github/actions/ci-swift-check-api-breakage@main | ||
|
||
code-coverage: | ||
MahdiBM marked this conversation as resolved.
Show resolved
Hide resolved
|
||
if: ${{ !(github.event.pull_request.draft || false) }} | ||
runs-on: ubuntu-latest | ||
container: swift:jammy | ||
services: | ||
psql-a: | ||
image: postgres:15 | ||
env: | ||
POSTGRES_USER: test_username | ||
POSTGRES_DB: test_database | ||
POSTGRES_PASSWORD: test_password | ||
POSTGRES_HOST_AUTH_METHOD: scram-sha-256 | ||
POSTGRES_INITDB_ARGS: --auth-host=scram-sha-256 | ||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@v3 | ||
- name: Run unit tests for coverage data | ||
run: swift test --enable-code-coverage | ||
- name: Upload coverage data | ||
uses: vapor/[email protected] | ||
|
||
gh-codeql: | ||
if: ${{ !(github.event.pull_request.draft || false) }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
runner_os: | ||
- ubuntu-latest | ||
- macos-13 | ||
runs-on: ${{ matrix.runner_os }} | ||
permissions: | ||
security-events: write | ||
steps: | ||
- name: Select appropriate Xcode version | ||
if: ${{ startsWith(matrix.runner_os, 'macos') }} | ||
uses: maxim-lobanov/setup-xcode@v1 | ||
with: { xcode-version: '~14.3' } | ||
- name: Check out code | ||
uses: actions/checkout@v3 | ||
- name: Initialize CodeQL | ||
uses: github/codeql-action/init@v2 | ||
with: { languages: swift } | ||
- name: Perform build | ||
run: swift build | ||
- name: Run CodeQL analyze | ||
uses: github/codeql-action/analyze@v2 | ||
|
||
# Run Linux unit tests against various configurations | ||
linux-unit: | ||
if: ${{ !(github.event.pull_request.draft || false) }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
dbimage: ['postgres:15', 'postgres:13', 'postgres:11'] | ||
swiftver: [ | ||
'swift:5.7-jammy', 'swift:5.8-jammy', | ||
'swiftlang/swift:nightly-5.9-jammy', | ||
'swiftlang/swift:nightly-main-jammy' | ||
] | ||
include: [ | ||
{dbimage: 'postgres:15', dbauth: 'scram-sha-256'}, | ||
{dbimage: 'postgres:13', dbauth: 'md5'}, | ||
{dbimage: 'postgres:11', dbauth: 'trust'} | ||
] | ||
postgres-image: | ||
- postgres:15 | ||
- postgres:13 | ||
- postgres:11 | ||
swift-image: | ||
- swift:5.7-jammy | ||
- swift:5.8-jammy | ||
- swiftlang/swift:nightly-5.9-jammy | ||
- swiftlang/swift:nightly-main-jammy | ||
include: | ||
- postgres-image: postgres:15 | ||
postgres-auth: scram-sha-256 | ||
- postgres-image: postgres:13 | ||
postgres-auth: md5 | ||
- postgres-image: postgres:11 | ||
postgres-auth: trust | ||
runs-on: ubuntu-latest | ||
container: ${{ matrix.swiftver }} | ||
container: ${{ matrix.swift-image }} | ||
services: | ||
psql-a: | ||
image: ${{ matrix.dbimage }} | ||
image: ${{ matrix.postgres-image }} | ||
env: | ||
POSTGRES_USER: 'test_username' | ||
POSTGRES_DB: 'test_database' | ||
POSTGRES_PASSWORD: 'test_password' | ||
POSTGRES_HOST_AUTH_METHOD: ${{ matrix.dbauth }} | ||
POSTGRES_INITDB_ARGS: --auth-host=${{ matrix.dbauth }} | ||
psql-b: | ||
image: ${{ matrix.dbimage }} | ||
env: | ||
POSTGRES_USER: 'test_username' | ||
POSTGRES_DB: 'test_database' | ||
POSTGRES_PASSWORD: 'test_password' | ||
POSTGRES_HOST_AUTH_METHOD: ${{ matrix.dbauth }} | ||
POSTGRES_INITDB_ARGS: --auth-host=${{ matrix.dbauth }} | ||
POSTGRES_USER: test_username | ||
POSTGRES_DB: test_database | ||
POSTGRES_PASSWORD: test_password | ||
POSTGRES_HOST_AUTH_METHOD: ${{ matrix.postgres-auth }} | ||
POSTGRES_INITDB_ARGS: --auth-host=${{ matrix.postgres-auth }} | ||
steps: | ||
- name: Check out package | ||
uses: actions/checkout@v3 | ||
- name: Run local tests | ||
run: swift test --enable-code-coverage | ||
- name: Note Swift version | ||
if: ${{ contains(matrix.swiftver, 'nightly') }} | ||
run: | | ||
echo "SWIFT_PLATFORM=$(. /etc/os-release && echo "${ID}${VERSION_ID}")" >>"${GITHUB_ENV}" | ||
echo "SWIFT_VERSION=$(cat /.swift_tag)" >>"${GITHUB_ENV}" | ||
- name: Upload code coverage | ||
uses: vapor/[email protected] | ||
env: | ||
POSTGRES_VERSION: ${{ matrix.dbimage }} | ||
POSTGRES_AUTH_METHOD: ${{ matrix.dbauth }} | ||
with: | ||
cc_env_vars: 'SWIFT_VERSION,SWIFT_PLATFORM,RUNNER_OS,RUNNER_ARCH,POSTGRES_VERSION,POSTGRES_AUTH_METHOD' | ||
run: swift test | ||
|
||
# Test integration with dependent package on Linux | ||
linux-integration: | ||
if: ${{ !(github.event.pull_request.draft || false) }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
dbimage: ['postgres:15'] | ||
dbauth: ['scram-sha-256'] | ||
swiftver: [ | ||
'swift:5.7-jammy', 'swift:5.8-jammy', | ||
'swiftlang/swift:nightly-5.9-jammy', | ||
'swiftlang/swift:nightly-main-jammy' | ||
] | ||
runs-on: ubuntu-latest | ||
container: ${{ matrix.swiftver }} | ||
container: swift:5.8-jammy | ||
services: | ||
psql-a: | ||
image: ${{ matrix.dbimage }} | ||
image: postgres:15 | ||
env: | ||
POSTGRES_USER: 'test_username' | ||
POSTGRES_DB: 'test_database' | ||
POSTGRES_PASSWORD: 'test_password' | ||
POSTGRES_HOST_AUTH_METHOD: ${{ matrix.dbauth }} | ||
POSTGRES_INITDB_ARGS: --auth-host=${{ matrix.dbauth }} | ||
POSTGRES_USER: test_username | ||
POSTGRES_DB: test_database | ||
POSTGRES_PASSWORD: test_password | ||
POSTGRES_HOST_AUTH_METHOD: scram-sha-256 | ||
POSTGRES_INITDB_ARGS: --auth-host=scram-sha-256 | ||
psql-b: | ||
image: ${{ matrix.dbimage }} | ||
image: postgres:15 | ||
env: | ||
POSTGRES_USER: 'test_username' | ||
POSTGRES_DB: 'test_database' | ||
POSTGRES_PASSWORD: 'test_password' | ||
POSTGRES_HOST_AUTH_METHOD: ${{ matrix.dbauth }} | ||
POSTGRES_INITDB_ARGS: --auth-host=${{ matrix.dbauth }} | ||
POSTGRES_USER: test_username | ||
POSTGRES_DB: test_database | ||
POSTGRES_PASSWORD: test_password | ||
POSTGRES_HOST_AUTH_METHOD: scram-sha-256 | ||
POSTGRES_INITDB_ARGS: --auth-host=scram-sha-256 | ||
steps: | ||
- name: Check out package | ||
uses: actions/checkout@v3 | ||
|
@@ -133,43 +153,31 @@ jobs: | |
- name: Run fluent-postgres-kit tests | ||
run: swift test --package-path fluent-postgres-driver | ||
|
||
# Run macOS unit tests against various configurations | ||
macos-unit: | ||
if: ${{ !(github.event.pull_request.draft || false) }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
dbimage: ['postgresql@14'] | ||
dbauth: ['scram-sha-256'] | ||
macos: ['macos-13'] | ||
xcode: ['latest-stable'] | ||
runs-on: ${{ matrix.macos }} | ||
xcode-version: | ||
- '~14.3' | ||
- '15.0-beta' | ||
runs-on: macos-13 | ||
env: | ||
POSTGRES_HOSTNAME: 127.0.0.1 | ||
POSTGRES_DB: postgres | ||
steps: | ||
- name: Select latest available Xcode | ||
uses: maxim-lobanov/setup-xcode@v1 | ||
with: | ||
xcode-version: ${{ matrix.xcode }} | ||
xcode-version: ${{ matrix.xcode-version }} | ||
- name: Install Postgres, setup DB and auth, and wait for server start | ||
env: | ||
POSTGRES_VERSION: ${{ matrix.dbimage }} | ||
POSTGRES_AUTH_METHOD: ${{ matrix.dbauth }} | ||
run: | | ||
export PATH="$(brew --prefix)/opt/${POSTGRES_VERSION}/bin:$PATH" PGDATA=/tmp/vapor-postgres-test | ||
(brew unlink postgresql || true) && brew install "${POSTGRES_VERSION}" && brew link --force "${POSTGRES_VERSION}" | ||
initdb --locale=C --auth-host "${POSTGRES_AUTH_METHOD}" -U "${POSTGRES_USER}" --pwfile=<(echo "${POSTGRES_PASSWORD}") | ||
export PATH="$(brew --prefix)/opt/postgresql@14/bin:$PATH" PGDATA=/tmp/vapor-postgres-test | ||
MahdiBM marked this conversation as resolved.
Show resolved
Hide resolved
|
||
(brew unlink postgresql || true) && brew install "postgresql@14" && brew link --force "postgresql@14" | ||
initdb --locale=C --auth-host "scram-sha-256" -U "${POSTGRES_USER}" --pwfile=<(echo "${POSTGRES_PASSWORD}") | ||
pg_ctl start --wait | ||
timeout-minutes: 2 | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
- name: Run local tests | ||
run: swift test --enable-code-coverage | ||
- name: Upload code coverage | ||
uses: vapor/[email protected] | ||
env: | ||
POSTGRES_VERSION: ${{ matrix.dbimage }} | ||
POSTGRES_AUTH_METHOD: ${{ matrix.dbauth }} | ||
with: | ||
cc_env_vars: 'MD_APPLE_SDK_ROOT,SWIFT_VERSION,SWIFT_PLATFORM,RUNNER_OS,RUNNER_ARCH,POSTGRES_VERSION,POSTGRES_AUTH_METHOD' | ||
run: swift test |
This file contains hidden or 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
This file contains hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.