Skip to content

Use ruff as linter and formatter in github action #21

Use ruff as linter and formatter in github action

Use ruff as linter and formatter in github action #21

Workflow file for this run

name: Python package
on:
pull_request:
push:
branches: [ $default-branch ]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
pip install .[test]
- name: Test with pytest
run: |
pytest
ruff:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Ruff Lint
uses: astral-sh/ruff-action@v1
with:
args: "check --config pyproject.toml"
- name: Ruff Format
uses: astral-sh/ruff-action@v1
with:
args: "format --diff"