-
Notifications
You must be signed in to change notification settings - Fork 16
93 lines (82 loc) · 2.73 KB
/
Copy pathbuild.yml
File metadata and controls
93 lines (82 loc) · 2.73 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
name: Build
on:
workflow_dispatch:
push:
branches:
- master
- release-*
- dev
pull_request:
branches:
- master
- dev
jobs:
build:
runs-on: ubuntu-24.04
container:
image: nvidia/cuda:12.6.3-cudnn-devel-ubuntu24.04
strategy:
matrix:
compiler:
- name: gcc
cc: /usr/bin/gcc-13
cxx: /usr/bin/g++-13
packages: gcc-13 g++-13
cmake_version: system
- name: clang
cc: /usr/bin/clang-18
cxx: /usr/bin/clang++-18
packages: clang-18 clang-tools-18
cmake_version: system
- name: legacy
cc: /usr/bin/gcc-12
cxx: /usr/bin/g++-12
packages: gcc-12 g++-12
cmake_version: "3.25.3"
env:
CMAKE_GENERATOR: Ninja
CC: ${{ matrix.compiler.cc }}
CXX: ${{ matrix.compiler.cxx }}
CMAKE_C_COMPILER_LAUNCHER: ccache
CMAKE_CXX_COMPILER_LAUNCHER: ccache
CMAKE_CUDA_COMPILER_LAUNCHER: ccache
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install deps
run: apt update && apt install -y wget build-essential ninja-build git python3-dev ${{ matrix.compiler.packages }} libopenmpi-dev
- name: Install CMake (system)
if: matrix.compiler.cmake_version == 'system'
run: apt install -y cmake
- name: Install CMake (specific version)
if: matrix.compiler.cmake_version != 'system'
run: |
CMAKE_VERSION=${{ matrix.compiler.cmake_version }}
wget -q https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/cmake-${CMAKE_VERSION}-linux-x86_64.tar.gz
tar -xzf cmake-${CMAKE_VERSION}-linux-x86_64.tar.gz
cp -r cmake-${CMAKE_VERSION}-linux-x86_64/bin/* /usr/local/bin/
cp -r cmake-${CMAKE_VERSION}-linux-x86_64/share/cmake* /usr/local/share/
cmake --version
- name: Create build directory
run: mkdir -p build
- name: ccache
uses: hendrikmuhs/ccache-action@v1.2
with:
key: ${{ matrix.compiler.name }}-build
- name: CMake Configure
run: |
cmake -B build -S . -DCMAKE_CUDA_ARCHITECTURES=80
- name: CMake Build
run: cmake --build build --parallel --target export-checkpoint train
- name: CMake Install to staging
run: |
mkdir -p install
cmake --install build --prefix install
- name: Create build artifact
run: |
tar -czf build-artifacts.tar.gz -C install .
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: binaries-${{ matrix.compiler.name }}
path: build-artifacts.tar.gz