@@ -24,18 +24,18 @@ jobs:
2424 steps :
2525 - name : Check out package
2626 uses : actions/checkout@v2
27- - name : Run unit tests with code coverage
28- run : swift test --enable-test-discovery --filter=^PostgresNIOTests --enable-code-coverage
27+ - name : Run unit tests with code coverage and Thread Sanitizer
28+ run : swift test --enable-test-discovery --filter=^PostgresNIOTests --sanitize=thread -- enable-code-coverage
2929 - name : Convert code coverage report to most expressive format
3030 run : |
3131 export pkgname="$(swift package dump-package | perl -e 'use JSON::PP; print (decode_json(join("",(<>)))->{name});')" \
3232 subpath="$([ "$(uname -s)" = 'Darwin' ] && echo "/Contents/MacOS/${pkgname}PackageTests" || true)" \
3333 exc_prefix="$(which xcrun || true)" && \
3434 ${exc_prefix} llvm-cov export -format lcov \
3535 -instr-profile="$(dirname "$(swift test --show-codecov-path)")/default.profdata" \
36- --ignore-filename-regex='/\.build/' --ignore-filename-regex='/ Tests/' \
36+ --ignore-filename-regex='/( \.build| Tests) /' \
3737 "$(swift build --show-bin-path)/${pkgname}PackageTests.xctest${subpath}" >"${pkgname}.lcov"
38- echo "CODECOV_FILE=$(pwd)/${pkgname}.lcov" >> $ GITHUB_ENV
38+ echo "CODECOV_FILE=$(pwd)/${pkgname}.lcov" >> "${ GITHUB_ENV}"
3939 - name : Send coverage report to codecov.io
4040 uses : codecov/codecov-action@v2
4141 with :
5858 - md5
5959 - scram-sha-256
6060 swiftver :
61- - swift:5.2
61+ # Only test latest Swift for integration tests, issues from older Swift versions that don't show
62+ # up in the unit tests are fairly unlikely.
6263 - swift:5.5
6364 swiftos :
6465 - focal
@@ -67,18 +68,16 @@ jobs:
6768 env :
6869 LOG_LEVEL : debug
6970 # Unfortunately, fluent-postgres-driver details leak through here
70- POSTGRES_HOSTNAME : ' psql-a'
7171 POSTGRES_DB : ' test_database'
72- POSTGRES_DATABASE : ' test_database'
73- POSTGRES_DATABASE_A : ' test_database'
74- POSTGRES_DATABASE_B : ' test_database'
72+ POSTGRES_DB_A : ' test_database'
73+ POSTGRES_DB_B : ' test_database'
7574 POSTGRES_USER : ' test_username'
76- POSTGRES_USERNAME : ' test_username'
77- POSTGRES_USERNAME_A : ' test_username'
78- POSTGRES_USERNAME_B : ' test_username'
75+ POSTGRES_USER_A : ' test_username'
76+ POSTGRES_USER_B : ' test_username'
7977 POSTGRES_PASSWORD : ' test_password'
8078 POSTGRES_PASSWORD_A : ' test_password'
8179 POSTGRES_PASSWORD_B : ' test_password'
80+ POSTGRES_HOSTNAME : ' psql-a'
8281 POSTGRES_HOSTNAME_A : ' psql-a'
8382 POSTGRES_HOSTNAME_B : ' psql-b'
8483 POSTGRES_HOST_AUTH_METHOD : ${{ matrix.dbauth }}
@@ -104,7 +103,7 @@ jobs:
104103 uses : actions/checkout@v2
105104 with : { path: 'postgres-nio' }
106105 - name : Run integration tests
107- run : swift test --package-path postgres-nio --enable-test-discovery -- filter=^IntegrationTests
106+ run : swift test --package-path postgres-nio --filter=^IntegrationTests
108107 - name : Check out postgres-kit dependent
109108 uses : actions/checkout@v2
110109 with : { repository: 'vapor/postgres-kit', path: 'postgres-kit' }
@@ -116,9 +115,9 @@ jobs:
116115 swift package --package-path postgres-kit edit postgres-nio --path postgres-nio
117116 swift package --package-path fluent-postgres-driver edit postgres-nio --path postgres-nio
118117 - name : Run postgres-kit tests
119- run : swift test --package-path postgres-kit --enable-test-discovery
118+ run : swift test --package-path postgres-kit
120119 - name : Run fluent-postgres-driver tests
121- run : swift test --package-path fluent-postgres-driver --enable-test-discovery
120+ run : swift test --package-path fluent-postgres-driver
122121
123122 macos-all :
124123 strategy :
@@ -148,8 +147,8 @@ jobs:
148147 xcode-version : ${{ matrix.xcode }}
149148 - name : Install Postgres, setup DB and auth, and wait for server start
150149 run : |
151- export PATH="$(brew prefix)/opt/${{ matrix.dbimage }}/bin:$PATH" PGDATA=/tmp/vapor-postgres-test
152- brew install ${{ matrix.dbimage }}
150+ export PATH="$(brew -- prefix)/opt/${{ matrix.dbimage }}/bin:$PATH" PGDATA=/tmp/vapor-postgres-test
151+ ( brew unlink postgresql || true) && brew install ${{ matrix.dbimage }} && brew link --force ${{ matrix.dbimage }}
153152 initdb --locale=C --auth-host ${{ matrix.dbauth }} -U $POSTGRES_USER --pwfile=<(echo $POSTGRES_PASSWORD)
154153 pg_ctl start --wait
155154 timeout-minutes : 2
0 commit comments