GHA: Simplify and update lint.yml
This commit is contained in:
parent
8437316d3d
commit
1160ee1513
39
.github/workflows/lint.yml
vendored
39
.github/workflows/lint.yml
vendored
|
@ -4,39 +4,34 @@ on: [push, pull_request]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-18.04
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
python-version: [3.8]
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
- name: pip cache
|
- name: Cache
|
||||||
uses: actions/cache@v1
|
uses: actions/cache@v2
|
||||||
with:
|
with:
|
||||||
path: ~/.cache/pip
|
path: |
|
||||||
key: lint-pip-${{ hashFiles('**/setup.py') }}
|
~/.cache/pip
|
||||||
|
~/.cache/pre-commit
|
||||||
|
key:
|
||||||
|
lint-v2-${{ hashFiles('**/setup.py') }}-${{
|
||||||
|
hashFiles('**/.pre-commit-config.yaml') }}
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
lint-pip-
|
lint-v2-
|
||||||
|
|
||||||
- name: pre-commit cache
|
- name: Set up Python
|
||||||
uses: actions/cache@v1
|
uses: actions/setup-python@v2
|
||||||
with:
|
with:
|
||||||
path: ~/.cache/pre-commit
|
python-version: 3.8
|
||||||
key: lint-pre-commit-v1-${{ hashFiles('**/.pre-commit-config.yaml') }}
|
|
||||||
restore-keys: |
|
|
||||||
lint-pre-commit-v1-
|
|
||||||
|
|
||||||
- name: Set up Python ${{ matrix.python-version }}
|
|
||||||
uses: actions/setup-python@v1
|
|
||||||
with:
|
|
||||||
python-version: ${{ matrix.python-version }}
|
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: |
|
run: |
|
||||||
python -m pip install --upgrade pip
|
python -m pip install -U pip
|
||||||
python -m pip install --upgrade tox
|
python -m pip install -U tox
|
||||||
|
|
||||||
- name: Lint
|
- name: Lint
|
||||||
run: tox -e lint
|
run: tox -e lint
|
||||||
|
env:
|
||||||
|
PRE_COMMIT_COLOR: always
|
||||||
|
|
Loading…
Reference in a new issue