-
Notifications
You must be signed in to change notification settings - Fork 0
55 lines (48 loc) · 1.78 KB
/
google-test.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
name: CMake and Google Test
on: [ push, pull_request ]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
compiler: [ gcc ]
python-version: [ "3.11" ]
steps:
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Checkout repository
uses: actions/checkout@v4
- name: setup google test
uses: Bacondish2023/setup-googletest@v1
- name: Install C++ build tools & git
run: sudo apt-get update && sudo apt-get install -y build-essential git
- name: Install CMake
run: sudo apt-get update && sudo apt-get install -y cmake
- name: Install Boost
run: sudo apt-get update && sudo apt-get install -y libboost-all-dev
- name: Install OpenMP
run: sudo apt-get update && sudo apt-get install -y libomp-dev
- name: Install cnpy
run: |
git clone https://github.com/TomSchammo/cnpy/
cd cnpy
git checkout cpp17
mkdir build
cd build
cmake .. -DCMAKE_CXX_FLAGS="-D_GLIBCXX_USE_CXX11_ABI=0"
make VERBOSE=1
sudo make install
- name: Install libtorch
run: |
python3.11 -m pip install --upgrade pip
python3.11 -m pip install setuptools==69.5.1 numpy==1.24.0
python3.11 -m pip install torch==2.1.0+cpu -f https://download.pytorch.org/whl/torch_stable.html
- name: Find PyTorch cmake path
id: find-torch-cmake-path
run: |
echo "TORCH_PATH=$(python3.11 -c 'import torch; import os; print(os.path.join(torch.__path__[0], "share", "cmake"))')" >> $GITHUB_ENV
- name: Build and run Google Test
run: |
make ctest