Skip to content

Commit

Permalink
👷 Add linting workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
francois-rozet committed Jan 29, 2024
1 parent 07ad235 commit 4125a6d
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 31 deletions.
11 changes: 11 additions & 0 deletions .github/workflows/dummy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: Dummy workflow

on:
workflow_dispatch:

jobs:
dummy:
runs-on: ubuntu-latest
steps:
- run: env | grep ^GITHUB
- run: echo $GITHUB_REF
19 changes: 19 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Linter & formatter

on:
workflow_dispatch:
pull_request:

jobs:
ruff:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Run linter
uses: chartboost/ruff-action@v1
with:
args: check
- name: Run formatter
uses: chartboost/ruff-action@v1
with:
args: format --check
29 changes: 29 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Package tests

on:
workflow_dispatch:
pull_request:

jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.10"]
torch-version: ["1.12", "2.0"]

steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools
pip install pytest
pip install torch==${{ matrix.torch-version }} --extra-index-url https://download.pytorch.org/whl/cpu
pip install .
- name: Test with pytest
run: pytest tests
31 changes: 0 additions & 31 deletions .github/workflows/tests.yml

This file was deleted.

0 comments on commit 4125a6d

Please sign in to comment.