-
Notifications
You must be signed in to change notification settings - Fork 41
74 lines (60 loc) · 1.98 KB
/
static-checks.yml
File metadata and controls
74 lines (60 loc) · 1.98 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
name: Static analysis of scripts
on:
# run on pull requests to the main branch
pull_request:
branches: [main]
# run on pushes to the main branch
push:
branches: [main]
# implicitely set all other permissions to none
permissions:
contents: read # actions/checkout
# cancel in progress builds for this workflow triggered by the same ref
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
flake8:
name: Install and run Flake8 on Python scripts
runs-on: ubuntu-latest
steps:
- name: Install flake8
run: sudo apt update && sudo apt -y install file flake8
- uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Run Flake8 and dependencies
run: |
. scripts/functions
scan_files text/x-script.python flake8
pylint:
name: Install and run Pylint on Python scripts
runs-on: ubuntu-latest
steps:
- name: Install Pylint and dependencies
run: sudo apt update && sudo apt -y install file pylint python3-voluptuous
- uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Run Pylint (error mode)
run: |
. scripts/functions
scan_files text/x-script.python pylint --errors-only
shellcheck:
name: Install and run ShellCheck on shell scripts
runs-on: ubuntu-latest
steps:
- name: Install ShellCheck
run: sudo apt update && sudo apt -y install shellcheck file
- uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Run ShellCheck
run: |
. scripts/functions
# Ignore the double quoting warning, script authors have better
# knowledge of variable contents, and we accept that in practice
# "local" is implemented everywhere so it's OK to use even though
# it's not strictly POSIX.
export SHELLCHECK_OPTS="-e SC2086,SC3043"
scan_files text/x-shellscript shellcheck