Skip to content

Commit fcb2e66

Browse files
authored
Add Swift version info to CI output (#369)
1 parent 2bfdd55 commit fcb2e66

File tree

1 file changed

+25
-16
lines changed

1 file changed

+25
-16
lines changed

.github/workflows/test.yml

Lines changed: 25 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ on:
99
pull_request:
1010
branches:
1111
- "*"
12+
env:
13+
LOG_LEVEL: info
1214

1315
jobs:
1416
linux-unit:
@@ -23,9 +25,15 @@ jobs:
2325
- swiftlang/swift:nightly-main-jammy
2426
container: ${{ matrix.container }}
2527
runs-on: ubuntu-latest
26-
env:
27-
LOG_LEVEL: debug
2828
steps:
29+
- name: Display OS and Swift versions
30+
shell: bash
31+
run: |
32+
if [[ '${{ contains(matrix.container, 'nightly') }}' == 'true' ]]; then
33+
SWIFT_PLATFORM="$(source /etc/os-release && echo "${ID}${VERSION_ID}")" SWIFT_VERSION="$(cat /.swift_tag)"
34+
printf 'SWIFT_PLATFORM=%s\nSWIFT_VERSION=%s\n' "${SWIFT_PLATFORM}" "${SWIFT_VERSION}" >>"${GITHUB_ENV}"
35+
fi
36+
printf 'OS: %s\nTag: %s\nVersion:\n' "${SWIFT_PLATFORM}-${RUNNER_ARCH}" "${SWIFT_VERSION}" && swift --version
2937
- name: Check out package
3038
uses: actions/checkout@v3
3139
- name: Run unit tests with code coverage and Thread Sanitizer
@@ -57,7 +65,6 @@ jobs:
5765
volumes: [ 'pgrunshare:/var/run/postgresql' ]
5866
runs-on: ubuntu-latest
5967
env:
60-
LOG_LEVEL: debug
6168
# Unfortunately, fluent-postgres-driver details leak through here
6269
POSTGRES_DB: 'test_database'
6370
POSTGRES_DB_A: 'test_database'
@@ -93,6 +100,9 @@ jobs:
93100
POSTGRES_HOST_AUTH_METHOD: ${{ matrix.dbauth }}
94101
POSTGRES_INITDB_ARGS: --auth-host=${{ matrix.dbauth }}
95102
steps:
103+
- name: Display OS and Swift versions
104+
run: |
105+
printf 'OS: %s\nTag: %s\nVersion:\n' "${SWIFT_PLATFORM}-${RUNNER_ARCH}" "${SWIFT_VERSION}" && swift --version
96106
- name: Check out package
97107
uses: actions/checkout@v3
98108
with: { path: 'postgres-nio' }
@@ -126,9 +136,8 @@ jobs:
126136
- scram-sha-256
127137
xcode:
128138
- latest-stable
129-
runs-on: macos-12
139+
runs-on: macos-13
130140
env:
131-
LOG_LEVEL: debug
132141
POSTGRES_HOSTNAME: 127.0.0.1
133142
POSTGRES_USER: 'test_username'
134143
POSTGRES_PASSWORD: 'test_password'
@@ -143,8 +152,8 @@ jobs:
143152
- name: Install Postgres, setup DB and auth, and wait for server start
144153
run: |
145154
export PATH="$(brew --prefix)/opt/${{ matrix.dbimage }}/bin:$PATH" PGDATA=/tmp/vapor-postgres-test
146-
(brew unlink postgresql || true) && brew install ${{ matrix.dbimage }} && brew link --force ${{ matrix.dbimage }}
147-
initdb --locale=C --auth-host ${{ matrix.dbauth }} -U $POSTGRES_USER --pwfile=<(echo $POSTGRES_PASSWORD)
155+
(brew unlink postgresql || true) && brew install '${{ matrix.dbimage }}' && brew link --force '${{ matrix.dbimage }}'
156+
initdb --locale=C --auth-host '${{ matrix.dbauth }}' -U "${POSTGRES_USER}" --pwfile=<(echo "${POSTGRES_PASSWORD}")
148157
pg_ctl start --wait
149158
timeout-minutes: 2
150159
- name: Checkout code
@@ -157,12 +166,12 @@ jobs:
157166
runs-on: ubuntu-latest
158167
container: swift:5.8-jammy
159168
steps:
160-
- name: Checkout
161-
uses: actions/checkout@v3
162-
with:
163-
fetch-depth: 0
164-
# https://github.com/actions/checkout/issues/766
165-
- name: Mark the workspace as safe
166-
run: git config --global --add safe.directory ${GITHUB_WORKSPACE}
167-
- name: API breaking changes
168-
run: swift package diagnose-api-breaking-changes origin/main
169+
- name: Checkout
170+
uses: actions/checkout@v3
171+
with:
172+
fetch-depth: 0
173+
# https://github.com/actions/checkout/issues/766
174+
- name: Mark the workspace as safe
175+
run: git config --global --add safe.directory "${GITHUB_WORKSPACE}"
176+
- name: API breaking changes
177+
run: swift package diagnose-api-breaking-changes origin/main

0 commit comments

Comments
 (0)