-
Notifications
You must be signed in to change notification settings - Fork 0
113 lines (89 loc) · 2.7 KB
/
Copy pathci.yml
File metadata and controls
113 lines (89 loc) · 2.7 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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
name: CI-micro
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
jobs:
bandit:
runs-on: ubuntu-latest
permissions:
contents: read
security-events: write
actions: read
steps:
- uses: actions/checkout@v4
- name: Run Bandit Analysis
uses: PyCQA/bandit-action@v1
with:
severity: "medium"
confidence: "medium"
exclude: ".venv,venv,.git,__pycache__,tests,tests_integration,migrations,lib_tools,assets,config.py"
targets: "."
semgrep:
runs-on: ubuntu-latest
permissions:
contents: read
security-events: write
container:
image: semgrep/semgrep
steps:
- uses: actions/checkout@v4
- name: Run Semgrep Analysis
continue-on-error: true
run: semgrep scan --config p/python --metrics=off
pylint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v8.1.0
with:
enable-cache: true
- name: Set up Python
run: uv python install
- name: Run pylint
run: |
FILES=$(git ls-files '*.py' \
':!.venv/**' \
':!venv/**' \
':!tests/**' \
':!tests_integration/**' \
':!migrations/**' \
':!lib_tools/**' \
':!assets/**' \
':!config.py')
OUTPUT=$(uv run --frozen env PYTHONPATH=../ pylint \
--disable=E1136,E1101,E1102,E1123,E1121 \
$FILES) || echo "$?" > rc.txt
echo "$OUTPUT"
echo "$OUTPUT" > output.txt
- name: Check code rating > 6.0
run: |
RATING=$(grep "Your code has been rated at" output.txt \
| sed -E 's/.*rated at (-?[0-9]+(\.[0-9]+)?).*/\1/')
echo "Rating is $RATING"
awk -v r="$RATING" 'BEGIN { exit (r < 6.0) }'
pytest:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v8.1.0
with:
enable-cache: true
- name: Set up Python
run: uv python install
- name: Run pytest
run: |
uv run --frozen pytest tests -m "not integration" -q
nix-integration-no-isolate-m:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Nix
uses: cachix/install-nix-action@v31
# fast integration tests only; the QEMU suite is too slow in
# pure TCG on hosted runners, if you need run it locally via nix instead
- name: Run fast integration checks
run: nix build -L .#checks.x86_64-linux.integration-fast