-
Notifications
You must be signed in to change notification settings - Fork 15
98 lines (98 loc) · 2.82 KB
/
lint.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
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
---
name: "Lint"
on: # yamllint disable-line rule:truthy
push:
branches:
- "main"
pull_request:
branches: ["*"]
jobs:
lint:
name: "Format & Lint"
runs-on: "ubuntu-latest"
strategy:
matrix:
python-version:
- "3.10"
fail-fast: false
steps:
- uses: "actions/checkout@v4"
- uses: "bewuethr/[email protected]"
with:
config-file: ".yamllint"
- uses: "actions/setup-python@v5"
with:
python-version: "3.10"
- name: "Setup Python Environment"
run: "pip install -U pip virtualenv"
- name: "Install Dependencies"
run: |
virtualenv ~/.cache/virtualenv/authzedpy
source ~/.cache/virtualenv/authzedpy/bin/activate
pip install poetry
poetry env info
poetry install --only dev
- name: "Pyflakes"
run: |
source ~/.cache/virtualenv/authzedpy/bin/activate
find . -name "*.py" | grep -v "_pb2" | xargs pyflakes
- name: "Blacken"
run: |
source ~/.cache/virtualenv/authzedpy/bin/activate
black --check --diff .
- name: "Isort"
run: |
source ~/.cache/virtualenv/authzedpy/bin/activate
find . -name "*.py" | grep -v "_pb2" | xargs isort --check --diff
codeql:
name: "Analyze with CodeQL"
runs-on: "ubuntu-latest"
permissions:
actions: "read"
contents: "read"
security-events: "write"
strategy:
fail-fast: false
matrix:
language: ["python"]
steps:
- uses: "actions/checkout@v4"
- uses: "authzed/actions/codeql@main"
trivy:
name: "Analyze with Trivy"
runs-on: "ubuntu-latest"
steps:
- uses: "actions/checkout@v4"
- name: "Run Trivy vulnerability scanner"
uses: "aquasecurity/trivy-action@master"
with:
scan-type: "fs"
ignore-unfixed: true
format: "sarif"
output: "trivy-results.sarif"
severity: "CRITICAL"
- name: "Upload Trivy scan results to GitHub Security tab"
uses: "github/codeql-action/upload-sarif@v3"
with:
sarif_file: "trivy-results.sarif"
mypy:
name: "Type Check with Mypy"
runs-on: "ubuntu-latest"
steps:
- uses: "actions/checkout@v4"
- uses: "actions/setup-python@v5"
with:
python-version: "3.10"
- name: "Setup Python Environment"
run: "pip install -U pip virtualenv"
- name: "Install Dependencies"
run: |
virtualenv ~/.cache/virtualenv/authzedpy
source ~/.cache/virtualenv/authzedpy/bin/activate
pip install poetry
poetry env info
poetry install --only dev
- name: "mypy"
run: |
source ~/.cache/virtualenv/authzedpy/bin/activate
mypy authzed