1+ name : CI/CD Pipeline
2+
3+ on :
4+ push :
5+ branches : [main]
6+ pull_request :
7+ branches : [main]
8+
9+ jobs :
10+ lint :
11+ if : github.event_name == 'pull_request'
12+ runs-on : Linux
13+ env :
14+ NVIDIA_DRIVER_CAPABILITIES : all
15+ NVIDIA_VISIBLE_DEVICES : all
16+ NVIDIA_DISABLE_REQUIRE : 1
17+ container : &container_template
18+ image : 192.168.3.13:5000/dexsdk:ubuntu22.04-cuda12.8.0-h5ffmpeg-v3
19+ volumes :
20+ - " /cache:/cache"
21+ - " /usr/share/vulkan/icd.d:/usr/share/vulkan/icd.d"
22+ - " /usr/share/vulkan/implicit_layer.d:/usr/share/vulkan/implicit_layer.d"
23+ - " /usr/share/glvnd/egl_vendor.d:/usr/share/glvnd/egl_vendor.d"
24+ - " /tmp/.X11-unix:/tmp/.X11-unix"
25+ - " /dev/shm/shared:/dev/shm/shared"
26+ options : --memory 100g --gpus device=1 --shm-size 53687091200
27+ steps :
28+ - uses : actions/checkout@v4
29+ - name : (CI) Code Style check
30+ run : |
31+ echo "Workspace: ${GITHUB_WORKSPACE}"
32+ ls
33+ pip install black==24.3.0
34+ black --check --diff --color ./
35+ if [ $? -ne 0 ]; then
36+ echo "Code style check failed, please run [black ./] before commit!"
37+ exit 1
38+ fi
39+
40+ build :
41+ needs : lint
42+ runs-on : Linux
43+ env :
44+ NVIDIA_DRIVER_CAPABILITIES : all
45+ NVIDIA_VISIBLE_DEVICES : all
46+ NVIDIA_DISABLE_REQUIRE : 1
47+ container : *container_template
48+ steps :
49+ - uses : actions/checkout@v4
50+ - name : (CI) Build docs
51+ run : |
52+ pip install -e .
53+ pip install -r docs/requirements.txt
54+ cd ${GITHUB_WORKSPACE}/docs
55+ echo "Start Building docs..."
56+ make html
57+ - name : Upload pkg
58+ uses : actions/upload-pages-artifact@v3
59+ with :
60+ path : ${{ github.workspace }}/docs/build/html
61+ retention-days : 3
62+
63+ test :
64+ if : github.event_name == 'pull_request'
65+ needs : lint
66+ runs-on : Linux
67+ env :
68+ NVIDIA_DRIVER_CAPABILITIES : all
69+ NVIDIA_VISIBLE_DEVICES : all
70+ NVIDIA_DISABLE_REQUIRE : 1
71+ container : *container_template
72+ steps :
73+ - uses : actions/checkout@v4
74+ - name : (CI) Run tests
75+ run : |
76+ # pip install -e .
77+ echo "Unitest Start"
78+ # export HF_ENDPOINT=https://hf-mirror.com
79+ # pytest tests
80+
81+ publish :
82+ if : github.event_name == 'push' && github.ref == 'refs/heads/main'
83+ needs : build
84+ runs-on : Linux
85+ permissions :
86+ pages : write
87+ id-token : write
88+ env :
89+ NVIDIA_DRIVER_CAPABILITIES : all
90+ NVIDIA_VISIBLE_DEVICES : all
91+ NVIDIA_DISABLE_REQUIRE : 1
92+ container : *container_template
93+ steps :
94+ - uses : actions/checkout@v4
95+ - name : (CI) Publish package
96+ run : echo "start publish stage"
97+ - name : (CI) Download docs artifact
98+ uses : actions/download-artifact@v4
99+ with :
100+ name : github-pages
101+ - name : (CI) Deploy GitHub Pages
102+ uses : actions/deploy-pages@v4
0 commit comments