Skip to content
This repository was archived by the owner on Jul 4, 2025. It is now read-only.

Commit c2cde4c

Browse files
authored
Add nightly build ci (#222)
Co-authored-by: Hien To <tominhhien97@gmail.com>
1 parent a3acd59 commit c2cde4c

File tree

1 file changed

+83
-1
lines changed

1 file changed

+83
-1
lines changed

.github/workflows/build.yml

Lines changed: 83 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
name: CI
22

33
on:
4+
schedule:
5+
- cron: '0 16 * * *' # At 4 PM UTC, which is 11 AM UTC+7
46
push:
57
branches:
68
- main
@@ -9,6 +11,7 @@ on:
911
pull_request:
1012
types: [opened, synchronize, reopened]
1113
paths: ['.github/scripts/**','.github/workflows/build.yml', '**/CMakeLists.txt', '**/Makefile', '**/*.h', '**/*.hpp', '**/*.c', '**/*.cpp', '**/*.cu', '**/*.cc', '**/*.cxx', '!docs/**', '!.gitignore']
14+
workflow_dispatch:
1215

1316
env:
1417
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
@@ -74,6 +77,17 @@ jobs:
7477
mkdir -p nitro
7578
cp build/nitro nitro/
7679
tar -czvf nitro.tar.gz nitro
80+
81+
- name: Upload Artifact
82+
uses: actions/upload-artifact@v2
83+
if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
84+
with:
85+
name: nitro-linux-amd64
86+
path: ./nitro
87+
88+
- name: Run e2e testing
89+
shell: bash
90+
run: |
7791
# run e2e testing
7892
cd nitro
7993
chmod +x ../.github/scripts/e2e-test-linux-and-mac.sh && ../.github/scripts/e2e-test-linux-and-mac.sh ./nitro ${{ env.MODEL_URL }}
@@ -122,6 +136,17 @@ jobs:
122136
mkdir -p nitro
123137
cp build/nitro nitro/
124138
tar -czvf nitro.tar.gz nitro
139+
140+
- name: Upload Artifact
141+
uses: actions/upload-artifact@v2
142+
if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
143+
with:
144+
name: nitro-linux-amd64-cuda
145+
path: ./nitro
146+
147+
- name: Run e2e testing
148+
shell: bash
149+
run: |
125150
# run e2e testing
126151
cd nitro
127152
chmod +x ../.github/scripts/e2e-test-linux-and-mac.sh && ../.github/scripts/e2e-test-linux-and-mac.sh ./nitro ${{ env.MODEL_URL }}
@@ -154,7 +179,7 @@ jobs:
154179
continue-on-error: true
155180
run: |
156181
brew update
157-
brew install cmake gcc@8
182+
brew install cmake
158183
159184
- name: Build
160185
id: cmake_build
@@ -172,6 +197,17 @@ jobs:
172197
cp llama.cpp/ggml-metal.metal nitro/
173198
cp build/nitro nitro/
174199
tar -czvf nitro.tar.gz nitro
200+
201+
- name: Upload Artifact
202+
uses: actions/upload-artifact@v2
203+
if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
204+
with:
205+
name: nitro-mac-arm64
206+
path: ./nitro
207+
208+
- name: Run e2e testing
209+
shell: bash
210+
run: |
175211
# run e2e testing
176212
cd nitro
177213
chmod +x ../.github/scripts/e2e-test-linux-and-mac.sh && ../.github/scripts/e2e-test-linux-and-mac.sh ./nitro ${{ env.MODEL_URL }}
@@ -220,6 +256,17 @@ jobs:
220256
mkdir -p nitro
221257
cp build/nitro nitro/
222258
tar -czvf nitro.tar.gz nitro
259+
260+
- name: Upload Artifact
261+
uses: actions/upload-artifact@v2
262+
if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
263+
with:
264+
name: nitro-mac-amd64
265+
path: ./nitro
266+
267+
- name: Run e2e testing
268+
shell: bash
269+
run: |
223270
# run e2e testing
224271
cd nitro
225272
chmod +x ../.github/scripts/e2e-test-linux-and-mac.sh && ../.github/scripts/e2e-test-linux-and-mac.sh ./nitro ${{ env.MODEL_URL }}
@@ -291,6 +338,17 @@ jobs:
291338
robocopy build\bin\Release .\build\Release llama.dll
292339
7z a -ttar temp.tar .\build\Release\*
293340
7z a -tgzip nitro.tar.gz temp.tar
341+
342+
- name: Upload Artifact
343+
uses: actions/upload-artifact@v2
344+
if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
345+
with:
346+
name: nitro-win-amd64
347+
path: ./nitro
348+
349+
- name: Run e2e testing
350+
shell: cmd
351+
run: |
294352
cd .\build\Release
295353
..\..\.github\scripts\e2e-test-windows.bat .\nitro.exe ${{ env.MODEL_URL }}
296354
@@ -351,6 +409,17 @@ jobs:
351409
robocopy build\bin\Release .\build\Release llama.dll
352410
7z a -ttar temp.tar .\build\Release\*
353411
7z a -tgzip nitro.tar.gz temp.tar
412+
413+
- name: Upload Artifact
414+
uses: actions/upload-artifact@v2
415+
if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
416+
with:
417+
name: nitro-win-amd64
418+
path: ./nitro
419+
420+
- name: run e2e testing
421+
shell: cmd
422+
run: |
354423
cd .\build\Release
355424
..\..\.github\scripts\e2e-test-windows.bat .\nitro.exe ${{ env.MODEL_URL }}
356425
@@ -365,6 +434,7 @@ jobs:
365434
asset_content_type: application/gzip
366435

367436
update_release_draft:
437+
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
368438
needs: [ubuntu-amd64-build, ubuntu-amd64-cuda-build, macOS-M-build, macOS-Intel-build, windows-amd64-build, windows-amd64-cuda-build]
369439
permissions:
370440
contents: write
@@ -374,3 +444,15 @@ jobs:
374444
- uses: release-drafter/release-drafter@v5
375445
env:
376446
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
447+
448+
noti-discord:
449+
if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
450+
needs: [ubuntu-amd64-build, ubuntu-amd64-cuda-build, macOS-M-build, macOS-Intel-build, windows-amd64-build, windows-amd64-cuda-build]
451+
runs-on: ubuntu-latest
452+
steps:
453+
- name: Notify Discord
454+
uses: Ilshidur/action-discord@master
455+
with:
456+
args: "Nightly build artifact: https://github.com/janhq/nitro/actions/runs/{{ GITHUB_RUN_ID }}"
457+
env:
458+
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}

0 commit comments

Comments
 (0)