Spaces:
Running
on
Zero
Running
on
Zero
pabl-o-ce
commited on
Commit
·
168365f
1
Parent(s):
0197ebf
ci gh actions
Browse files- .github/workflows/ci.yml +56 -0
.github/workflows/ci.yml
ADDED
@@ -0,0 +1,56 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
name: CI/CD Pipeline
|
2 |
+
on:
|
3 |
+
push:
|
4 |
+
branches: [main]
|
5 |
+
|
6 |
+
# to run this workflow manually from the Actions tab
|
7 |
+
workflow_dispatch:
|
8 |
+
|
9 |
+
env:
|
10 |
+
PYTHON_VERSION: '3.12'
|
11 |
+
HF_USERNAME: 'pabloce/exllama'
|
12 |
+
SPACE_NAME: 'exllama'
|
13 |
+
|
14 |
+
jobs:
|
15 |
+
lint-and-test:
|
16 |
+
runs-on: ubuntu-latest
|
17 |
+
steps:
|
18 |
+
- uses: actions/checkout@v3
|
19 |
+
with:
|
20 |
+
fetch-depth: 0
|
21 |
+
lfs: true
|
22 |
+
|
23 |
+
- name: Set up Python
|
24 |
+
uses: actions/setup-python@v4
|
25 |
+
with:
|
26 |
+
python-version: ${{ env.PYTHON_VERSION }}
|
27 |
+
cache: 'pip'
|
28 |
+
|
29 |
+
- name: Install dependencies
|
30 |
+
run: |
|
31 |
+
python -m pip install --upgrade pip
|
32 |
+
pip install ruff pytest gradio
|
33 |
+
pip install -r requirements.txt
|
34 |
+
|
35 |
+
# - name: Lint with Ruff
|
36 |
+
# run: |
|
37 |
+
# pip install ruff
|
38 |
+
# ruff check .
|
39 |
+
# ruff format --check .
|
40 |
+
|
41 |
+
# - name: Run tests
|
42 |
+
# run: |
|
43 |
+
# python -m pytest tests/ -v
|
44 |
+
|
45 |
+
sync-to-hub:
|
46 |
+
runs-on: ubuntu-latest
|
47 |
+
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
|
48 |
+
steps:
|
49 |
+
- uses: actions/checkout@v3
|
50 |
+
with:
|
51 |
+
fetch-depth: 0
|
52 |
+
lfs: true
|
53 |
+
- name: Push to hub
|
54 |
+
env:
|
55 |
+
HF_TOKEN: ${{ secrets.HF_TOKEN }}
|
56 |
+
run: git push https://HF_USERNAME:[email protected]/spaces/HF_USERNAME/SPACE_NAME main
|