-
-
Notifications
You must be signed in to change notification settings - Fork 16
54 lines (44 loc) · 1.65 KB
/
lint-python.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
name: Lint Python code
on:
pull_request:
paths:
- '.github/workflows/lint-python.yml'
- 'compilesketches/**.py'
push:
paths:
- '.github/workflows/lint-python.yml'
- 'compilesketches/**.py'
# Scheduled trigger checks for workflow failures resulting from updates to the linting tools
schedule:
# run every Tuesday at 3 AM UTC
- cron: "0 3 * * 2"
# workflow_dispatch event allows the workflow to be triggered manually
# See: https://docs.github.com/en/actions/reference/events-that-trigger-workflows#workflow_dispatch
workflow_dispatch:
# repository_dispatch event allows the workflow to be triggered via the GitHub API
# See: https://docs.github.com/en/actions/reference/events-that-trigger-workflows#repository_dispatch
repository_dispatch:
jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Run the set up script
id: setup
run: |
"${{ github.workspace }}/action-setup.sh"
- name: Install flake8
run: |
source "${{ steps.setup.outputs.python-venv-activate-script-path }}"
"${{ steps.setup.outputs.python-command }}" \
-m \
pip install \
flake8 \
pep8-naming
- name: Lint with flake8
env:
PYTHON_PROJECT_PATH: ${GITHUB_WORKSPACE}/compilesketches
run: |
source "${{ steps.setup.outputs.python-venv-activate-script-path }}"
flake8 --config "${{ env.PYTHON_PROJECT_PATH }}/.flake8" --show-source "${{ env.PYTHON_PROJECT_PATH }}"