-
Notifications
You must be signed in to change notification settings - Fork 59
139 lines (122 loc) · 4.53 KB
/
Copy pathci_windows.yml
File metadata and controls
139 lines (122 loc) · 4.53 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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
name: CI Windows
on:
push:
branches:
- main
paths-ignore:
- "**/website/**"
pull_request:
branches:
- "**"
paths-ignore:
- "**/website/**"
workflow_dispatch:
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
momentum:
# Disabled: Too slow for CI (use sccache on local development)
if: false
name: cpp-${{ matrix.mode == '' && 'opt' || 'dev' }}-win
runs-on: windows-latest
strategy:
fail-fast: true
matrix:
mode: [""] # TODO: Add -dev model
env:
# Enable sccache for C++ compilation caching
CMAKE_GENERATOR: Ninja
CMAKE_GENERATOR_INSTANCE: ""
CMAKE_GENERATOR_PLATFORM: ""
CMAKE_GENERATOR_TOOLSET: ""
CMAKE_C_COMPILER_LAUNCHER: sccache
CMAKE_CXX_COMPILER_LAUNCHER: sccache
SCCACHE_CACHE_SIZE: "2G"
SCCACHE_DIR: ${{ github.workspace }}/.sccache
steps:
- name: Checkout
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- name: Restore sccache
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
with:
path: .sccache
key: ${{ github.workflow }}-win-sccache-cpp-${{ matrix.mode == '' && 'opt' || 'dev' }}-${{ hashFiles('pixi.lock', 'CMakeLists.txt', 'cmake/**', 'momentum/**', 'pymomentum/**', 'axel/**') }}
restore-keys: |
${{ github.workflow }}-win-sccache-cpp-${{ matrix.mode == '' && 'opt' || 'dev' }}-
${{ github.workflow }}-win-sccache-
- name: Set up sccache
uses: mozilla-actions/sccache-action@9e7fa8a12102821edf02ca5dbea1acd0f89a2696 # v0.0.10
- name: Set up pixi
uses: prefix-dev/setup-pixi@5185adfbffb4bd703da3010310260805d89ebb11 # v0.9.5
with:
cache: true
cache-write: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
- name: Build and test Momentum
run: |
pixi run test${{ matrix.mode }}
- name: Install Momentum and Build hello_world
run: |
pixi run install_no_build
pixi run cmake `
-S momentum/examples/hello_world `
-B momentum/examples/hello_world/build
pixi run cmake `
--build momentum/examples/hello_world/build `
--config Release `
--parallel
- name: Print sccache stats
run: sccache --show-stats
pymomentum:
# Enabled: CPU-only for cost optimization (GPU disabled)
name: py-${{ matrix.pixi_env }}-win
runs-on: windows-latest
strategy:
fail-fast: true
matrix:
include:
- pixi_env: "py312"
# GPU disabled to reduce CI cost
# - pixi_env: "py312-cuda129"
# cuda_version: "12.9.0"
env:
FULL_CUDA_VERSION: ${{ matrix.cuda_version }}
# Enable sccache for C++ compilation caching
CMAKE_GENERATOR: Ninja
CMAKE_GENERATOR_INSTANCE: ""
CMAKE_GENERATOR_PLATFORM: ""
CMAKE_GENERATOR_TOOLSET: ""
CMAKE_C_COMPILER_LAUNCHER: sccache
CMAKE_CXX_COMPILER_LAUNCHER: sccache
SCCACHE_CACHE_SIZE: "2G"
SCCACHE_DIR: ${{ github.workspace }}/.sccache
steps:
- name: Checkout
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- name: Restore sccache
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
with:
path: .sccache
key: ${{ github.workflow }}-win-sccache-py-${{ matrix.pixi_env }}-${{ hashFiles('pixi.lock', 'CMakeLists.txt', 'cmake/**', 'momentum/**', 'pymomentum/**', 'axel/**') }}
restore-keys: |
${{ github.workflow }}-win-sccache-py-${{ matrix.pixi_env }}-
${{ github.workflow }}-win-sccache-
- name: Set up sccache
uses: mozilla-actions/sccache-action@9e7fa8a12102821edf02ca5dbea1acd0f89a2696 # v0.0.10
- name: Setup CUDA
if: ${{ contains(matrix.pixi_env, 'cuda') || contains(matrix.pixi_env, 'gpu') }}
uses: ./.github/actions/setup-cuda
with:
cuda-version: ${{ matrix.cuda_version }}
- name: Set up pixi
uses: prefix-dev/setup-pixi@5185adfbffb4bd703da3010310260805d89ebb11 # v0.9.5
with:
cache: true
cache-write: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
- name: Build and test PyMomentum
run: |
pixi run -e ${{ matrix.pixi_env }} test_py
- name: Print sccache stats
run: sccache --show-stats