-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ddb315f
commit 169d6cc
Showing
1 changed file
with
41 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
name: checks | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: checkout source | ||
uses: actions/checkout@v2 | ||
|
||
- name: set up python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.8 | ||
|
||
- name: set PY | ||
run: echo "PY=$(python -VV | sha256sum | cut -d' ' -f1)" >> $GITHUB_ENV | ||
|
||
- name: cache stuff | ||
uses: actions/cache@v2 | ||
with: | ||
path: | | ||
${{ env.pythonLocation }} | ||
~/.cache/pre-commit | ||
key: | | ||
pre-commit-${{ env.PY }}-${{ hashFiles('.pre-commit-config.yaml') }} | ||
- name: install dependencies | ||
run: pip install pre-commit | ||
|
||
- name: Install pre-commit hooks | ||
run: pre-commit install | ||
|
||
# This will run on all files in the repo not just those that have been | ||
# committed. Once formatting has been applied once globally, from then on | ||
# the files being changed by pre-commit should be just those that are | ||
# being committed - provided that people are using the pre-commit hook to | ||
# format their code. | ||
- name: run pre-commit | ||
run: pre-commit run --all-files --color always |