-
Notifications
You must be signed in to change notification settings - Fork 497
82 lines (67 loc) · 2.16 KB
/
ci.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
name: CI
on: [pull_request, push]
permissions: {}
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: ${{ github.head_ref != '' }}
jobs:
ci:
name: Check
runs-on: ubuntu-22.04 # TODO: use `ubuntu-latest` when python 3.7 is dropped
strategy:
fail-fast: false
matrix:
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12', '3.13', '3.14-dev']
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Setup python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install tools
run: pip install bandit pycodestyle pyflakes
- name: Lint code
run: |
pyflakes nova3/engines/*.py
bandit --skip B110,B310,B314,B405 nova3/engines/*.py
- name: Format code
run: |
# skipping E265, fixing it will break plugin usage on older qbt instances (< v4.1.2)
pycodestyle \
--ignore=E265,W503 \
--max-line-length=1000 \
--statistics \
nova3/engines/*.py
- name: Build code
run: |
python -m compileall nova3/engines/*.py
zizmor:
name: Check workflow files
runs-on: ubuntu-latest
permissions:
security-events: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Check GitHub Actions workflow
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
pip install zizmor
zizmor \
--format sarif \
--pedantic \
./ \
| jq '(.runs[].results |= map(select(.ruleId != "unpinned-uses")))
| (.runs[].tool.driver.rules |= map(select(.id != "unpinned-uses")))' \
> "${{ runner.temp }}/zizmor_results.sarif"
- name: Upload zizmor results
uses: github/codeql-action/upload-sarif@v3
with:
category: zizmor
sarif_file: "${{ runner.temp }}/zizmor_results.sarif"