Skip to content

Commit 63dd9cb

Browse files
authored
Update ci.yml
1 parent 736426a commit 63dd9cb

File tree

1 file changed

+14
-26
lines changed

1 file changed

+14
-26
lines changed

.github/workflows/ci.yml

Lines changed: 14 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,21 @@
1+
name: pre-commit
12
jobs:
2-
lint-multi-os:
3-
name: Lint ${{ matrix.os }}
3+
main:
44
runs-on: ${{ matrix.os }}
55
steps:
6-
- uses: actions/checkout@v2
7-
- uses: actions/setup-python@v1
8-
with:
9-
python-version: 3.x
10-
- uses: actions/cache@v1
11-
with:
12-
key: v0-${{ runner.os }}-pip-lint-${{ hashFiles('setup.py') }}
13-
path: ~/.cache/pip
14-
restore-keys: |
15-
v0-${{ runner.os }}-pip-lint-
16-
v0-${{ runner.os }}-pip-
17-
- name: Install dependencies
18-
run: |
19-
python -m pip install --upgrade pip
20-
pip install .[lint]
21-
- name: Run black
22-
run: black --check --verbose .
23-
- name: Run flake8
24-
run: flake8 --exclude docs --statistics
25-
- name: Run isort
26-
run: isort -cv .
27-
- name: Run sphinx
28-
run: sphinx-build -W --keep-going docs/ /tmp/foo
6+
- uses: actions/checkout@v2
7+
- uses: actions/setup-python@v2
8+
with:
9+
python-version: ${{ matrix.python-version }}
10+
- uses: pre-commit/action@v2.0.3
11+
- name: Set Python version
12+
run: echo "PY=$(python -VV | sha256sum | cut -d' ' -f1)" >> $GITHUB_ENV
13+
- uses: actions/cache@v1
14+
with:
15+
path: ~/.cache/pre-commit
16+
key: pre-commit|${{ env.PY }}|${{ hashFiles('.pre-commit-config.yaml') }}
2917
strategy:
3018
matrix:
19+
python-version: ["3.9"]
3120
os: [macOS-latest, ubuntu-latest, windows-latest]
32-
name: CI
3321
on: [pull_request, push]

0 commit comments

Comments
 (0)