Merge pull request #7304 from asottile/cache_pre_commit

cache the pre-commit environment
This commit is contained in:
Bruno Oliveira 2020-06-09 10:56:42 -03:00 committed by GitHub
commit c871d8b2b6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 14 additions and 5 deletions

View File

@ -39,7 +39,6 @@ jobs:
"macos-py37",
"macos-py38",
"linting",
"docs",
"doctesting",
]
@ -112,10 +111,6 @@ jobs:
tox_env: "py38-xdist"
use_coverage: true
- name: "linting"
python: "3.7"
os: ubuntu-latest
tox_env: "linting"
- name: "docs"
python: "3.7"
os: ubuntu-latest
@ -168,6 +163,20 @@ jobs:
CODECOV_NAME: ${{ matrix.name }}
run: bash scripts/report-coverage.sh -F GHA,${{ runner.os }}
linting:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- name: set PY
run: echo "::set-env name=PY::$(python -c 'import hashlib, sys;print(hashlib.sha256(sys.version.encode()+sys.executable.encode()).hexdigest())')"
- uses: actions/cache@v1
with:
path: ~/.cache/pre-commit
key: pre-commit|${{ env.PY }}|${{ hashFiles('.pre-commit-config.yaml') }}
- run: pip install tox
- run: tox -e linting
deploy:
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') && github.repository == 'pytest-dev/pytest'