Merge pull request #7304 from asottile/cache_pre_commit
cache the pre-commit environment
This commit is contained in:
commit
c871d8b2b6
|
@ -39,7 +39,6 @@ jobs:
|
||||||
"macos-py37",
|
"macos-py37",
|
||||||
"macos-py38",
|
"macos-py38",
|
||||||
|
|
||||||
"linting",
|
|
||||||
"docs",
|
"docs",
|
||||||
"doctesting",
|
"doctesting",
|
||||||
]
|
]
|
||||||
|
@ -112,10 +111,6 @@ jobs:
|
||||||
tox_env: "py38-xdist"
|
tox_env: "py38-xdist"
|
||||||
use_coverage: true
|
use_coverage: true
|
||||||
|
|
||||||
- name: "linting"
|
|
||||||
python: "3.7"
|
|
||||||
os: ubuntu-latest
|
|
||||||
tox_env: "linting"
|
|
||||||
- name: "docs"
|
- name: "docs"
|
||||||
python: "3.7"
|
python: "3.7"
|
||||||
os: ubuntu-latest
|
os: ubuntu-latest
|
||||||
|
@ -168,6 +163,20 @@ jobs:
|
||||||
CODECOV_NAME: ${{ matrix.name }}
|
CODECOV_NAME: ${{ matrix.name }}
|
||||||
run: bash scripts/report-coverage.sh -F GHA,${{ runner.os }}
|
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:
|
deploy:
|
||||||
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') && github.repository == 'pytest-dev/pytest'
|
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') && github.repository == 'pytest-dev/pytest'
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue