-
Notifications
You must be signed in to change notification settings - Fork 26
38 lines (33 loc) · 1.05 KB
/
linting.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
name: Linting
on: [pull_request, workflow_dispatch]
jobs:
flake8_linting:
runs-on: ubuntu-latest
name: Linting
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.10
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Restore Python environment cache
id: restore-env
uses: actions/cache/restore@v3
with:
path: .venv-3.10
key: ${{ runner.os }}-venv-3.10-${{ hashFiles('devtools/dev-requirements.txt') }}
restore-keys: |
${{ runner.os }}-venv-3.10-
- name: Check if virtual environment exists
if: steps.restore-env.outputs.cache-hit != 'true'
run: |
echo "Error: Virtual environment .venv-3.10 not found!"
exit 1
- name: Activate virtual environment
run: |
source .venv-3.10/bin/activate
- name: flake8 Lint
uses: reviewdog/action-flake8@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
reporter: github-pr-review