22
22
required : false
23
23
default : true
24
24
description : " Set to 'true' to run tests with Thread Sanitizer. Defaults to 'true'."
25
- with_public_api_check :
25
+ with_api_check :
26
26
type : boolean
27
27
required : false
28
28
default : true
50
50
EXTRA_FLAGS : ${{ inputs.extra_flags }}
51
51
WITH_TSAN : ${{ inputs.with_tsan && '--sanitize=thread' || '' }}
52
52
TEST_FILTER : ${{ inputs.test_filter != '' && format('--filter={0}', inputs.test_filter) || '' }}
53
+ WITH_COVERAGE : ${{ inputs.with_coverage && '--enable-code-coverage' || '' }}
53
54
54
- # We use the unversioned "jammy" docker tag to specify the "latest" Swift release in several jobs.
55
55
jobs :
56
56
api-breakage :
57
- if : ${{ inputs.with_public_api_check && !( github.event.pull_request.draft || false) && github.event_name == ' pull_request' }}
57
+ if : ${{ inputs.with_api_check && github.event_name == 'pull_request' && ! github.event. pull_request.draft }}
58
58
runs-on : ubuntu-latest
59
59
container : swift:jammy
60
- timeout-minutes : 20
60
+ timeout-minutes : 30
61
61
steps :
62
62
- name : Check out code
63
63
uses : actions/checkout@v4
@@ -67,70 +67,26 @@ jobs:
67
67
git config --global --add safe.directory "${GITHUB_WORKSPACE}"
68
68
swift package ${PACKAGE_ROOT} diagnose-api-breaking-changes origin/main ${EXTRA_FLAGS}
69
69
70
- dependency-graph :
71
- if : ${{ inputs.with_deps_submission && github.event_name == 'push' }}
72
- runs-on : ubuntu-latest
73
- container : swift:jammy
74
- permissions :
75
- contents : write
76
- steps :
77
- - name : Check out code
78
- uses : actions/checkout@v4
79
- - name : Fix Git configuration
80
- run : |
81
- git config --global --add safe.directory "${GITHUB_WORKSPACE}"
82
- apt-get update && apt-get install -y curl
83
- - name : Submit dependency graph
84
- uses :
vapor-community/[email protected]
85
- with :
86
- path : ${{ inputs.package_root != '' && inputs.package_root || github.workspace }}
87
-
88
- code-coverage :
89
- if : ${{ inputs.with_coverage && !(github.event.pull_request.draft || false) }}
70
+ gh-codeql :
71
+ if : ${{ inputs.with_gh_codeql && !(github.event.pull_request.draft || false) }}
90
72
runs-on : ubuntu-latest
91
- container : swift:jammy
73
+ permissions : { actions: write, contents: read, security-events: write }
92
74
timeout-minutes : 30
93
75
steps :
76
+ - name : Install latest Swift toolchain
77
+
78
+ with : { toolchain: latest }
94
79
- name : Check out code
95
80
uses : actions/checkout@v4
96
- - name : Run unit tests for coverage data
97
- run : |
98
- SWIFT_DETERMINISTIC_HASHING=1 swift test ${PACKAGE_ROOT} ${TEST_FILTER} --enable-code-coverage ${EXTRA_FLAGS}
99
- - name : Upload coverage data
100
-
101
- with :
102
- codecov_token : ${{ secrets.CODECOV_TOKEN || '' }}
103
- package_path : ${{ inputs.package_root }}
104
- build_parameters : ${{ inputs.extra_flags }}
105
-
106
- # gh-codeql:
107
- # if: ${{ (inputs.with_gh_codeql) && !(github.event.pull_request.draft || false) }}
108
- # runs-on: ubuntu-latest
109
- # container: swift:jammy
110
- # permissions: { actions: write, contents: read, security-events: write }
111
- # timeout-minutes: 30
112
- # steps:
113
- # - name: Check out code
114
- # uses: actions/checkout@v4
115
- # - name: Mark repo safe in non-fake global config
116
- # run: |
117
- # git config --global --add safe.directory "${GITHUB_WORKSPACE}"
118
- # - name: Check Swift compatibility
119
- # id: swift-check
120
- # uses: vapor/ci/.github/actions/check-compatible-swift@main
121
- # with:
122
- # package_root: ${{ inputs.package_root }}
123
- # - name: Initialize CodeQL
124
- # if: ${{ steps.swift-check.outputs.swift-compatible == 'true' }}
125
- # uses: github/codeql-action/init@v3
126
- # with: { languages: swift }
127
- # - name: Perform build
128
- # if: ${{ steps.swift-check.outputs.swift-compatible == 'true' }}
129
- # run: |
130
- # swift build ${PACKAGE_ROOT} ${EXTRA_FLAGS}
131
- # - name: Run CodeQL analyze
132
- # if: ${{ steps.swift-check.outputs.swift-compatible == 'true' }}
133
- # uses: github/codeql-action/analyze@v3
81
+ - name : Fix Git configuration
82
+ run : ' git config --global --add safe.directory "${GITHUB_WORKSPACE}"'
83
+ - name : Initialize CodeQL
84
+ uses : github/codeql-action/init@v3
85
+ with : { languages: swift }
86
+ - name : Perform build
87
+ run : ' swift build ${PACKAGE_ROOT} ${EXTRA_FLAGS}'
88
+ - name : Run CodeQL analyze
89
+ uses : github/codeql-action/analyze@v3
134
90
135
91
linux-unit :
136
92
if : ${{ !(github.event.pull_request.draft || false) }}
@@ -149,15 +105,22 @@ jobs:
149
105
steps :
150
106
- name : Check out code
151
107
uses : actions/checkout@v4
152
- - name : Check Swift compatibility
153
- id : swift-check
154
- uses : vapor/ci/.github/actions/check-compatible-swift@main
155
- with :
156
- package_root : ${{ inputs.package_root }}
157
108
- name : Run unit tests
158
- if : ${{ steps.swift-check.outputs.swift-compatible == 'true' }}
159
109
run : |
160
- SWIFT_DETERMINISTIC_HASHING=1 swift test ${PACKAGE_ROOT} ${WITH_TSAN} ${TEST_FILTER} ${EXTRA_FLAGS}
110
+ SWIFT_DETERMINISTIC_HASHING=1 \
111
+ swift test \
112
+ ${PACKAGE_ROOT} \
113
+ ${WITH_TSAN} \
114
+ ${WITH_COVERAGE} \
115
+ ${TEST_FILTER} \
116
+ ${EXTRA_FLAGS}
117
+ - name : Upload coverage data
118
+ if : ${{ inputs.with_coverage }}
119
+
120
+ with :
121
+ codecov_token : ${{ secrets.CODECOV_TOKEN || '' }}
122
+ package_path : ${{ inputs.package_root }}
123
+ build_parameters : ${{ inputs.extra_flags }}
161
124
162
125
macos-unit :
163
126
if : ${{ !(github.event.pull_request.draft || false) }}
@@ -166,7 +129,7 @@ jobs:
166
129
matrix :
167
130
include :
168
131
- macos-version : macos-13
169
- xcode-version : ' ~14.3 '
132
+ xcode-version : ' ~15.2 '
170
133
- macos-version : macos-14
171
134
xcode-version : latest
172
135
runs-on : ${{ matrix.macos-version }}
@@ -178,15 +141,22 @@ jobs:
178
141
xcode-version : ${{ matrix.xcode-version }}
179
142
- name : Check out code
180
143
uses : actions/checkout@v4
181
- - name : Check Swift compatibility
182
- id : swift-check
183
- uses : vapor/ci/.github/actions/check-compatible-swift@main
184
- with :
185
- package_root : ${{ inputs.package_root }}
186
144
- name : Run unit tests
187
- if : ${{ steps.swift-check.outputs.swift-compatible == 'true' }}
188
145
run : |
189
- SWIFT_DETERMINISTIC_HASHING=1 swift test ${PACKAGE_ROOT} ${WITH_TSAN} ${TEST_FILTER} ${EXTRA_FLAGS}
146
+ SWIFT_DETERMINISTIC_HASHING=1 \
147
+ swift test \
148
+ ${PACKAGE_ROOT} \
149
+ ${WITH_TSAN} \
150
+ ${WITH_COVERAGE} \
151
+ ${TEST_FILTER} \
152
+ ${EXTRA_FLAGS}
153
+ - name : Upload coverage data
154
+ if : ${{ inputs.with_coverage }}
155
+
156
+ with :
157
+ codecov_token : ${{ secrets.CODECOV_TOKEN || '' }}
158
+ package_path : ${{ inputs.package_root }}
159
+ build_parameters : ${{ inputs.extra_flags }}
190
160
191
161
# windows-unit:
192
162
# if: ${{ !(github.event.pull_request.draft || false) }}
0 commit comments