Skip to content
This repository was archived by the owner on Jul 4, 2025. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
84 changes: 83 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
name: CI

on:
schedule:
- cron: '0 16 * * *' # At 4 PM UTC, which is 11 AM UTC+7
Copy link
Contributor

@hiro-v hiro-v Dec 1, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be at 1am UCT+7

push:
branches:
- main
Expand All @@ -9,6 +11,7 @@ on:
pull_request:
types: [opened, synchronize, reopened]
paths: ['.github/scripts/**','.github/workflows/build.yml', '**/CMakeLists.txt', '**/Makefile', '**/*.h', '**/*.hpp', '**/*.c', '**/*.cpp', '**/*.cu', '**/*.cc', '**/*.cxx', '!docs/**', '!.gitignore']
workflow_dispatch:

env:
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
Expand Down Expand Up @@ -74,6 +77,17 @@ jobs:
mkdir -p nitro
cp build/nitro nitro/
tar -czvf nitro.tar.gz nitro

- name: Upload Artifact
uses: actions/upload-artifact@v2
if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
with:
name: nitro-linux-amd64
path: ./nitro

- name: Run e2e testing
shell: bash
run: |
# run e2e testing
cd nitro
chmod +x ../.github/scripts/e2e-test-linux-and-mac.sh && ../.github/scripts/e2e-test-linux-and-mac.sh ./nitro ${{ env.MODEL_URL }}
Expand Down Expand Up @@ -122,6 +136,17 @@ jobs:
mkdir -p nitro
cp build/nitro nitro/
tar -czvf nitro.tar.gz nitro

- name: Upload Artifact
uses: actions/upload-artifact@v2
if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
with:
name: nitro-linux-amd64-cuda
path: ./nitro

- name: Run e2e testing
shell: bash
run: |
# run e2e testing
cd nitro
chmod +x ../.github/scripts/e2e-test-linux-and-mac.sh && ../.github/scripts/e2e-test-linux-and-mac.sh ./nitro ${{ env.MODEL_URL }}
Expand Down Expand Up @@ -154,7 +179,7 @@ jobs:
continue-on-error: true
run: |
brew update
brew install cmake gcc@8
brew install cmake

- name: Build
id: cmake_build
Expand All @@ -172,6 +197,17 @@ jobs:
cp llama.cpp/ggml-metal.metal nitro/
cp build/nitro nitro/
tar -czvf nitro.tar.gz nitro

- name: Upload Artifact
uses: actions/upload-artifact@v2
if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
with:
name: nitro-mac-arm64
path: ./nitro

- name: Run e2e testing
shell: bash
run: |
# run e2e testing
cd nitro
chmod +x ../.github/scripts/e2e-test-linux-and-mac.sh && ../.github/scripts/e2e-test-linux-and-mac.sh ./nitro ${{ env.MODEL_URL }}
Expand Down Expand Up @@ -220,6 +256,17 @@ jobs:
mkdir -p nitro
cp build/nitro nitro/
tar -czvf nitro.tar.gz nitro

- name: Upload Artifact
uses: actions/upload-artifact@v2
if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
with:
name: nitro-mac-amd64
path: ./nitro

- name: Run e2e testing
shell: bash
run: |
# run e2e testing
cd nitro
chmod +x ../.github/scripts/e2e-test-linux-and-mac.sh && ../.github/scripts/e2e-test-linux-and-mac.sh ./nitro ${{ env.MODEL_URL }}
Expand Down Expand Up @@ -291,6 +338,17 @@ jobs:
robocopy build\bin\Release .\build\Release llama.dll
7z a -ttar temp.tar .\build\Release\*
7z a -tgzip nitro.tar.gz temp.tar

- name: Upload Artifact
uses: actions/upload-artifact@v2
if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
with:
name: nitro-win-amd64
path: ./nitro

- name: Run e2e testing
shell: cmd
run: |
cd .\build\Release
..\..\.github\scripts\e2e-test-windows.bat .\nitro.exe ${{ env.MODEL_URL }}

Expand Down Expand Up @@ -351,6 +409,17 @@ jobs:
robocopy build\bin\Release .\build\Release llama.dll
7z a -ttar temp.tar .\build\Release\*
7z a -tgzip nitro.tar.gz temp.tar

- name: Upload Artifact
uses: actions/upload-artifact@v2
if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
with:
name: nitro-win-amd64
path: ./nitro

- name: run e2e testing
shell: cmd
run: |
cd .\build\Release
..\..\.github\scripts\e2e-test-windows.bat .\nitro.exe ${{ env.MODEL_URL }}

Expand All @@ -365,6 +434,7 @@ jobs:
asset_content_type: application/gzip

update_release_draft:
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
needs: [ubuntu-amd64-build, ubuntu-amd64-cuda-build, macOS-M-build, macOS-Intel-build, windows-amd64-build, windows-amd64-cuda-build]
permissions:
contents: write
Expand All @@ -374,3 +444,15 @@ jobs:
- uses: release-drafter/release-drafter@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

noti-discord:
if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
needs: [ubuntu-amd64-build, ubuntu-amd64-cuda-build, macOS-M-build, macOS-Intel-build, windows-amd64-build, windows-amd64-cuda-build]
runs-on: ubuntu-latest
steps:
- name: Notify Discord
uses: Ilshidur/action-discord@master
with:
args: "Nightly build artifact: https://github.com/janhq/nitro/actions/runs/{{ GITHUB_RUN_ID }}"
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}