name: ruff_check

on:
  push:
    branches:
      - main
  pull_request:
    branches:
      - main

jobs:
  ruff_check:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - name: Set up Python
        uses: actions/setup-python@v4
        with:
          python-version: "3.x"
      - name: install ruff
        run: |
          python -m pip install --upgrade pip
          pip install ruff
      - name: lint check and then format check with ruff
        run: |
          ruff check
          ruff format --check
