Skip to content

Commit

Permalink
✏️ Update CI linter, tester settings
Browse files Browse the repository at this point in the history
migrate to ruff
  • Loading branch information
futabato committed Feb 14, 2024
1 parent 62b7f42 commit 7ab1053
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 15 deletions.
27 changes: 12 additions & 15 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python

name: Python Code Linter
name: CI Linter

on:
push:
Expand All @@ -13,29 +13,26 @@ permissions:
contents: read

jobs:
linter:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.11
uses: actions/setup-python@v3
with:
python-version: "3.11"
- name: Install dependencies
- name: Install Poetry
run: |
python -m pip install --upgrade pip
pip install ruff==0.2.1 mypy==1.5.1 pytest==7.4.0 torch==2.0.1 numpy==1.25.2
- name: Format with ruff
run: |
ruff format .
curl -sSL https://install.python-poetry.org | python -
echo "$HOME/.local/bin" >> $GITHUB_PATH
- name: Install Dependencies
run: poetry install --no-interaction
- name: Lint with ruff
run: |
ruff check . --fix
- name: Lint with mypy
poetry run ruff check --output-format=github .
- name: Format with ruff
run: |
mypy --ignore-missing-imports --no-strict-optional ./src ./tests/
- name: Test with pytest
env:
PYTHONPATH: /home/runner/work/FutabatedLearning/FutabatedLearning/src
poetry run ruff format . --check --diff
- name: Lint with mypy
run: |
pytest ./tests/
poetry run mypy .
32 changes: 32 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python

name: CI Tester

on:
push:
branches: ["main"]
pull_request:
branches: ["main"]

permissions:
contents: read

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.11
uses: actions/setup-python@v3
with:
python-version: "3.11"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pytest==7.4.0 torch==2.0.1 numpy==1.25.2
- name: Test with pytest
env:
PYTHONPATH: /home/runner/work/FutabatedLearning/FutabatedLearning/src
run: |
pytest ./tests/

0 comments on commit 7ab1053

Please # to comment.