forked from complexorganizations/code-snippets
-
Notifications
You must be signed in to change notification settings - Fork 0
33 lines (33 loc) · 936 Bytes
/
build-python-code.yml
File metadata and controls
33 lines (33 loc) · 936 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
name: Python
on:
push:
paths:
- "**.py"
pull_request:
paths:
- "**.py"
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Check out code into the directory
uses: actions/checkout@v4
- name: Set up Python 3.10
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Install dependencies
run: |
pip install --upgrade pip
pip install -r Python/requirements.txt
- name: Run the code
run: |
ALL_FILES_IN_DIRECTORY=$(find Python/ -type f -name "*.py")
for CURRENT_FILE_IN_DIRECTORY in ${ALL_FILES_IN_DIRECTORY}; do
ALL_FILES_LIST[${ADD_CONTENT}]=${CURRENT_FILE_IN_DIRECTORY}
ADD_CONTENT=$(("${ADD_CONTENT}" + 1))
done
for FILE_LIST in "${ALL_FILES_LIST[@]}"; do
echo ${FILE_LIST}
python ${FILE_LIST}
done