@@ -3,16 +3,19 @@ name: testing
33on :
44  push :
55  pull_request :
6+   pull_request_target :
7+     types : [labeled] 
68
79jobs :
8-   run_tests_linux :
10+   run_tests_ce_linux :
911    #  We want to run on external PRs, but not on our own internal
1012    #  PRs as they'll be run by the push to the branch.
1113    # 
1214    #  The main trick is described here:
1315    #  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) 
1619
1720    runs-on : ubuntu-20.04 
1821
@@ -97,14 +100,93 @@ jobs:
97100      - name : Run tests 
98101        run : make test 
99102
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 : ['3.5', '3.6', '3.7', '3.8', '3.9', '3.10'] 
126+         msgpack-deps :
127+           #  latest msgpack will be installed as a part of requirements.txt
128+           - ' ' 
129+ 
130+     steps :
131+       - name : Clone the connector 
132+         uses : actions/checkout@v2 
133+         #  This is needed for pull_request_target because this event runs in the
134+         #  context of the base commit of the pull request. It works fine for
135+         #  `push` and `workflow_dispatch` because the default behavior is used
136+         #  if `ref` and `repository` are empty.
137+         with :
138+           ref : ${{github.event.pull_request.head.ref}} 
139+           repository : ${{github.event.pull_request.head.repo.full_name}} 
140+ 
141+       - name : Install tarantool ${{ matrix.tarantool }} 
142+         run : | 
143+           ARCHIVE_NAME=tarantool-enterprise-bundle-${{ matrix.tarantool }}.tar.gz 
144+           curl -O -L https://${{ secrets.SDK_DOWNLOAD_TOKEN }}@download.tarantool.io/enterprise/${ARCHIVE_NAME} 
145+           tar -xzf ${ARCHIVE_NAME} 
146+           rm -f ${ARCHIVE_NAME} 
147+ 
148+        - name : Setup Python for tests 
149+         uses : actions/setup-python@v2 
150+         with :
151+           python-version : ${{ matrix.python }} 
152+ 
153+       - name : Install specific version of msgpack package 
154+         if : startsWith(matrix.msgpack-deps, 'msgpack==') == true 
155+         run : | 
156+           pip install ${{ matrix.msgpack-deps }} 
157+ 
158+        - name : Install specific version of msgpack-python package 
159+         #  msgpack package is a replacement for deprecated msgpack-python.
160+         #  To test compatibility with msgpack-python we must ignore
161+         #  requirements.txt install of msgpack package by overwriting it
162+         #  with sed.
163+         if : startsWith(matrix.msgpack-deps, 'msgpack-python==') == true 
164+         run : | 
165+           pip install ${{ matrix.msgpack-deps }} 
166+           sed -i -e "s/^msgpack.*$/${{ matrix.msgpack-deps }}/" requirements.txt 
167+ 
168+        - name : Install package requirements 
169+         run : pip install -r requirements.txt 
170+ 
171+       - name : Install test requirements 
172+         run : pip install -r requirements-test.txt 
173+ 
174+       - name : Run tests 
175+         run : | 
176+           source tarantool-enterprise/env.sh 
177+           make test 
178+          env :
179+           TEST_TNT_SSL : ${{ matrix.tarantool == '2.10.0-1-gfa775b383-r486-linux-x86_64' }} 
180+ 
181+   run_tests_ce_windows :
101182    #  We want to run on external PRs, but not on our own internal
102183    #  PRs as they'll be run by the push to the branch.
103184    # 
104185    #  The main trick is described here:
105186    #  https://github.com/Dart-Code/Dart-Code/pull/2375
106187    if : github.event_name == 'push' || 
107-       github.event.pull_request.head.repo.full_name != github.repository 
188+       (github.event_name == 'pull_request' && 
189+         github.event.pull_request.head.repo.full_name != github.repository) 
108190
109191    runs-on : windows-2022 
110192
0 commit comments