@@ -3,16 +3,19 @@ name: testing
3
3
on :
4
4
push :
5
5
pull_request :
6
+ pull_request_target :
7
+ types : [labeled]
6
8
7
9
jobs :
8
- run_tests_linux :
10
+ run_tests_ce_linux :
9
11
# We want to run on external PRs, but not on our own internal
10
12
# PRs as they'll be run by the push to the branch.
11
13
#
12
14
# The main trick is described here:
13
15
# https://github.com/Dart-Code/Dart-Code/pull/2375
14
- if : github.event_name == 'push' ||
15
- github.event.pull_request.head.repo.full_name != github.repository
16
+ if : (github.event_name == 'push') ||
17
+ (github.event_name == 'pull_request' &&
18
+ github.event.pull_request.head.repo.full_name != github.repository)
16
19
17
20
runs-on : ubuntu-20.04
18
21
@@ -97,14 +100,112 @@ jobs:
97
100
- name : Run tests
98
101
run : make test
99
102
100
- run_tests_windows :
103
+ run_tests_ee_linux :
104
+ # The same as for run_tests_ce_linux, but it does not run on pull requests
105
+ # from forks by default. Tests will run only when the pull request is
106
+ # labeled with `full-ci`. To avoid security problems, the label must be
107
+ # reset manually for every run.
108
+ #
109
+ # We need to use `pull_request_target` because it has access to base
110
+ # repository secrets unlike `pull_request`.
111
+ if : (github.event_name == 'push') ||
112
+ (github.event_name == 'pull_request_target' &&
113
+ github.event.pull_request.head.repo.full_name != github.repository &&
114
+ github.event.label.name == 'full-ci')
115
+
116
+ runs-on : ubuntu-20.04
117
+
118
+ strategy :
119
+ fail-fast : false
120
+ matrix :
121
+ tarantool :
122
+ - ' 1.10.11-0-gf0b0e7ecf-r470'
123
+ - ' 2.8.3-21-g7d35cd2be-r470'
124
+ - ' 2.10.0-1-gfa775b383-r486-linux-x86_64'
125
+ python :
126
+ - ' 3.5'
127
+ - ' 3.6'
128
+ - ' 3.7'
129
+ - ' 3.8'
130
+ - ' 3.9'
131
+ - ' 3.10'
132
+ ssl : [false]
133
+ msgpack-deps :
134
+ # latest msgpack will be installed as a part of requirements.txt
135
+ - ' '
136
+ include :
137
+ - tarantool : ' 2.10.0-1-gfa775b383-r486-linux-x86_64'
138
+ python :
139
+ - ' 3.5'
140
+ - ' 3.6'
141
+ - ' 3.7'
142
+ - ' 3.8'
143
+ - ' 3.9'
144
+ - ' 3.10'
145
+ ssl : true
146
+ msgpack-deps :
147
+ - ' '
148
+
149
+ steps :
150
+ - name : Clone the connector
151
+ uses : actions/checkout@v2
152
+ # This is needed for pull_request_target because this event runs in the
153
+ # context of the base commit of the pull request. It works fine for
154
+ # `push` and `workflow_dispatch` because the default behavior is used
155
+ # if `ref` and `repository` are empty.
156
+ with :
157
+ ref : ${{github.event.pull_request.head.ref}}
158
+ repository : ${{github.event.pull_request.head.repo.full_name}}
159
+
160
+ - name : Install tarantool ${{ matrix.tarantool }}
161
+ run : |
162
+ ARCHIVE_NAME=tarantool-enterprise-bundle-${{ matrix.tarantool }}.tar.gz
163
+ curl -O -L https://${{ secrets.SDK_DOWNLOAD_TOKEN }}@download.tarantool.io/enterprise/${ARCHIVE_NAME}
164
+ tar -xzf ${ARCHIVE_NAME}
165
+ rm -f ${ARCHIVE_NAME}
166
+
167
+ - name : Setup Python for tests
168
+ uses : actions/setup-python@v2
169
+ with :
170
+ python-version : ${{ matrix.python }}
171
+
172
+ - name : Install specific version of msgpack package
173
+ if : startsWith(matrix.msgpack-deps, 'msgpack==') == true
174
+ run : |
175
+ pip install ${{ matrix.msgpack-deps }}
176
+
177
+ - name : Install specific version of msgpack-python package
178
+ # msgpack package is a replacement for deprecated msgpack-python.
179
+ # To test compatibility with msgpack-python we must ignore
180
+ # requirements.txt install of msgpack package by overwriting it
181
+ # with sed.
182
+ if : startsWith(matrix.msgpack-deps, 'msgpack-python==') == true
183
+ run : |
184
+ pip install ${{ matrix.msgpack-deps }}
185
+ sed -i -e "s/^msgpack.*$/${{ matrix.msgpack-deps }}/" requirements.txt
186
+
187
+ - name : Install package requirements
188
+ run : pip install -r requirements.txt
189
+
190
+ - name : Install test requirements
191
+ run : pip install -r requirements-test.txt
192
+
193
+ - name : Run tests
194
+ run : |
195
+ source tarantool-enterprise/env.sh
196
+ make test
197
+ env :
198
+ TEST_TNT_SSL : ${{matrix.ssl}}
199
+
200
+ run_tests_ce_windows :
101
201
# We want to run on external PRs, but not on our own internal
102
202
# PRs as they'll be run by the push to the branch.
103
203
#
104
204
# The main trick is described here:
105
205
# https://github.com/Dart-Code/Dart-Code/pull/2375
106
206
if : github.event_name == 'push' ||
107
- github.event.pull_request.head.repo.full_name != github.repository
207
+ (github.event_name == 'pull_request' &&
208
+ github.event.pull_request.head.repo.full_name != github.repository)
108
209
109
210
runs-on : windows-2022
110
211
0 commit comments