Skip to content

Commit e4ee515

Browse files
authored
Fix several CI issues
- Update the list of versions for Swift images - Update actions/checkout to v5 - Disable TSan when building with Swift 5.10 and 6.0 due to swift-crypto hitting a compiler crasher - Add macOS Sequoia tests - Remove Homebrew bug workaround (no longer needed)
1 parent 8ee6118 commit e4ee515

File tree

1 file changed

+18
-36
lines changed

1 file changed

+18
-36
lines changed

.github/workflows/test.yml

Lines changed: 18 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ jobs:
2121
- swift:5.10-jammy
2222
- swift:6.0-noble
2323
- swift:6.1-noble
24-
- swiftlang/swift:nightly-main-jammy
24+
- swiftlang/swift:nightly-6.2-noble
25+
- swiftlang/swift:nightly-main-noble
2526
container: ${{ matrix.swift-image }}
2627
runs-on: ubuntu-latest
2728
steps:
@@ -32,11 +33,16 @@ jobs:
3233
[[ -z "${SWIFT_VERSION}" ]] && SWIFT_VERSION="$(cat /.swift_tag 2>/dev/null || true)"
3334
printf 'OS: %s\nTag: %s\nVersion:\n' "${SWIFT_PLATFORM}-${RUNNER_ARCH}" "${SWIFT_VERSION}"
3435
swift --version
36+
- name: Install curl for Codecov
37+
run: apt-get update -y -q && apt-get install -y curl
3538
- name: Check out package
36-
uses: actions/checkout@v4
39+
uses: actions/checkout@v5
3740
- name: Run unit tests with Thread Sanitizer
41+
shell: bash
3842
run: |
39-
swift test --filter='^(PostgresNIOTests|ConnectionPoolModuleTests)' --sanitize=thread --enable-code-coverage
43+
# https://github.com/swiftlang/swift/issues/74042 was never fixed in 5.10 and swift-crypto hits it in 6.0 as well
44+
SANITIZE="$([[ "${SWIFT_VERSION}" =~ ^swift-(5|6\.0) ]] || echo '--sanitize=thread')"
45+
swift test --filter='^(PostgresNIOTests|ConnectionPoolModuleTests)' ${SANITIZE} --enable-code-coverage
4046
- name: Submit code coverage
4147
uses: vapor/swift-codecov-action@v0.3
4248
with:
@@ -103,15 +109,15 @@ jobs:
103109
[[ -z "${SWIFT_VERSION}" ]] && SWIFT_VERSION="$(cat /.swift_tag 2>/dev/null || true)"
104110
printf 'OS: %s\nTag: %s\nVersion:\n' "${SWIFT_PLATFORM}-${RUNNER_ARCH}" "${SWIFT_VERSION}" && swift --version
105111
- name: Check out package
106-
uses: actions/checkout@v4
112+
uses: actions/checkout@v5
107113
with: { path: 'postgres-nio' }
108114
- name: Run integration tests
109115
run: swift test --package-path postgres-nio --filter=^IntegrationTests
110116
- name: Check out postgres-kit dependent
111-
uses: actions/checkout@v4
117+
uses: actions/checkout@v5
112118
with: { repository: 'vapor/postgres-kit', path: 'postgres-kit' }
113119
- name: Check out fluent-postgres-driver dependent
114-
uses: actions/checkout@v4
120+
uses: actions/checkout@v5
115121
with: { repository: 'vapor/fluent-postgres-driver', path: 'fluent-postgres-driver' }
116122
- name: Use local package in dependents
117123
run: |
@@ -132,11 +138,11 @@ jobs:
132138
postgres-auth:
133139
# Only test one auth method on macOS, Linux tests will cover the others
134140
- scram-sha-256
135-
xcode-version:
136-
- '~15'
137141
include:
138-
- xcode-version: '~15'
139-
macos-version: 'macos-14'
142+
- macos-version: 'macos-14'
143+
xcode-version: 'latest-stable'
144+
- macos-version: 'macos-15'
145+
xcode-version: 'latest-stable'
140146
runs-on: ${{ matrix.macos-version }}
141147
env:
142148
POSTGRES_HOSTNAME: 127.0.0.1
@@ -154,18 +160,13 @@ jobs:
154160
- name: Install Postgres, setup DB and auth, and wait for server start
155161
run: |
156162
export PATH="$(brew --prefix)/opt/${POSTGRES_FORMULA}/bin:$PATH" PGDATA=/tmp/vapor-postgres-test
157-
# ** BEGIN ** Work around bug in both Homebrew and GHA
158-
(brew upgrade python@3.11 || true) && (brew link --force --overwrite python@3.11 || true)
159-
(brew upgrade python@3.12 || true) && (brew link --force --overwrite python@3.12 || true)
160-
(brew upgrade || true)
161-
# ** END ** Work around bug in both Homebrew and GHA
162163
brew install --overwrite "${POSTGRES_FORMULA}"
163164
brew link --overwrite --force "${POSTGRES_FORMULA}"
164165
initdb --locale=C --auth-host "${POSTGRES_AUTH_METHOD}" -U "${POSTGRES_USER}" --pwfile=<(echo "${POSTGRES_PASSWORD}")
165166
pg_ctl start --wait
166167
timeout-minutes: 15
167168
- name: Checkout code
168-
uses: actions/checkout@v4
169+
uses: actions/checkout@v5
169170
- name: Run all tests
170171
run: swift test
171172

@@ -175,30 +176,11 @@ jobs:
175176
container: swift:noble
176177
steps:
177178
- name: Checkout
178-
uses: actions/checkout@v4
179+
uses: actions/checkout@v5
179180
with:
180181
fetch-depth: 0
181182
# https://github.com/actions/checkout/issues/766
182183
- name: API breaking changes
183184
run: |
184185
git config --global --add safe.directory "${GITHUB_WORKSPACE}"
185186
swift package diagnose-api-breaking-changes origin/main
186-
187-
# gh-codeql:
188-
# if: ${{ false }}
189-
# runs-on: ubuntu-latest
190-
# container: swift:noble
191-
# permissions: { actions: write, contents: read, security-events: write }
192-
# steps:
193-
# - name: Check out code
194-
# uses: actions/checkout@v4
195-
# - name: Mark repo safe in non-fake global config
196-
# run: git config --global --add safe.directory "${GITHUB_WORKSPACE}"
197-
# - name: Initialize CodeQL
198-
# uses: github/codeql-action/init@v3
199-
# with:
200-
# languages: swift
201-
# - name: Perform build
202-
# run: swift build
203-
# - name: Run CodeQL analyze
204-
# uses: github/codeql-action/analyze@v3

0 commit comments

Comments
 (0)