Add ruff formatting and safe fixing, pyproject-fmt, clean up root #190
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: test | |
on: | |
pull_request: | |
branches: ["*"] | |
push: | |
branches: [main] | |
workflow_dispatch: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
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 |