generated from python-discord/code-jam-template
-
Notifications
You must be signed in to change notification settings - Fork 11
45 lines (35 loc) · 1.28 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
# GitHub Action Workflow enforcing our code style.
name: Lint, Build & Deploy
# Trigger the workflow on both push (to the main repository)
# and pull requests (against the main repository, but from any repo).
on: [push, pull_request]
# Brand new concurrency setting! This ensures that not more than one run can be triggered for the same commit.
# It is useful for pull requests coming from the main repository since both triggers will match.
concurrency: lint-${{ github.sha }}
jobs:
lint:
strategy:
fail-fast: true
matrix:
python_version: [3.7, 3.8, 3.9]
runs-on: ubuntu-latest
env:
# Set an environment variable to select pip's cache directory for us to actually cache between runs.
PIP_CACHE_DIR: /tmp/pip-cache-dir
steps:
# Checks out the repository in the current folder.
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python_version }}
- name: Install dependencies
run: |
pip install wheel pre-commit
- name: Install poetry
uses: abatilo/actions-poetry@v2.1.3
- name: Install poetry dependencies
run: |
poetry install
- name: Run pre-commit hooks
run: |
pre-commit run --all-files