Spaces:
Running
Running
Jean-baptiste Aujogue
commited on
Add CI (#8)
Browse files* Add CI jobs for Code QA and push to HF Space
* Fix interface trigger
- .github/workflows/check.yml +30 -0
- .github/workflows/push.yml +16 -0
- README.md +2 -2
.github/workflows/check.yml
ADDED
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
name: Code Quality Checks
|
2 |
+
on: [pull_request]
|
3 |
+
jobs:
|
4 |
+
pre-commit:
|
5 |
+
runs-on: ubuntu-latest
|
6 |
+
steps:
|
7 |
+
- uses: actions/checkout@v4
|
8 |
+
- name: Set up Python
|
9 |
+
uses: actions/setup-python@v5
|
10 |
+
with:
|
11 |
+
python-version-file: ".python-version"
|
12 |
+
- uses: pre-commit/[email protected]
|
13 |
+
|
14 |
+
unit-test:
|
15 |
+
runs-on: ubuntu-latest
|
16 |
+
steps:
|
17 |
+
- uses: actions/checkout@v4
|
18 |
+
- name: Set up Python
|
19 |
+
uses: actions/setup-python@v5
|
20 |
+
with:
|
21 |
+
python-version-file: ".python-version"
|
22 |
+
- name: Install uv
|
23 |
+
uses: astral-sh/setup-uv@v6
|
24 |
+
with:
|
25 |
+
version: "0.8.3"
|
26 |
+
enable-cache: true
|
27 |
+
- name: Install project
|
28 |
+
run: uv sync --locked --extra torch-cpu
|
29 |
+
- name: Run tests
|
30 |
+
run: uv run pytest tests/unit
|
.github/workflows/push.yml
ADDED
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
name: Push to Huggingface Space
|
2 |
+
on:
|
3 |
+
workflow_dispatch:
|
4 |
+
push:
|
5 |
+
branches: [main]
|
6 |
+
jobs:
|
7 |
+
sync-to-hub:
|
8 |
+
runs-on: ubuntu-latest
|
9 |
+
steps:
|
10 |
+
- uses: actions/checkout@v4
|
11 |
+
- name: Push to hub
|
12 |
+
env:
|
13 |
+
HF_USERNAME: JBAujogue
|
14 |
+
HF_TOKEN: ${{ secrets.HF_TOKEN }}
|
15 |
+
SPACE_NAME: Rubik-Tensor
|
16 |
+
run: git push https://HF_USERNAME:[email protected]/spaces/HF_USERNAME/SPACE_NAME main
|
README.md
CHANGED
@@ -4,14 +4,14 @@ emoji: ⚡
|
|
4 |
colorFrom: blue
|
5 |
colorTo: blue
|
6 |
sdk: docker
|
7 |
-
pinned:
|
8 |
license: apache-2.0
|
9 |
short_description: Interface for playing with Rubik cubes of any size
|
10 |
---
|
11 |
|
12 |
# Rubik-Tensor
|
13 |
|
14 |
-
See the HF Space [JBAujogue/Rubik-Tensor](https://huggingface.co/spaces/JBAujogue/Rubik-Tensor)
|
15 |
|
16 |
## Setup
|
17 |
|
|
|
4 |
colorFrom: blue
|
5 |
colorTo: blue
|
6 |
sdk: docker
|
7 |
+
pinned: true
|
8 |
license: apache-2.0
|
9 |
short_description: Interface for playing with Rubik cubes of any size
|
10 |
---
|
11 |
|
12 |
# Rubik-Tensor
|
13 |
|
14 |
+
See the HF Space [JBAujogue/Rubik-Tensor](https://huggingface.co/spaces/JBAujogue/Rubik-Tensor) (make sure to accept 3rd-party cookies through the `Eye` icon of the URL bar).
|
15 |
|
16 |
## Setup
|
17 |
|