feat(ci): split platform build job & try add cuda build #10
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release build | |
on: | |
push: | |
workflow_call: | |
inputs: | |
upload-artifacts: | |
type: boolean | |
default: false | |
jobs: | |
build-linux-x86_64: | |
runs-on: ubuntu-latest | |
container: nvidia/cuda:12.6.2-devel-ubuntu24.04 | |
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: Prepare & build | |
env: | |
CMAKE_BUILD_PARALLEL_LEVEL: 4 | |
run: | | |
bash ./scripts/prepare-linux.sh | |
bash ./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-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: | | |
docker run --rm \ | |
-e CMAKE_BUILD_PARALLEL_LEVEL=${{ env.CMAKE_BUILD_PARALLEL_LEVEL }} \ | |
-v $(pwd):/${{ github.workspace }} \ | |
-w /${{ github.workspace }} \ | |
--platform linux/arm64 \ | |
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') }} | |
- name: Install dependencies | |
run: yarn install | |
- name: Build (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-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') }} | |
- 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 |