-
Notifications
You must be signed in to change notification settings - Fork 59
145 lines (124 loc) · 4.71 KB
/
Copy pathci_ubuntu.yml
File metadata and controls
145 lines (124 loc) · 4.71 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
140
141
142
143
144
145
name: CI Ubuntu
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:
name: cpp${{ matrix.simd == 'ON' && '-simd' || '' }}-${{ matrix.mode == '' && 'opt' || 'dev' }}-ubuntu
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
simd: ["ON"] # Only test SIMD=ON (production config) to reduce CI cost
mode: [""]
env:
MOMENTUM_ENABLE_SIMD: ${{ matrix.simd }}
CMAKE_C_COMPILER_LAUNCHER: ccache
CMAKE_CXX_COMPILER_LAUNCHER: ccache
CCACHE_EXTRAFILES: /tmp/native-cpu.txt
steps:
- name: Checkout
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- name: Record native CPU for ccache
run: |
lscpu | sed -n '/^Model name:/p;/^Flags:/p' > /tmp/native-cpu.txt
- name: Set up ccache
uses: hendrikmuhs/ccache-action@d62db5f07c26379fc4b4e0916f098a92573c3b03 # v1.2.23
with:
key: ${{ github.workflow }}-cpp-ubuntu-simd-${{ matrix.simd }}-${{ matrix.mode == '' && 'opt' || 'dev' }}
# ccache-action appends a timestamp when saving; restore keys are the timestamp-free prefixes.
# Keep SIMD and build mode in the cache key. Native CPU information
# belongs in CCACHE_EXTRAFILES so one archive can contain entries for
# multiple GitHub runner CPU variants while ccache still rejects
# objects built for a different -march=native expansion.
restore-keys: |
${{ github.workflow }}-cpp-ubuntu-simd-${{ matrix.simd }}-${{ matrix.mode == '' && 'opt' || 'dev' }}
max-size: 2G
- name: Reset ccache stats
run: ccache --zero-stats
- name: Set up pixi
uses: prefix-dev/setup-pixi@a09b6247153796b190642a2b53fac4241043cf6f # v0.9.5
with:
cache: true
- name: Check code formatting
run: |
pixi run lint-check
- 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_no_build
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
- name: Print ccache stats
if: always()
run: ccache --show-stats --verbose
pymomentum:
name: py-py312-ubuntu
runs-on: ubuntu-latest
env:
CMAKE_C_COMPILER_LAUNCHER: ccache
CMAKE_CXX_COMPILER_LAUNCHER: ccache
CCACHE_EXTRAFILES: /tmp/native-cpu.txt
steps:
- name: Checkout
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- name: Record native CPU for ccache
run: |
lscpu | sed -n '/^Model name:/p;/^Flags:/p' > /tmp/native-cpu.txt
- name: Set up ccache
uses: hendrikmuhs/ccache-action@d62db5f07c26379fc4b4e0916f098a92573c3b03 # v1.2.23
with:
key: ${{ github.workflow }}-py312-ubuntu
# ccache-action appends a timestamp when saving; restore keys are the
# timestamp-free prefixes. Native CPU information belongs in
# CCACHE_EXTRAFILES so one archive can contain entries for multiple
# GitHub runner CPU variants while ccache still rejects objects built
# for a different -march=native expansion.
restore-keys: |
${{ github.workflow }}-py312-ubuntu
max-size: 2G
- name: Reset ccache stats
run: ccache --zero-stats
- name: Set up pixi
uses: prefix-dev/setup-pixi@a09b6247153796b190642a2b53fac4241043cf6f # v0.9.5
with:
environments: py312
cache: true
- name: Build and test PyMomentum
run: |
pixi run -e py312 test_py
- name: Build Python API Doc
run: |
pixi run -e py312 doc_py_no_build
- name: Upload Python API Doc
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: python-api-doc
path: build/python_api_doc
retention-days: 7
- name: Print ccache stats
if: always()
run: ccache --show-stats --verbose