Skip to content

Commit d09ccd8

Browse files
ci: remove source code with script
Remove connector source code for pure install tests with Python script. Python was chosen since it would work both on Windows and Linux. Part of #198
1 parent f759b8d commit d09ccd8

File tree

2 files changed

+17
-12
lines changed

2 files changed

+17
-12
lines changed

Diff for: .github/scripts/remove_source_code.py

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import os, shutil
2+
3+
required_paths = ['.git', '.github', 'test', 'requirements-test.txt']
4+
5+
for path in os.listdir():
6+
if path in required_paths:
7+
continue
8+
9+
if os.path.isfile(path) or os.path.islink(path):
10+
os.remove(path)
11+
elif os.path.isdir(path):
12+
shutil.rmtree(path)
13+
else:
14+
raise ValueError(f"{path} is not a file, link or dir")

Diff for: .github/workflows/testing.yml

+3-12
Original file line numberDiff line numberDiff line change
@@ -176,9 +176,7 @@ jobs:
176176
uses: actions/checkout@v2
177177

178178
- name: Remove connector source code
179-
run: |
180-
rm -rf tarantool
181-
rm setup.py
179+
run: python .github/scripts/remove_source_code.py
182180

183181
- name: Install tarantool ${{ matrix.tarantool }}
184182
uses: tarantool/setup-tarantool@v1
@@ -306,15 +304,8 @@ jobs:
306304
- name: Clone the connector repo
307305
uses: actions/checkout@v2
308306

309-
- name: Remove connector source code (main folder)
310-
uses: JesseTG/[email protected]
311-
with:
312-
path: tarantool
313-
314-
- name: Remove connector source code (setup.py)
315-
uses: JesseTG/[email protected]
316-
with:
317-
path: setup.py
307+
- name: Remove connector source code
308+
run: python .github/scripts/remove_source_code.py
318309

319310
- name: Setup Python for tests
320311
uses: actions/setup-python@v2

0 commit comments

Comments
 (0)