Skip to content

Commit

Permalink
feat(ci): split platform build job & try add cuda build
Browse files Browse the repository at this point in the history
  • Loading branch information
jhen0409 committed Dec 23, 2024
1 parent 3b6914d commit 20b8751
Showing 1 changed file with 119 additions and 36 deletions.
155 changes: 119 additions & 36 deletions .github/workflows/release-build.yml
Original file line number Diff line number Diff line change
@@ -1,68 +1,85 @@
name: Release build
on:
push:
workflow_dispatch:
inputs:
upload-artifacts:
type: boolean
default: false
workflow_call:
inputs:
upload-artifacts:
type: boolean
default: false

jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-13, macos-14]
build-linux-x86_64:
runs-on: ubuntu-latest
container: nvidia/cuda:12.6.2-devel-ubuntu24.04
steps:
- name: Upgrade git
run: apt-get update && apt-get install -y git
- uses: actions/checkout@v4
with:
submodules: 'true'
- name: Setup QEMU
if: runner.os == 'Linux'
uses: docker/setup-qemu-action@v3
with:
platforms: linux/arm64
- uses: actions/[email protected]
with:
node-version: 20
cache: 'yarn'
- name: node_modules cache
uses: actions/[email protected]
with:
path: node_modules
key: ${{ runner.os }}-node_modules-${{ hashFiles('**/yarn.lock') }}
- name: externals cache
uses: actions/[email protected]
if: runner.os != 'Windows'
with:
path: externals
key: ${{ runner.os }}-externals-${{ hashFiles('scripts/prepare-*.sh') }}
- name: externals cache (Windows)
uses: actions/[email protected]
if: runner.os == 'Windows'
- uses: actions/[email protected]
with:
path: externals
key: ${{ runner.os }}-externals-${{ hashFiles('scripts/prepare-*.ps1') }}
node-version: 20
- name: Install yarn
run: npm install -g yarn
- name: Install dependencies
run: yarn install
- uses: msys2/setup-msys2@v2
if: runner.os == 'Windows'
- name: Prepare & build (Windows)
if: runner.os == 'Windows'
env:
CMAKE_BUILD_PARALLEL_LEVEL: 4
run: |
powershell ./scripts/prepare-windows.ps1
powershell ./scripts/build-windows.ps1
- name: Prepare & build (Linux x86_64)
if: runner.os == 'Linux'
- name: Prepare & build
env:
CMAKE_BUILD_PARALLEL_LEVEL: 4
run: |
bash ./scripts/prepare-linux.sh
bash ./scripts/build-linux.sh
- name: Prepare & build (Linux arm64)
if: runner.os == 'Linux'
- name: Upload build artifacts
if: inputs.upload-artifacts == 'true'
uses: actions/upload-artifact@v4
with:
name: bin-linux-arm64
path: bin
retention-days: 3

build-linux-arm64:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: 'true'
- name: node_modules cache
uses: actions/[email protected]
with:
path: node_modules
key: ${{ runner.os }}-node_modules-${{ hashFiles('**/yarn.lock') }}
- name: externals cache
uses: actions/[email protected]
with:
path: externals
key: ${{ runner.os }}-externals-${{ hashFiles('scripts/prepare-*.sh') }}
- uses: actions/[email protected]
with:
node-version: 20
cache: 'yarn'
- name: Install dependencies
run: yarn install
- name: Setup QEMU
uses: docker/setup-qemu-action@v3
with:
platforms: linux/arm64
- name: Prepare & build
env:
CMAKE_BUILD_PARALLEL_LEVEL: 4
run: |
Expand All @@ -71,17 +88,83 @@ jobs:
-v $(pwd):/${{ github.workspace }} \
-w /${{ github.workspace }} \
--platform linux/arm64 \
arm64v8/ubuntu:latest \
nvidia/cuda:12.6.2-devel-ubuntu24.04 \
bash -c "./scripts/prepare-linux.sh && ./scripts/build-linux.sh"
- name: Upload build artifacts
if: inputs.upload-artifacts == 'true'
uses: actions/upload-artifact@v4
with:
name: bin-linux-arm64
path: bin
retention-days: 3

build-macos:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-13, macos-14]
steps:
- uses: actions/checkout@v4
with:
submodules: 'true'
- name: node_modules cache
uses: actions/[email protected]
with:
path: node_modules
key: ${{ runner.os }}-node_modules-${{ hashFiles('**/yarn.lock') }}
- name: externals cache
uses: actions/[email protected]
with:
path: externals
key: ${{ runner.os }}-externals-${{ hashFiles('scripts/prepare-*.sh') }}
- uses: actions/[email protected]
with:
node-version: 20
cache: 'yarn'
- name: Install dependencies
run: yarn install
- name: Build (macOS)
if: runner.os == 'macOS'
env:
CMAKE_BUILD_PARALLEL_LEVEL: 4
run: bash ./scripts/build-macos.sh
- name: Upload build artifacts
if: inputs.upload-artifacts == 'true'
uses: actions/upload-artifact@v4
with:
name: bin-${{ matrix.os }}
name: bin-macos
path: bin
retention-days: 3

build-windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
with:
submodules: 'true'
- name: node_modules cache
uses: actions/[email protected]
with:
path: node_modules
key: ${{ runner.os }}-node_modules-${{ hashFiles('**/yarn.lock') }}
- name: externals cache
uses: actions/[email protected]
with:
path: externals
key: ${{ runner.os }}-externals-${{ hashFiles('scripts/prepare-*.ps1') }}
- uses: actions/[email protected]
with:
node-version: 20
cache: 'yarn'
- name: Install dependencies
run: yarn install
- name: Prepare & build
run: |
powershell ./scripts/prepare-windows.ps1
powershell ./scripts/build-windows.ps1
- name: Upload build artifacts
if: inputs.upload-artifacts == 'true'
uses: actions/upload-artifact@v4
with:
name: bin-windows
path: bin
retention-days: 3

0 comments on commit 20b8751

Please sign in to comment.