Update pre-commit hook configuration #25
Workflow file for this run
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
# This workflow runs pre-commit hooks on the files in the PR only. | |
# | |
# Author: Stefanie Molin | |
name: Check PR | |
on: | |
pull_request: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | |
cancel-in-progress: true | |
jobs: | |
# Run pre-commit checks on all files | |
linting: | |
runs-on: ubuntu-latest | |
name: Lint | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.11" | |
- name: Install Dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install pre-commit | |
pre-commit install | |
- name: Run Checks | |
run: | | |
pre-commit run --all-files --show-diff-on-failure | |
# Check that docs can be built | |
docs: | |
runs-on: ubuntu-latest | |
name: Build docs | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: "3.x" | |
- name: Install dependencies | |
run: | | |
pip install '.[docs]' | |
- name: Sphinx build | |
run: | | |
cd docs | |
make html |