aboutsummaryrefslogtreecommitdiffstats
path: root/.github/workflows/python.yml
diff options
context:
space:
mode:
authorAlex <git@ajschof.me>2024-08-13 17:59:06 +0100
committerGitHub <noreply@github.com>2024-08-13 17:59:06 +0100
commitb34f54057c6efc24e2973bac0bdda1510994783c (patch)
treee9071f8ed7fc2332beb348c452b2c129c008ce63 /.github/workflows/python.yml
parent0b38e6b20157cc0fe59dd3dc85905e18e0d0f555 (diff)
parentc25344e1bac47dbf6e2bf7afcb8568058e5dddcd (diff)
downloadde-project-bentley-b34f54057c6efc24e2973bac0bdda1510994783c.tar.gz
de-project-bentley-b34f54057c6efc24e2973bac0bdda1510994783c.zip
Merge pull request #25 from ajschofield/chore/temp-merge-main-to-dev
pr: merge main changes to development
Diffstat (limited to '.github/workflows/python.yml')
-rw-r--r--.github/workflows/python.yml50
1 files changed, 50 insertions, 0 deletions
diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml
new file mode 100644
index 0000000..7d5b5b1
--- /dev/null
+++ b/.github/workflows/python.yml
@@ -0,0 +1,50 @@
+name: python-quality-checks
+
+on:
+ push:
+ branches: [development]
+ pull_request:
+ branches: [development, staging]
+
+jobs:
+
+ check-if-py-files-exist:
+ runs-on: ubuntu-latest
+ outputs:
+ py_files_exist: ${{ steps.check.outputs.py_files_exist }}
+ steps:
+ - uses: actions/checkout@v2
+ - id: check_files
+ run: |
+ if [ -n "$(find . -name '*.py')" ]; then
+ echo "::set-output name=py_files_exist::true"
+ else
+ echo "::set-output name=py_files_exist::false"
+ fi
+
+ quality-checks:
+ needs: check-if-py-files-exist
+ if: ${{ needs.check-if-py-files-exist.outputs.py_files_exist == 'true' }}
+ runs-on: ubuntu-latest
+ steps:
+ - uses : actions/checkout@v2
+ - name : Setup
+ uses : actions/setup-python@v2
+ with:
+ python-version: 3.11
+ - name : Dependencies
+ run: |
+ python -m pip install --upgrade pip
+ pip install flake8 pylint black bandit safety
+ - name : Linting
+ run: |
+ flake8 .
+ find . -name "*.py" | xargs pylint
+ - name : Formatting
+ run: |
+ black --check .
+ - name: Security
+ run: |
+ bandit -r .
+ safety check
+ \ No newline at end of file
git.ajschof.me — hosted by ajschofield — powered by cgit