Setup pre commit with ruff #12
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
name: Continuous Integration | |
on: | |
pull_request: | |
merge_group: | |
jobs: | |
lint-and-test: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
# Tracked via issue #77 | |
# 3.6: Not available on ubuntu-22.04 | |
# 3.7: Results in failures in `test_cli.py` | |
# 3.12: pkg_resources not supported | |
python-version: ["3.8", "3.9", "3.10", "3.11"] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Cache Python dependencies | |
uses: actions/cache@v4 | |
id: pip-cache | |
with: | |
path: ~/.cache/pip | |
key: ${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('**/setup.py') }} | |
restore-keys: | | |
${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('**/setup.py') }} | |
- name: Install python dependencies | |
# if: steps.pip-cache.outputs.cache-hit != 'true' | |
run: | | |
python -m pip install --upgrade pip | |
pip install -e .[dev] | |
- name: Check PATH for debugging | |
run: | | |
echo $PATH | |
which python | |
which ruff | |
- name: Check installed packages for debugging | |
run: pip list | |
- name: Check code style | |
run: | | |
ruff check | |
ruff format --check | |
- name: Run test | |
run: pytest |