Skip to content

Commit 26454b0

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 6072f4d commit 26454b0

File tree

2 files changed

+20
-15
lines changed

2 files changed

+20
-15
lines changed

.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', 'Makefile']
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")

.github/workflows/testing.yml

+6-15
Original file line numberDiff line numberDiff line change
@@ -175,11 +175,6 @@ jobs:
175175
- name: Clone the connector repo
176176
uses: actions/checkout@v2
177177

178-
- name: Remove connector source code
179-
run: |
180-
rm -rf tarantool
181-
rm setup.py
182-
183178
- name: Install tarantool ${{ matrix.tarantool }}
184179
uses: tarantool/setup-tarantool@v1
185180
with:
@@ -190,6 +185,9 @@ jobs:
190185
with:
191186
python-version: ${{ matrix.python }}
192187

188+
- name: Remove connector source code
189+
run: python3 .github/scripts/remove_source_code.py
190+
193191
- name: Install the package with pip
194192
run: pip3 install git+$GITHUB_SERVER_URL/$GITHUB_REPOSITORY@$GITHUB_REF_NAME
195193

@@ -306,21 +304,14 @@ 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
318-
319307
- name: Setup Python for tests
320308
uses: actions/setup-python@v2
321309
with:
322310
python-version: ${{ matrix.python }}
323311

312+
- name: Remove connector source code
313+
run: python3 .github/scripts/remove_source_code.py
314+
324315
- name: Install the package with pip
325316
run: pip3 install git+$env:GITHUB_SERVER_URL/$env:GITHUB_REPOSITORY@$env:GITHUB_REF_NAME
326317

0 commit comments

Comments
 (0)