Skip to content

Commit

Permalink
Merge pull request pytest-dev#7304 from asottile/cache_pre_commit
Browse files Browse the repository at this point in the history
cache the pre-commit environment
  • Loading branch information
nicoddemus authored Jun 9, 2020
2 parents 3100f8e + 8cca023 commit c871d8b
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ jobs:
"macos-py37",
"macos-py38",

"linting",
"docs",
"doctesting",
]
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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'

Expand Down

0 comments on commit c871d8b

Please sign in to comment.