-
Notifications
You must be signed in to change notification settings - Fork 82
57 lines (51 loc) · 1.66 KB
/
lint.yml
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
name: Lint
on:
push:
branches:
- main
tags:
- v*
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}-${{ github.event_name == 'workflow_dispatch' }}
cancel-in-progress: true
jobs:
lintrunner:
name: lintrunner
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
python_version: ["3.11"]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python_version }}
- name: Install Lintrunner
run: |
pip install lintrunner==0.12.5
lintrunner init
- name: Run lintrunner on all files - Linux
run: |
set +e
if ! lintrunner -v --force-color --all-files --tee-json=lint.json --take ACTIONLINT,MYPY,RUSTFMT,COPYRIGHT,LINTRUNNER_VERSION,UFMT; then
echo ""
echo -e "\e[1m\e[36mYou can reproduce these results locally by using \`lintrunner -m main\`.\e[0m"
exit 1
fi
- name: Produce SARIF
if: always() && matrix.os == 'ubuntu-latest'
run: |
python tools/linter/convert_to_sarif.py --input lint.json --output lintrunner.sarif
- name: Upload SARIF file
if: always() && matrix.os == 'ubuntu-latest'
continue-on-error: true
uses: github/codeql-action/upload-sarif@v3
with:
# Path to SARIF file relative to the root of the repository
sarif_file: lintrunner.sarif
category: lintrunner
checkout_path: ${{ github.workspace }}