Skip to content

Commit d8acf41

Browse files
committed
github-ci: add workflow for SSL testing
The workflow uses Tarantool Enterprise Edition. It does not run for outside pull requests by default. Such pull requests may be labeled with `full-ci`. To avoid security problems, the label must be reset manually for every run. Closes #217
1 parent 58dbfdc commit d8acf41

File tree

2 files changed

+94
-5
lines changed

2 files changed

+94
-5
lines changed

Diff for: .github/workflows/testing.yml

+93-5
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,19 @@ name: testing
33
on:
44
push:
55
pull_request:
6+
pull_request_target:
7+
types: [labeled]
68

79
jobs:
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,97 @@ 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+
- '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:
101186
# We want to run on external PRs, but not on our own internal
102187
# PRs as they'll be run by the push to the branch.
103188
#
104189
# The main trick is described here:
105190
# https://github.com/Dart-Code/Dart-Code/pull/2375
106191
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)
108194

109195
runs-on: windows-2022
110196

@@ -132,6 +218,8 @@ jobs:
132218
- name: Install test requirements
133219
run: pip install -r requirements-test.txt
134220

221+
- run: wsl --set-default-version 1
222+
135223
- name: Setup WSL for tarantool
136224
uses: Vampire/setup-wsl@v1
137225
with:

Diff for: CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
88

99
### Added
1010
- SSL support (PR #220, #217).
11+
- Tarantool Enterprise testing workflow on GitHub actions (PR #220).
1112

1213
### Changed
1314

0 commit comments

Comments
 (0)