Many tweaks
This commit is contained in:
parent
5398ad123c
commit
227be6dd51
20 changed files with 1350 additions and 174 deletions
40
.forgejo/workflows/lint.yml
Normal file
40
.forgejo/workflows/lint.yml
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
name: Lint
|
||||
|
||||
on:
|
||||
push:
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: docker
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Install system dependencies
|
||||
run: |
|
||||
apt-get update
|
||||
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
|
||||
black pyflakes3 python3-bandit
|
||||
|
||||
- name: Run linters
|
||||
run: |
|
||||
black --diff --check enroll/*
|
||||
black --diff --check tests/*
|
||||
pyflakes3 enroll/*
|
||||
pyflakes3 tests/*
|
||||
bandit -r enroll/
|
||||
|
||||
# Notify if any previous step in this job failed
|
||||
- name: Notify on failure
|
||||
if: ${{ failure() }}
|
||||
env:
|
||||
WEBHOOK_URL: ${{ secrets.NODERED_WEBHOOK_URL }}
|
||||
REPOSITORY: ${{ forgejo.repository }}
|
||||
RUN_NUMBER: ${{ forgejo.run_number }}
|
||||
SERVER_URL: ${{ forgejo.server_url }}
|
||||
run: |
|
||||
curl -X POST \
|
||||
-H "Content-Type: application/json" \
|
||||
-d "{\"repository\":\"$REPOSITORY\",\"run_number\":\"$RUN_NUMBER\",\"status\":\"failure\",\"url\":\"$SERVER_URL/$REPOSITORY/actions/runs/$RUN_NUMBER\"}" \
|
||||
"$WEBHOOK_URL"
|
||||
Loading…
Add table
Add a link
Reference in a new issue