@@ -3,8 +3,8 @@ concurrency:
33 group : ${{ github.workflow }}-${{ github.ref }}
44 cancel-in-progress : true
55on :
6- pull_request : { branches : ['*' ] }
7- push : { branches: [' main' ] }
6+ pull_request : { types : [opened, reopened, synchronize, ready_for_review ] }
7+ push : { branches: [ main ] }
88
99env :
1010 LOG_LEVEL : info
2323 POSTGRES_PASSWORD_B : ' test_password'
2424
2525jobs :
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- uses : vapor/swift-codecov-action@v0.2
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
6826 api-breakage :
69- if : github.event_name == 'pull_request'
27+ if : ${{ !( github.event.pull_request.draft || false) }}
7028 runs-on : ubuntu-latest
7129 container : swift:5.8-jammy
7230 steps :
7735 uses : vapor/ci/.github/actions/ci-swift-check-api-breakage@reusable-workflows
7836
7937 linux-all :
80- if : github.event_name == 'pull_request'
38+ if : ${{ !( github.event.pull_request.draft || false) }}
8139 strategy :
8240 fail-fast : false
8341 matrix :
@@ -107,13 +65,28 @@ jobs:
10765 POSTGRES_HOST_AUTH_METHOD : ${{ matrix.dbauth }}
10866 POSTGRES_INITDB_ARGS : --auth-host=${{ matrix.dbauth }}
10967 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
11078 - name : Check out package
11179 uses : actions/checkout@v3
11280 - 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+ uses : vapor/swift-codecov-action@v0.2
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
11487
11588 macos-all :
116- if : github.event_name == 'pull_request'
89+ if : ${{ !( github.event.pull_request.draft || false) }}
11790 strategy :
11891 fail-fast : false
11992 matrix :
0 commit comments