diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 82e803654..1c5928f26 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -2,15 +2,49 @@ name: CI on: schedule: - - cron: '0 20 * * *' # At 8 PM UTC, which is 3 AM UTC+7 + - cron: "0 20 * * *" # At 8 PM UTC, which is 3 AM UTC+7 push: branches: - main tags: ["v[0-9]+.[0-9]+.[0-9]+"] - paths: ['.github/scripts/**','.github/workflows/build.yml', '**/CMakeLists.txt', '**/Makefile', '**/*.h', '**/*.hpp', '**/*.c', '**/*.cpp', '**/*.cu', '**/*.cc', '**/*.cxx', "llama.cpp", '!docs/**', '!.gitignore', "!README.md"] + paths: + [ + ".github/scripts/**", + ".github/workflows/build.yml", + "**/CMakeLists.txt", + "**/Makefile", + "**/*.h", + "**/*.hpp", + "**/*.c", + "**/*.cpp", + "**/*.cu", + "**/*.cc", + "**/*.cxx", + "llama.cpp", + "!docs/**", + "!.gitignore", + "!README.md", + ] pull_request: types: [opened, synchronize, reopened] - paths: ['.github/scripts/**','.github/workflows/build.yml', '**/CMakeLists.txt', '**/Makefile', '**/*.h', '**/*.hpp', '**/*.c', '**/*.cpp', '**/*.cu', '**/*.cc', '**/*.cxx', "llama.cpp", '!docs/**', '!.gitignore', "!README.md"] + paths: + [ + ".github/scripts/**", + ".github/workflows/build.yml", + "**/CMakeLists.txt", + "**/Makefile", + "**/*.h", + "**/*.hpp", + "**/*.c", + "**/*.cpp", + "**/*.cu", + "**/*.cc", + "**/*.cxx", + "llama.cpp", + "!docs/**", + "!.gitignore", + "!README.md", + ] workflow_dispatch: env: @@ -105,7 +139,7 @@ jobs: ldd --version ./install_deps.sh mkdir build && cd build - cmake -DDEBUG=ON -DLLAMA_NATIVE=OFF -DNITRO_VERSION=${{ needs.set-nitro-version.outputs.version }} .. + cmake -DLLAMA_NATIVE=OFF -DNITRO_VERSION=${{ needs.set-nitro-version.outputs.version }} .. make -j $(nproc) ls -la @@ -148,7 +182,7 @@ jobs: contents: write strategy: matrix: - cuda: ['12-0', '11-4'] + cuda: ["12-0", "11-4"] steps: - name: Clone @@ -162,9 +196,9 @@ jobs: run: | ./install_deps.sh mkdir build && cd build - cmake -DDEBUG=ON -DLLAMA_CUBLAS=ON -DLLAMA_NATIVE=OFF -DNITRO_VERSION=${{ needs.set-nitro-version.outputs.version }} .. + cmake -DLLAMA_CUBLAS=ON -DLLAMA_NATIVE=OFF -DNITRO_VERSION=${{ needs.set-nitro-version.outputs.version }} .. make -j $(nproc) - ls -la + ls -la - name: Package shell: bash @@ -224,8 +258,8 @@ jobs: mkdir build && cd build cmake -DNITRO_VERSION=${{ needs.set-nitro-version.outputs.version }} .. CC=gcc-8 make -j $(sysctl -n hw.ncp) - ls -la - + ls -la + - name: Package shell: bash run: | @@ -284,8 +318,8 @@ jobs: mkdir build && cd build cmake -DNITRO_VERSION=${{ needs.set-nitro-version.outputs.version }} -DLLAMA_METAL=OFF .. CC=gcc-8 make -j $(sysctl -n hw.ncp) - ls -la - + ls -la + - name: Package shell: bash run: | @@ -326,7 +360,7 @@ jobs: steps: - name: Clone - + id: checkout uses: actions/checkout@v3 with: @@ -339,7 +373,7 @@ jobs: silent: true env: ACTIONS_ALLOW_UNSECURE_COMMANDS: true - + - name: actions-setup-cmake uses: jwlawson/actions-setup-cmake@v1.14.1 @@ -397,7 +431,7 @@ jobs: strategy: matrix: - cuda: ['12-0', '11-4'] + cuda: ["12-0", "11-4"] steps: - name: Setup VSWhere.exe @@ -407,7 +441,7 @@ jobs: silent: true env: ACTIONS_ALLOW_UNSECURE_COMMANDS: true - + - name: actions-setup-cmake uses: jwlawson/actions-setup-cmake@v1.14.1 @@ -424,10 +458,10 @@ jobs: silent: true env: ACTIONS_ALLOW_UNSECURE_COMMANDS: true - + - uses: actions/setup-dotnet@v3 with: - dotnet-version: '6.0.x' + dotnet-version: "6.0.x" - name: Build id: cmake_build @@ -464,7 +498,7 @@ jobs: # run: | # cd .\build\Release # ..\..\.github\scripts\e2e-test-windows.bat .\nitro.exe ${{ env.MODEL_URL }} - + - uses: actions/upload-release-asset@v1.0.1 if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') env: @@ -474,10 +508,18 @@ jobs: asset_path: ./nitro.tar.gz asset_name: nitro-${{ needs.create-draft-release.outputs.version }}-win-amd64-cuda-${{ matrix.cuda }}.tar.gz 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] + needs: + [ + ubuntu-amd64-build, + ubuntu-amd64-cuda-build, + macOS-M-build, + macOS-Intel-build, + windows-amd64-build, + windows-amd64-cuda-build, + ] permissions: contents: write pull-requests: write @@ -489,7 +531,16 @@ jobs: noti-discord-nightly: if: always() && github.event_name == 'schedule' && (needs.create-draft-release.result == 'success' || needs.create-draft-release.result == 'skipped') && needs.ubuntu-amd64-build.result == 'success' && needs.ubuntu-amd64-cuda-build.result == 'success' && needs.macOS-M-build.result == 'success' && needs.macOS-Intel-build.result == 'success' && needs.windows-amd64-build.result == 'success' && needs.windows-amd64-cuda-build.result == 'success' - needs: [create-draft-release, ubuntu-amd64-build, ubuntu-amd64-cuda-build, macOS-M-build, macOS-Intel-build, windows-amd64-build, windows-amd64-cuda-build] + needs: + [ + create-draft-release, + 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: Checkout code @@ -516,7 +567,16 @@ jobs: noti-discord-manual: if: always() && github.event_name == 'workflow_dispatch' && (needs.create-draft-release.result == 'success' || needs.create-draft-release.result == 'skipped') && needs.ubuntu-amd64-build.result == 'success' && needs.ubuntu-amd64-cuda-build.result == 'success' && needs.macOS-M-build.result == 'success' && needs.macOS-Intel-build.result == 'success' && needs.windows-amd64-build.result == 'success' && needs.windows-amd64-cuda-build.result == 'success' - needs: [create-draft-release, ubuntu-amd64-build, ubuntu-amd64-cuda-build, macOS-M-build, macOS-Intel-build, windows-amd64-build, windows-amd64-cuda-build] + needs: + [ + create-draft-release, + 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: Checkout code @@ -541,4 +601,4 @@ jobs: git commit -m "${GITHUB_REPOSITORY}: Update README.md with nightly build artifact URL" git -c http.extraheader="AUTHORIZATION: bearer ${{ secrets.PAT_SERVICE_ACCOUNT }}" push origin HEAD:main env: - GITHUB_RUN_ID: ${{ github.run_id }} \ No newline at end of file + GITHUB_RUN_ID: ${{ github.run_id }}