Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: replace custom lint job with pre-commit/action #512

Merged
merged 3 commits into from
Jul 23, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 7 additions & 46 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,68 +6,29 @@ on:
pull_request:

concurrency:
group: ci-${{ github.head_ref }}
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

env:
PYTHONUNBUFFERED: 1
FORCE_COLOR: 1 # colored output by pytest etc.
CLICOLOR_FORCE: 1 # colored output by ruff

permissions:
contents: read
permissions: {} # Set permissions at the job level.

jobs:

# TODO: disable docs build until decision is made

# docs:
# runs-on: ubuntu-22.04
# steps:
# - uses: actions/checkout@v4
# - name: Set up Python 3.11
# uses: actions/setup-python@v5
# with:
# python-version: '3.11'
# - name: Cache python dependencies
# uses: actions/cache@v4
# with:
# path: ~/.cache/pip
# key: pip-docs-${{ hashFiles('pyproject.toml') }}
# restore-keys: |
# pip-docs-
# - name: Install python dependencies
# run: |
# python -m pip install .[docs]
# python -m pip show fuji
# - name: Build documentation
# env:
# READTHEDOCS: 'True'
# run: |
# # TODO: add W flag back after fixing warnings
# SPHINXOPTS='-n' make -C docs html

lint:
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- name: Cache python dependencies
uses: actions/cache@v4
with:
path: |
~/.cache/pip
~/.cache/pre-commit
key: lint-${{ hashFiles('.pre-commit-config.yaml', 'pyproject.toml') }}
restore-keys: |
lint-
- name: Set up Python 3.11
uses: actions/setup-python@v5
with:
python-version: '3.11'
- run: |
python -m pip install --upgrade pip setuptools wheel
python -m pip install hatch
- run: hatch run lint
cache: pip
- uses: pre-commit/[email protected]
with:
extra_args: --all-files --color=always

tests:
runs-on: ubuntu-22.04
Expand Down
Loading