Spaces:
Sleeping
Sleeping
Reem commited on
Commit ·
ac7e4e8
1
Parent(s): e455468
test-v4-nbqa
Browse files
.github/workflows/push_to_hf_space.yml
CHANGED
|
@@ -30,19 +30,25 @@ jobs:
|
|
| 30 |
- name: Install dependencies
|
| 31 |
run: |
|
| 32 |
pip install --upgrade pip
|
| 33 |
-
pip install flake8
|
| 34 |
|
| 35 |
# -------------------------
|
| 36 |
-
# 3.
|
| 37 |
-
# Pipeline FAILS if lint fails
|
| 38 |
# -------------------------
|
| 39 |
-
- name:
|
| 40 |
run: |
|
| 41 |
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
|
| 42 |
|
| 43 |
# -------------------------
|
| 44 |
-
# 4.
|
| 45 |
-
#
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 46 |
# -------------------------
|
| 47 |
- name: Check for restricted file types
|
| 48 |
run: |
|
|
@@ -51,19 +57,23 @@ jobs:
|
|
| 51 |
exit 1
|
| 52 |
fi
|
| 53 |
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
|
|
|
|
|
|
| 59 |
|
| 60 |
-
|
| 61 |
# -------------------------
|
| 62 |
-
#
|
| 63 |
-
# ONLY runs if lint passes
|
| 64 |
# -------------------------
|
| 65 |
- name: Push to hub
|
| 66 |
env:
|
| 67 |
HF_TOKEN: ${{ secrets.HF_TOKEN }}
|
| 68 |
run: |
|
| 69 |
git push -f https://Bachstelze:$HF_TOKEN@huggingface.co/spaces/Bachstelze/github_sync main
|
|
|
|
|
|
|
|
|
|
|
|
| 30 |
- name: Install dependencies
|
| 31 |
run: |
|
| 32 |
pip install --upgrade pip
|
| 33 |
+
pip install flake8 nbqa
|
| 34 |
|
| 35 |
# -------------------------
|
| 36 |
+
# 3. Lint Python files
|
|
|
|
| 37 |
# -------------------------
|
| 38 |
+
- name: Lint .py files
|
| 39 |
run: |
|
| 40 |
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
|
| 41 |
|
| 42 |
# -------------------------
|
| 43 |
+
# 4. Lint notebooks with nbQA
|
| 44 |
+
# This checks .ipynb files
|
| 45 |
+
# -------------------------
|
| 46 |
+
- name: Lint notebooks
|
| 47 |
+
run: |
|
| 48 |
+
nbqa flake8 .
|
| 49 |
+
|
| 50 |
+
# -------------------------
|
| 51 |
+
# 5. Block problematic files
|
| 52 |
# -------------------------
|
| 53 |
- name: Check for restricted file types
|
| 54 |
run: |
|
|
|
|
| 57 |
exit 1
|
| 58 |
fi
|
| 59 |
|
| 60 |
+
# -------------------------
|
| 61 |
+
# 6. Placeholder for unit tests
|
| 62 |
+
# -------------------------
|
| 63 |
+
- name: Run unit tests (placeholder)
|
| 64 |
+
run: |
|
| 65 |
+
echo "No tests implemented yet — placeholder step."
|
| 66 |
+
echo "This will later run pytest."
|
| 67 |
|
| 68 |
+
|
| 69 |
# -------------------------
|
| 70 |
+
# 7. Push to HuggingFace
|
|
|
|
| 71 |
# -------------------------
|
| 72 |
- name: Push to hub
|
| 73 |
env:
|
| 74 |
HF_TOKEN: ${{ secrets.HF_TOKEN }}
|
| 75 |
run: |
|
| 76 |
git push -f https://Bachstelze:$HF_TOKEN@huggingface.co/spaces/Bachstelze/github_sync main
|
| 77 |
+
|
| 78 |
+
|
| 79 |
+
|