@@ -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,97 @@ jobs:
97
100
- name : Run tests
98
101
run : make test
99
102
100
- run_tests_windows :
103
+ run_tests_ssl_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
+ - ' 2.10.0-1-gfa775b383-r486-linux-x86_64'
123
+ python :
124
+ - ' 3.5'
125
+ - ' 3.6'
126
+ - ' 3.7'
127
+ - ' 3.8'
128
+ - ' 3.9'
129
+ - ' 3.10'
130
+ msgpack-deps :
131
+ # latest msgpack will be installed as a part of requirements.txt
132
+ - ' '
133
+
134
+ steps :
135
+ - name : Clone the connector
136
+ uses : actions/checkout@v2
137
+ # This is needed for pull_request_target because this event runs in the
138
+ # context of the base commit of the pull request. It works fine for
139
+ # `push` and `workflow_dispatch` because the default behavior is used
140
+ # if `ref` and `repository` are empty.
141
+ with :
142
+ ref : ${{github.event.pull_request.head.ref}}
143
+ repository : ${{github.event.pull_request.head.repo.full_name}}
144
+
145
+ - name : Install tarantool ${{ matrix.tarantool }}
146
+ run : |
147
+ ARCHIVE_NAME=tarantool-enterprise-bundle-${{ matrix.tarantool }}.tar.gz
148
+ curl -O -L https://${{ secrets.SDK_DOWNLOAD_TOKEN }}@download.tarantool.io/enterprise/${ARCHIVE_NAME}
149
+ tar -xzf ${ARCHIVE_NAME}
150
+ rm -f ${ARCHIVE_NAME}
151
+
152
+ - name : Setup Python for tests
153
+ uses : actions/setup-python@v2
154
+ with :
155
+ python-version : ${{ matrix.python }}
156
+
157
+ - name : Install specific version of msgpack package
158
+ if : startsWith(matrix.msgpack-deps, 'msgpack==') == true
159
+ run : |
160
+ pip install ${{ matrix.msgpack-deps }}
161
+
162
+ - name : Install specific version of msgpack-python package
163
+ # msgpack package is a replacement for deprecated msgpack-python.
164
+ # To test compatibility with msgpack-python we must ignore
165
+ # requirements.txt install of msgpack package by overwriting it
166
+ # with sed.
167
+ if : startsWith(matrix.msgpack-deps, 'msgpack-python==') == true
168
+ run : |
169
+ pip install ${{ matrix.msgpack-deps }}
170
+ sed -i -e "s/^msgpack.*$/${{ matrix.msgpack-deps }}/" requirements.txt
171
+
172
+ - name : Install package requirements
173
+ run : pip install -r requirements.txt
174
+
175
+ - name : Install test requirements
176
+ run : pip install -r requirements-test.txt
177
+
178
+ - name : Run tests
179
+ run : |
180
+ source tarantool-enterprise/env.sh
181
+ make test
182
+ env :
183
+ TEST_TNT_SSL : true
184
+
185
+ run_tests_ce_windows :
101
186
# We want to run on external PRs, but not on our own internal
102
187
# PRs as they'll be run by the push to the branch.
103
188
#
104
189
# The main trick is described here:
105
190
# https://github.com/Dart-Code/Dart-Code/pull/2375
106
191
if : github.event_name == 'push' ||
107
- github.event.pull_request.head.repo.full_name != github.repository
192
+ (github.event_name == 'pull_request' &&
193
+ github.event.pull_request.head.repo.full_name != github.repository)
108
194
109
195
runs-on : windows-2022
110
196
0 commit comments