From e55dbbced1045b4fe4eea222da3e62c40366e26a Mon Sep 17 00:00:00 2001 From: Marc Cataford Date: Sat, 27 Jul 2024 15:03:58 -0400 Subject: [PATCH] ci: add static+dynamic analysis steps on push --- .forgejo/workflows/ci.yml | 36 ++++++++++++++++++++++++++++++++++++ action.yml | 1 + 2 files changed, 37 insertions(+) create mode 100644 .forgejo/workflows/ci.yml diff --git a/.forgejo/workflows/ci.yml b/.forgejo/workflows/ci.yml new file mode 100644 index 0000000..17f4686 --- /dev/null +++ b/.forgejo/workflows/ci.yml @@ -0,0 +1,36 @@ +on: [push] + +jobs: + static-analysis: + name: Static analysis + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Yaml formatting + id: yaml-format + run: pipx run yamllint . + continue-on-error: true + - name: Python formatting + id: python-format + run: pipx run black . --check + continue-on-error: true + - name: Job status + if: | + ${{ steps.yaml-format.outcome != 'success' }} || + ${{ steps.python-format.outcome != 'success' }} + run: exit 1 + dynamic-analysis: + name: Dynamic analysis + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Install dependencies + run: pip install -r ./requirements.txt + - name: Python linting + id: python-linting + run: pipx run pylint **/*.py + continue-on-error: true + - name: Job status + if: ${{ steps.python-linting.outcome != 'success' }} + run: exit 1 + diff --git a/action.yml b/action.yml index de000d9..15191da 100644 --- a/action.yml +++ b/action.yml @@ -1,3 +1,4 @@ +--- name: Post build status to Discord inputs: