Spaces:
Sleeping
Sleeping
Owadokun Tosin Tobi commited on
Create quality_gate.yml
Browse files
.github/workflows/quality_gate.yml
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
name: Production Quality Gate
|
| 2 |
+
|
| 3 |
+
on:
|
| 4 |
+
push:
|
| 5 |
+
branches: [ "main" ]
|
| 6 |
+
pull_request:
|
| 7 |
+
branches: [ "main" ]
|
| 8 |
+
|
| 9 |
+
jobs:
|
| 10 |
+
build-and-audit:
|
| 11 |
+
runs-on: ubuntu-latest
|
| 12 |
+
|
| 13 |
+
steps:
|
| 14 |
+
- uses: actions/checkout@v3
|
| 15 |
+
|
| 16 |
+
- name: Set up Python 3.10
|
| 17 |
+
uses: actions/setup-python@v3
|
| 18 |
+
with:
|
| 19 |
+
python-version: "3.10"
|
| 20 |
+
|
| 21 |
+
- name: Install Dependencies
|
| 22 |
+
run: |
|
| 23 |
+
python -m pip install --upgrade pip
|
| 24 |
+
pip install flake8
|
| 25 |
+
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
|
| 26 |
+
|
| 27 |
+
- name: Lint with Flake8 (Style Enforcer)
|
| 28 |
+
run: |
|
| 29 |
+
# stop the build if there are Python syntax errors or undefined names
|
| 30 |
+
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
|
| 31 |
+
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
|
| 32 |
+
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
|