@@ -24,18 +24,18 @@ jobs:
24
24
steps :
25
25
- name : Check out package
26
26
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
29
29
- name : Convert code coverage report to most expressive format
30
30
run : |
31
31
export pkgname="$(swift package dump-package | perl -e 'use JSON::PP; print (decode_json(join("",(<>)))->{name});')" \
32
32
subpath="$([ "$(uname -s)" = 'Darwin' ] && echo "/Contents/MacOS/${pkgname}PackageTests" || true)" \
33
33
exc_prefix="$(which xcrun || true)" && \
34
34
${exc_prefix} llvm-cov export -format lcov \
35
35
-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) /' \
37
37
"$(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}"
39
39
- name : Send coverage report to codecov.io
40
40
uses : codecov/codecov-action@v2
41
41
with :
58
58
- md5
59
59
- scram-sha-256
60
60
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.
62
63
- swift:5.5
63
64
swiftos :
64
65
- focal
@@ -67,18 +68,16 @@ jobs:
67
68
env :
68
69
LOG_LEVEL : debug
69
70
# Unfortunately, fluent-postgres-driver details leak through here
70
- POSTGRES_HOSTNAME : ' psql-a'
71
71
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'
75
74
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'
79
77
POSTGRES_PASSWORD : ' test_password'
80
78
POSTGRES_PASSWORD_A : ' test_password'
81
79
POSTGRES_PASSWORD_B : ' test_password'
80
+ POSTGRES_HOSTNAME : ' psql-a'
82
81
POSTGRES_HOSTNAME_A : ' psql-a'
83
82
POSTGRES_HOSTNAME_B : ' psql-b'
84
83
POSTGRES_HOST_AUTH_METHOD : ${{ matrix.dbauth }}
@@ -104,7 +103,7 @@ jobs:
104
103
uses : actions/checkout@v2
105
104
with : { path: 'postgres-nio' }
106
105
- 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
108
107
- name : Check out postgres-kit dependent
109
108
uses : actions/checkout@v2
110
109
with : { repository: 'vapor/postgres-kit', path: 'postgres-kit' }
@@ -116,9 +115,9 @@ jobs:
116
115
swift package --package-path postgres-kit edit postgres-nio --path postgres-nio
117
116
swift package --package-path fluent-postgres-driver edit postgres-nio --path postgres-nio
118
117
- name : Run postgres-kit tests
119
- run : swift test --package-path postgres-kit --enable-test-discovery
118
+ run : swift test --package-path postgres-kit
120
119
- 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
122
121
123
122
macos-all :
124
123
strategy :
@@ -148,8 +147,8 @@ jobs:
148
147
xcode-version : ${{ matrix.xcode }}
149
148
- name : Install Postgres, setup DB and auth, and wait for server start
150
149
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 }}
153
152
initdb --locale=C --auth-host ${{ matrix.dbauth }} -U $POSTGRES_USER --pwfile=<(echo $POSTGRES_PASSWORD)
154
153
pg_ctl start --wait
155
154
timeout-minutes : 2
0 commit comments