-
Notifications
You must be signed in to change notification settings - Fork 7
60 lines (58 loc) · 1.78 KB
/
sanity.yaml
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
name: Sanity self-tests
on:
pull_request:
jobs:
waivers-syntax-check:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Contest deps
run: |
sudo apt-get update
sudo apt-get install -y python3-rpm python3-dnf
- name: Collect waivers
run: |
python3 <<'EOF'
import sys
from lib import waive
try:
list(waive.collect_waivers())
sys.exit(0)
except waive.WaiveParseError as e:
print(str(e))
sys.exit(1)
EOF
- name: Check Vim modeline empty line
run: |
function err { echo -e "error: $1" >&2; exit 1; }
for file in conf/waivers/*; do
[[ -f "$file" ]] || err "$file not found"
out=$(grep -B1 '^# vim' "$file") || err "vim modeline not found in $file"
out=$(head -n1 <<<"$out")
if [[ $out ]]; then
msg="line above vim modeline in $file not empty: $out"
msg+="\nPlease keep one empty line above the vim modeline."
err "$msg"
fi
done
flake8:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install flake8
run: python3 -m pip install flake8
- name: Run flake8
run: flake8 -v
tmt:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install tmt
run: python3 -m pip install tmt
- name: Run tmt lint
run: tmt lint --failed-only
- name: Run basic tmt run discover
run: tmt run -v plans -n /plans/default discover -h fmf