@@ -3,8 +3,8 @@ concurrency:
3
3
group : ${{ github.workflow }}-${{ github.ref }}
4
4
cancel-in-progress : true
5
5
on :
6
- pull_request : { branches : ['*' ] }
7
- push : { branches: [' main' ] }
6
+ pull_request : { types : [opened, reopened, synchronize, ready_for_review ] }
7
+ push : { branches: [ main ] }
8
8
9
9
env :
10
10
LOG_LEVEL : info
23
23
POSTGRES_PASSWORD_B : ' test_password'
24
24
25
25
jobs :
26
- # Baseline test run for code coverage stats
27
- codecov :
28
- strategy :
29
- matrix :
30
- include :
31
- - dbimage : postgres:15
32
- dbauth : scram-sha-256
33
- runs-on : ubuntu-latest
34
- container : swift:5.8-jammy
35
- services :
36
- psql-a :
37
- image : ${{ matrix.dbimage }}
38
- env :
39
- POSTGRES_USER : ' test_username'
40
- POSTGRES_DB : ' test_database'
41
- POSTGRES_PASSWORD : ' test_password'
42
- POSTGRES_HOST_AUTH_METHOD : ${{ matrix.dbauth }}
43
- POSTGRES_INITDB_ARGS : --auth-host=${{ matrix.dbauth }}
44
- psql-b :
45
- image : ${{ matrix.dbimage }}
46
- env :
47
- POSTGRES_USER : ' test_username'
48
- POSTGRES_DB : ' test_database'
49
- POSTGRES_PASSWORD : ' test_password'
50
- POSTGRES_HOST_AUTH_METHOD : ${{ matrix.dbauth }}
51
- POSTGRES_INITDB_ARGS : --auth-host=${{ matrix.dbauth }}
52
- steps :
53
- - name : Save Postgres version and method to env
54
- run : |
55
- echo POSTGRES_VERSION='${{ matrix.dbimage }}' >> $GITHUB_ENV
56
- echo POSTGRES_AUTH_METHOD='${{ matrix.dbauth }}' >> $GITHUB_ENV
57
- - name : Check out package
58
- uses : actions/checkout@v3
59
- - name : Run local tests with coverage
60
- run : swift test --enable-code-coverage
61
- - name : Submit coverage report to Codecov.io
62
-
63
- with :
64
- cc_env_vars : ' SWIFT_VERSION,SWIFT_PLATFORM,RUNNER_OS,RUNNER_ARCH,POSTGRES_VERSION,POSTGRES_AUTH_METHOD'
65
- cc_fail_ci_if_error : false
66
-
67
- # Check for API breakage versus main
68
26
api-breakage :
69
- if : github.event_name == 'pull_request'
27
+ if : ${{ !( github.event.pull_request.draft || false) }}
70
28
runs-on : ubuntu-latest
71
29
container : swift:5.8-jammy
72
30
steps :
77
35
uses : vapor/ci/.github/actions/ci-swift-check-api-breakage@reusable-workflows
78
36
79
37
linux-all :
80
- if : github.event_name == 'pull_request'
38
+ if : ${{ !( github.event.pull_request.draft || false) }}
81
39
strategy :
82
40
fail-fast : false
83
41
matrix :
@@ -107,13 +65,28 @@ jobs:
107
65
POSTGRES_HOST_AUTH_METHOD : ${{ matrix.dbauth }}
108
66
POSTGRES_INITDB_ARGS : --auth-host=${{ matrix.dbauth }}
109
67
steps :
68
+ - name : Display versions
69
+ shell : bash
70
+ run : |
71
+ echo POSTGRES_VERSION='${{ matrix.dbimage }}' >> $GITHUB_ENV
72
+ echo POSTGRES_AUTH_METHOD='${{ matrix.dbauth }}' >> $GITHUB_ENV
73
+ if [[ '${{ contains(matrix.container, 'nightly') }}' == 'true' ]]; then
74
+ SWIFT_PLATFORM="$(source /etc/os-release && echo "${ID}${VERSION_ID}")" SWIFT_VERSION="$(cat /.swift_tag)"
75
+ printf 'SWIFT_PLATFORM=%s\nSWIFT_VERSION=%s\n' "${SWIFT_PLATFORM}" "${SWIFT_VERSION}" >>"${GITHUB_ENV}"
76
+ fi
77
+ printf 'OS: %s\nTag: %s\nVersion:\n' "${SWIFT_PLATFORM}-${RUNNER_ARCH}" "${SWIFT_VERSION}" && swift --version
110
78
- name : Check out package
111
79
uses : actions/checkout@v3
112
80
- name : Run all tests
113
- run : swift test --sanitize=thread
81
+ run : swift test --sanitize=thread --enable-code-coverage
82
+ - name : Submit coverage report to Codecov.io
83
+
84
+ with :
85
+ cc_env_vars : ' SWIFT_VERSION,SWIFT_PLATFORM,RUNNER_OS,RUNNER_ARCH,POSTGRES_VERSION,POSTGRES_AUTH_METHOD'
86
+ cc_fail_ci_if_error : false
114
87
115
88
macos-all :
116
- if : github.event_name == 'pull_request'
89
+ if : ${{ !( github.event.pull_request.draft || false) }}
117
90
strategy :
118
91
fail-fast : false
119
92
matrix :
0 commit comments