Skip to content

Commit 4125a6d

Browse files
👷 Add linting workflow
1 parent 07ad235 commit 4125a6d

File tree

4 files changed

+59
-31
lines changed

4 files changed

+59
-31
lines changed

.github/workflows/dummy.yml

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
name: Dummy workflow
2+
3+
on:
4+
workflow_dispatch:
5+
6+
jobs:
7+
dummy:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- run: env | grep ^GITHUB
11+
- run: echo $GITHUB_REF

.github/workflows/lint.yml

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Linter & formatter
2+
3+
on:
4+
workflow_dispatch:
5+
pull_request:
6+
7+
jobs:
8+
ruff:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v3
12+
- name: Run linter
13+
uses: chartboost/ruff-action@v1
14+
with:
15+
args: check
16+
- name: Run formatter
17+
uses: chartboost/ruff-action@v1
18+
with:
19+
args: format --check

.github/workflows/test.yml

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Package tests
2+
3+
on:
4+
workflow_dispatch:
5+
pull_request:
6+
7+
jobs:
8+
test:
9+
runs-on: ubuntu-latest
10+
strategy:
11+
fail-fast: false
12+
matrix:
13+
python-version: ["3.8", "3.10"]
14+
torch-version: ["1.12", "2.0"]
15+
16+
steps:
17+
- uses: actions/checkout@v3
18+
- name: Set up Python ${{ matrix.python-version }}
19+
uses: actions/setup-python@v4
20+
with:
21+
python-version: ${{ matrix.python-version }}
22+
- name: Install dependencies
23+
run: |
24+
python -m pip install --upgrade pip setuptools
25+
pip install pytest
26+
pip install torch==${{ matrix.torch-version }} --extra-index-url https://download.pytorch.org/whl/cpu
27+
pip install .
28+
- name: Test with pytest
29+
run: pytest tests

.github/workflows/tests.yml

-31
This file was deleted.

0 commit comments

Comments
 (0)