-
Notifications
You must be signed in to change notification settings - Fork 24
41 lines (37 loc) · 1.33 KB
/
python.yml
File metadata and controls
41 lines (37 loc) · 1.33 KB
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
name: Python Linting
on:
workflow_dispatch:
push:
branches: [ amd-staging, amd-mainline ]
paths:
- '**.py'
pull_request:
paths:
- '**.py'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
linting:
# Only run this job when targeting amd-staging, amd-mainline, or amd-npi branches
if: ${{ contains(fromJSON('["amd-staging", "amd-mainline", "amd-npi"]'), github.base_ref) || contains(fromJSON('["refs/heads/amd-staging", "refs/heads/amd-mainline", "refs/heads/amd-npi"]'), github.ref) }}
runs-on: AMD-ROCm-Internal-dev1
strategy:
matrix:
python-version: ['3.8', '3.10', '3.12']
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 source --count --show-source --statistics --select=E9,F63,F7,F82
# flake8 options are defined in .flake8
flake8 source --count --show-source --statistics