Skip to content

Commit fdf6a0c

Browse files
authored
More CI cleanup, add style workflow (#107)
- Changes on the `test.yml` workflow: - Using poetry instead of pip. Contrary to what I wrote in #75, it is possible to use poetry (and have the benefits of shorter install times) without the need for having two separate versions of `pyproject.toml` and `poetry.lock`. - Reduce the trigger scope to only run when files in these directories are modified: - `lerobot/` - `tests/` - `examples/` - `.github/` - Add `style.yml` workflow for doing a `ruff check` pass on the code - More cleanup (removed deprecated workflow)
1 parent 45f351c commit fdf6a0c

File tree

12 files changed

+85
-4188
lines changed

12 files changed

+85
-4188
lines changed

.github/poetry/cpu_DEPRECATED/poetry.lock

Lines changed: 0 additions & 3917 deletions
This file was deleted.

.github/poetry/cpu_DEPRECATED/pyproject.toml

Lines changed: 0 additions & 107 deletions
This file was deleted.

.github/workflows/build-docker-images.yml

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,13 @@
11
# Inspired by
22
# https://github.com/huggingface/peft/blob/main/.github/workflows/build_docker_images.yml
3-
name: Nightly Builds
3+
name: Builds
44

55
on:
66
workflow_dispatch:
77
workflow_call:
88
schedule:
99
- cron: "0 1 * * *"
1010

11-
# concurrency:
12-
# group: docker-image-builds
13-
# cancel-in-progress: false
14-
1511
env:
1612
PYTHON_VERSION: "3.10"
1713
# CI_SLACK_CHANNEL: ${{ secrets.CI_DOCKER_CHANNEL }}
@@ -40,6 +36,8 @@ jobs:
4036
- name: Check out code
4137
uses: actions/checkout@v4
4238

39+
# HACK(aliberts): to be removed for release
40+
# -----------------------------------------
4341
- name: Checkout gym-aloha
4442
uses: actions/checkout@v4
4543
with:
@@ -61,8 +59,6 @@ jobs:
6159
path: envs/gym-pusht
6260
ssh-key: ${{ secrets.SSH_PRIVATE_KEY }}
6361

64-
# HACK(aliberts): to be removed for release
65-
# -----------------------------------------
6662
- name: Set up Python 3.10
6763
uses: actions/setup-python@v5
6864
with:
@@ -134,6 +130,8 @@ jobs:
134130
- name: Check out code
135131
uses: actions/checkout@v4
136132

133+
# HACK(aliberts): to be removed for release
134+
# -----------------------------------------
137135
- name: Checkout gym-aloha
138136
uses: actions/checkout@v4
139137
with:
@@ -155,8 +153,6 @@ jobs:
155153
path: envs/gym-pusht
156154
ssh-key: ${{ secrets.SSH_PRIVATE_KEY }}
157155

158-
# HACK(aliberts): to be removed for release
159-
# -----------------------------------------
160156
- name: Set up Python 3.10
161157
uses: actions/setup-python@v5
162158
with:

.github/workflows/nightly-tests.yml

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Inspired by
22
# https://github.com/huggingface/peft/blob/main/.github/workflows/nightly.yml
3-
name: Nightly Tests
3+
name: Nightly
44

55
on:
66
workflow_dispatch:
@@ -11,7 +11,6 @@ env:
1111
DATA_DIR: tests/data
1212
# SLACK_API_TOKEN: ${{ secrets.SLACK_API_TOKEN }}
1313

14-
1514
jobs:
1615
run_all_tests_cpu:
1716
name: "Test CPU"
@@ -33,11 +32,13 @@ jobs:
3332
env:
3433
DATA_DIR: tests/data
3534
run: pytest -v --cov=./lerobot --disable-warnings tests
35+
3636
- name: Tests end-to-end
3737
env:
3838
DATA_DIR: tests/data
3939
run: make test-end-to-end
4040

41+
4142
run_all_tests_single_gpu:
4243
name: "Test GPU"
4344
strategy:
@@ -59,6 +60,7 @@ jobs:
5960
steps:
6061
- name: Nvidia-smi
6162
run: nvidia-smi
63+
6264
- name: Test
6365
run: pytest -v --cov=./lerobot --cov-report=xml --disable-warnings tests
6466
# TODO(aliberts): Link with HF Codecov account
@@ -69,14 +71,6 @@ jobs:
6971
# verbose: true
7072
- name: Tests end-to-end
7173
run: make test-end-to-end
72-
- name: Tailscale Wait
73-
if: ${{ failure() || runner.debug == '1' }}
74-
uses: huggingface/tailscale-action@v1
75-
with:
76-
waitForSSH: true
77-
authkey: ${{ secrets.TAILSCALE_SSH_AUTHKEY }}
78-
slackChannel: ${{ secrets.SLACK_CIFEEDBACK_CHANNEL }}
79-
slackToken: ${{ secrets.SLACK_CIFEEDBACK_BOT_TOKEN }}
8074

8175
# - name: Generate Report
8276
# if: always()

.github/workflows/style.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Style
2+
3+
on:
4+
workflow_dispatch:
5+
workflow_call:
6+
pull_request:
7+
branches:
8+
- main
9+
push:
10+
branches:
11+
- main
12+
13+
env:
14+
PYTHON_VERSION: "3.10"
15+
16+
jobs:
17+
ruff_check:
18+
runs-on: ubuntu-latest
19+
steps:
20+
- name: Checkout Repository
21+
uses: actions/checkout@v3
22+
23+
- name: Set up Python
24+
uses: actions/setup-python@v4
25+
with:
26+
python-version: ${{ env.PYTHON_VERSION }}
27+
28+
- name: Get Ruff Version from pre-commit-config.yaml
29+
id: get-ruff-version
30+
run: |
31+
RUFF_VERSION=$(awk '/repo: https:\/\/github.com\/astral-sh\/ruff-pre-commit/{flag=1;next}/rev:/{if(flag){print $2;exit}}' .pre-commit-config.yaml)
32+
echo "RUFF_VERSION=${RUFF_VERSION}" >> $GITHUB_ENV
33+
34+
- name: Install Ruff
35+
run: python -m pip install "ruff==${{ env.RUFF_VERSION }}"
36+
37+
- name: Run Ruff
38+
run: ruff check .

.github/workflows/test-poetry_DEPRECATED.yml

Lines changed: 0 additions & 120 deletions
This file was deleted.

0 commit comments

Comments
 (0)