-
Notifications
You must be signed in to change notification settings - Fork 0
47 lines (38 loc) · 1.08 KB
/
python-app.yml
File metadata and controls
47 lines (38 loc) · 1.08 KB
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
name: Python Compilation
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Install dependencies
run: |
pip install openai
- name: Compile Python files
run: |
set -e
mkdir -p build
for file in $(find . -name '*.py'); do
python -W error -m py_compile $file 2>&1 | tee -a build/py_warnings.log
done
- name: Check for errors
run: |
set -e
if grep -Rl '^SyntaxError\|IndentationError' build/py_warnings.log; then
echo "There are syntax or indentation errors in some Python files."
exit 1
fi
- name: Check for warnings
run: |
set -e
if grep -Rl '^Warning' build/py_warnings.log; then
echo "There are warnings in some Python files."
fi
- name: Success
run: |
set -e
echo "All Python files compiled successfully without errors or warnings."