Skip to content

Add ruff formatting and safe fixing, pyproject-fmt, clean up root #184

Add ruff formatting and safe fixing, pyproject-fmt, clean up root

Add ruff formatting and safe fixing, pyproject-fmt, clean up root #184

Workflow file for this run

name: test
on:
pull_request:
branches: ["*"]
push:
branches: [main]
workflow_dispatch:
jobs:
format:
name: format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-python@v4
with:
python-version: "3.12"
cache: pip
cache-dependency-path: pyproject.toml
- name: install dev dependencies
run: python -m pip install --upgrade pip hatch
- name: run formatters
run:
echo "~~~bash" > $GITHUB_STEP_SUMMARY
hatch run format:code 2>&1 | tee --append $GITHUB_STEP_SUMMARY
echo "~~~" >> $GITHUB_STEP_SUMMARY
- name: print diff
run:
echo "~~~diff" >> $GITHUB_STEP_SUMMARY
git diff | tee --append $GITHUB_STEP_SUMMARY
echo "~~~" >> $GITHUB_STEP_SUMMARY
test:
name: ${{ matrix.os }} ${{ matrix.python-version }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "pypy3.9"]
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: pip
cache-dependency-path: pyproject.toml
- name: install dev dependencies
run: python -m pip install --upgrade pip hatch
- name: run tests
run: hatch run test:cov