From 33acf2ec36aaeb258f8143166d2bc7e13bf14f9a 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 | 30 ++++++++++++++++++++++++++++++ action.yml | 1 + 2 files changed, 31 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..77cebeb --- /dev/null +++ b/.forgejo/workflows/ci.yml @@ -0,0 +1,30 @@ +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 + run: pipx run pylint **/*.py 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: