-
Notifications
You must be signed in to change notification settings - Fork 2
41 lines (34 loc) · 1.13 KB
/
1_pylint.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
name: Python Syntax Code Quality Check Workflow
on:
push:
branches:
- main
# schedule:
# - cron: '34 0 * * 6'
jobs:
pylint-check:
# runs-on: ubuntu-latest -- Used to run on Github hosting
runs-on: self-hosted
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.10' # Choose the desired Python version
- name: Create virtual environment
run: python -m venv venv
working-directory: ${{ github.workspace }}
- name: Activate virtual environment and install dependencies
run: |
source venv/bin/activate
python -m pip install --upgrade pip
pip install -r requirements/requirements.txt # Install dependencies from requirements.txt in the 'requirements' folder
deactivate # Deactivate the virtual environment
working-directory: ${{ github.workspace }}
- name: Analyze code with Pylint
run: |
source venv/bin/activate
pylint $(git ls-files '*.py')
deactivate
working-directory: ${{ github.workspace }}