-
Notifications
You must be signed in to change notification settings - Fork 10
46 lines (43 loc) · 1.29 KB
/
cmake_integration.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
name: CMake integration
on:
push:
branches: [main]
pull_request:
branches: [main]
# Newer commits should cancel old runs
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: applied-material-modeling/neml2-ci@main
with:
path: neml2
python-version: 3.9
cmake-version: 3.28
torch-version: 2.5.1
- name: Create a source file for testing purposes
run: |
echo -e "\
#include \"neml2/base/Registry.h\"\n\
int main() {\n\
return 0;\n\
}\
" > main.cxx
- name: Create a CMakeLists.txt file for testing purposes
run: |
echo -e "\
cmake_minimum_required(VERSION 3.28)
project(FOO)\n\
add_subdirectory(neml2)\n\
add_executable(foo main.cxx)\n\
add_compile_definitions(_GLIBCXX_USE_CXX11_ABI=0)\n\
target_link_libraries(foo neml2)\n\
" > CMakeLists.txt
- name: Configure with CMake
run: cmake -DNEML2_TESTS=OFF -GNinja -B build .
- name: Compile
run: cmake --build build --target all
- run: ./build/foo