-
Notifications
You must be signed in to change notification settings - Fork 9
105 lines (93 loc) · 3.05 KB
/
ci_ubuntu.yml
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
94
95
96
97
98
99
100
101
102
103
104
105
name: CI Ubuntu
on:
push:
branches:
- "**"
paths-ignore:
- "**/website/**"
pull_request:
branches:
- "**"
paths-ignore:
- "**/website/**"
jobs:
momentum:
name: cpp${{ matrix.simd == 'ON' && '-simd' || '' }}-${{ matrix.mode == '' && 'opt' || 'dev' }}-ubuntu
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
simd: ["ON", "OFF"]
mode: ["", "_dev"]
env:
MOMENTUM_ENABLE_SIMD: ${{ matrix.simd }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up pixi
uses: prefix-dev/[email protected]
with:
cache: true
- name: Build and test Momentum
run: |
MOMENTUM_BUILD_PYMOMENTUM=$MOMENTUM_BUILD_PYMOMENTUM \
MOMENTUM_ENABLE_SIMD=$MOMENTUM_ENABLE_SIMD \
pixi run test${{ matrix.mode }}
- name: Install Momentum and Build hello_world
run: |
MOMENTUM_BUILD_PYMOMENTUM=$MOMENTUM_BUILD_PYMOMENTUM \
MOMENTUM_ENABLE_SIMD=$MOMENTUM_ENABLE_SIMD \
pixi run install
pixi run cmake \
-S momentum/examples/hello_world \
-B momentum/examples/hello_world/build \
-DCMAKE_BUILD_TYPE=Release
pixi run cmake --build momentum/examples/hello_world/build
pymomentum:
name: py-${{ matrix.pixi_env }}-ubuntu
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- pixi_env: "cpu"
- pixi_env: "gpu"
cuda_version: "12.6.2"
env:
FULL_CUDA_VERSION: ${{ matrix.cuda_version }}
steps:
- name: Maximize build space
if: ${{ contains(matrix.pixi_env, 'cuda') || contains(matrix.pixi_env, 'gpu') }}
uses: easimon/maximize-build-space@master
with:
root-reserve-mb: 32768
remove-dotnet: true
remove-android: true
remove-haskell: true
remove-codeql: true
remove-docker-images: true
- name: Checkout
uses: actions/checkout@v4
- name: Install CUDA Toolkit
if: ${{ contains(matrix.pixi_env, 'cuda') || contains(matrix.pixi_env, 'gpu') }}
uses: Jimver/[email protected]
id: cuda-toolkit
with:
# Available versions: https://github.com/Jimver/cuda-toolkit/blob/v0.2.18/src/links/linux-links.ts
cuda: ${{ matrix.cuda_version }}
- name: Check CUDA Version
if: ${{ contains(matrix.pixi_env, 'cuda') || contains(matrix.pixi_env, 'gpu') }}
run: |
nvcc --version
- name: Set Conda environment variables
if: ${{ contains(matrix.pixi_env, 'cuda') || contains(matrix.pixi_env, 'gpu') }}
run: |
echo "CONDA_OVERRIDE_CUDA=$(echo $FULL_CUDA_VERSION | cut -d'.' -f1)" >> $GITHUB_ENV
- name: Set up pixi
uses: prefix-dev/[email protected]
with:
environments: ${{ matrix.pixi_env }}
cache: true
- name: Build PyMomentum
run: |
pixi run -e ${{ matrix.pixi_env }} test_py