Skip to content

Commit 768212c

Browse files
ci: run tests with pip artifacts
Part of #198
1 parent 9fe3c8a commit 768212c

File tree

2 files changed

+123
-2
lines changed

2 files changed

+123
-2
lines changed

.github/workflows/packing.yml

+121
Original file line numberDiff line numberDiff line change
@@ -55,3 +55,124 @@ jobs:
5555
path: pip_dist
5656
retention-days: 1
5757
if-no-files-found: error
58+
59+
run_tests_pip_package_linux:
60+
needs: pack_pip
61+
62+
# We want to run on external PRs, but not on our own internal
63+
# PRs as they'll be run by the push to the branch.
64+
#
65+
# The main trick is described here:
66+
# https://github.com/Dart-Code/Dart-Code/pull/2375
67+
if: (github.event_name == 'push') ||
68+
(github.event_name == 'pull_request' &&
69+
github.event.pull_request.head.repo.full_name != github.repository)
70+
runs-on: ubuntu-20.04
71+
72+
strategy:
73+
fail-fast: false
74+
75+
steps:
76+
- name: Clone the connector repo
77+
uses: actions/checkout@v3
78+
79+
- name: Setup Python
80+
uses: actions/setup-python@v4
81+
with:
82+
python-version: '3.10'
83+
84+
- name: Remove connector source code
85+
run: python3 .github/scripts/remove_source_code.py
86+
87+
- name: Install tarantool
88+
uses: tarantool/setup-tarantool@v1
89+
with:
90+
tarantool-version: '2.10'
91+
92+
- name: Download pip package artifacts
93+
uses: actions/download-artifact@v3
94+
with:
95+
name: pip_dist
96+
path: pip_dist
97+
98+
- name: Install the package from pip artifacts
99+
run: pip3 install pip_dist/*.whl
100+
101+
- name: Install test requirements
102+
run: pip3 install -r requirements-test.txt
103+
104+
- name: Run tests
105+
run: make test-pure-install
106+
107+
run_tests_pip_package_windows:
108+
needs: pack_pip
109+
110+
# We want to run on external PRs, but not on our own internal
111+
# PRs as they'll be run by the push to the branch.
112+
#
113+
# The main trick is described here:
114+
# https://github.com/Dart-Code/Dart-Code/pull/2375
115+
if: (github.event_name == 'push') ||
116+
(github.event_name == 'pull_request' &&
117+
github.event.pull_request.head.repo.full_name != github.repository)
118+
119+
runs-on: windows-2022
120+
121+
strategy:
122+
fail-fast: false
123+
124+
steps:
125+
- name: Clone the connector repo
126+
uses: actions/checkout@v3
127+
128+
- name: Setup Python
129+
uses: actions/setup-python@v4
130+
with:
131+
python-version: '3.10'
132+
133+
- name: Remove connector source code
134+
run: python3 .github/scripts/remove_source_code.py
135+
136+
- name: Download pip package artifacts
137+
uses: actions/download-artifact@v3
138+
with:
139+
name: pip_dist
140+
path: pip_dist
141+
142+
- name: Install the package from pip artifacts
143+
run: pip3 install (gci ./pip_dist *.whl).fullname
144+
145+
- name: Install test requirements
146+
run: pip3 install -r requirements-test.txt
147+
148+
- name: Setup WSL for tarantool
149+
uses: Vampire/setup-wsl@v1
150+
with:
151+
distribution: Ubuntu-20.04
152+
153+
- name: Install tarantool
154+
shell: wsl-bash_Ubuntu-20.04 {0}
155+
run: |
156+
curl -L https://tarantool.io/release/2/installer.sh | bash -s
157+
sudo apt install -y tarantool tarantool-dev
158+
159+
- name: Setup test tarantool instance
160+
shell: wsl-bash_Ubuntu-20.04 {0}
161+
run: |
162+
rm -f ./tarantool.pid ./tarantool.log
163+
TNT_PID=$(tarantool ./test/suites/lib/tarantool_python_ci.lua > tarantool.log 2>&1 & echo $!)
164+
touch tarantool.pid
165+
echo $TNT_PID > ./tarantool.pid
166+
167+
- name: Run tests
168+
env:
169+
REMOTE_TARANTOOL_HOST: localhost
170+
REMOTE_TARANTOOL_CONSOLE_PORT: 3302
171+
run: make test-pure-install
172+
173+
- name: Stop test tarantool instance
174+
if: ${{ always() }}
175+
shell: wsl-bash_Ubuntu-20.04 {0}
176+
run: |
177+
cat tarantool.log || true
178+
kill $(cat tarantool.pid) || true

.github/workflows/testing.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ jobs:
148148
env:
149149
TEST_TNT_SSL: ${{ matrix.tarantool == '2.10.0-1-gfa775b383-r486-linux-x86_64' }}
150150

151-
run_tests_with_install_linux:
151+
run_tests_pip_branch_install_linux:
152152
# We want to run on external PRs, but not on our own internal
153153
# PRs as they'll be run by the push to the branch.
154154
#
@@ -276,7 +276,7 @@ jobs:
276276
cat tarantool.log || true
277277
kill $(cat tarantool.pid) || true
278278
279-
run_tests_with_install_windows:
279+
run_tests_pip_branch_install_windows:
280280
# We want to run on external PRs, but not on our own internal
281281
# PRs as they'll be run by the push to the branch.
282282
#

0 commit comments

Comments
 (0)