Skip to content

Commit

Permalink
add formatter and linter to ci
Browse files Browse the repository at this point in the history
  • Loading branch information
DennyDai committed Dec 18, 2023
1 parent 3829129 commit 9f76e75
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions .github/workflows/test.yml → .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ on:
pull_request:

jobs:
test:
ci:
strategy:
matrix:
task: [test, lint, format]
runs-on: ubuntu-22.04
steps:
- name: Checkout
Expand All @@ -25,8 +28,18 @@ jobs:
- name: Install Package
run: |
python3 -m pip install --upgrade pip
python3 -m pip install --upgrade pytest
python3 -m pip install --upgrade pytest ruff black isort
python3 -m pip install -e .
- name: Run pytest
if: matrix.task == 'test'
run: |
python3 -m pytest
- name: Run formatter
if: matrix.task == 'format'
run: |
python3 -m isort . --profile black --check-only --diff
python3 -m black . --check
- name: Run linter
if: matrix.task == 'lint'
run: |
python3 -m ruff check .

0 comments on commit 9f76e75

Please sign in to comment.