-
Notifications
You must be signed in to change notification settings - Fork 150
78 lines (65 loc) · 2.16 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
name: Lint
on:
push:
branches:
- main
pull_request:
concurrency:
group: "${{ github.workflow }}-${{ github.ref }}"
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
permissions:
contents: read
jobs:
lint:
runs-on: ubuntu-20.04
timeout-minutes: 30
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 1
- name: Set up Python
id: py
uses: actions/setup-python@v4
with:
python-version: "3.7 - 3.11"
update-environment: true
- name: Set up Python 3.7
id: py37
uses: actions/setup-python@v4
with:
python-version: "3.7"
update-environment: false
- name: Check syntax (Python 3.7)
run: |
"${{ steps.py37.outputs.python-path }}" -m compileall nvitop
- name: Upgrade pip
run: |
python -m pip install --upgrade pip setuptools
- name: Install dependencies
run: |
python -m pip install -r requirements.txt
- name: Import tests
run: |
python -c 'import nvitop'
python -m nvitop --version
python -m nvitop --help
python -m nvitop.select --version
python -m nvitop.select --help
- name: Import tests (Python 3.7)
run: |
"${{ steps.py37.outputs.python-path }}" -m pip install --upgrade pip setuptools
"${{ steps.py37.outputs.python-path }}" -m pip install -r requirements.txt
"${{ steps.py37.outputs.python-path }}" -c 'import nvitop'
"${{ steps.py37.outputs.python-path }}" -m nvitop --version
"${{ steps.py37.outputs.python-path }}" -m nvitop --help
"${{ steps.py37.outputs.python-path }}" -m nvitop.select --version
"${{ steps.py37.outputs.python-path }}" -m nvitop.select --help
- name: Install linters
run: |
python -m pip install --upgrade pre-commit pylint[spelling] mypy typing-extensions
- name: pre-commit
run: |
python -m pre_commit --version
python -m pre_commit install --install-hooks
python -m pre_commit run --all-files