-
Notifications
You must be signed in to change notification settings - Fork 1
113 lines (108 loc) · 3.39 KB
/
ci.yml
File metadata and controls
113 lines (108 loc) · 3.39 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
name: FlexAID CI
on:
push:
pull_request:
workflow_dispatch:
concurrency:
group: ci-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
pure_python_results:
name: Pure Python results tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install test dependencies
run: |
python -m pip install --upgrade pip
python -m pip install pytest
- name: Run read-only loader tests
run: |
PYTHONPATH=python pytest -q \
python/tests/test_results_io.py \
python/tests/test_results_loader_models.py
cxx_core_build:
name: C++ core (${{ matrix.name }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- name: linux-gcc
os: ubuntu-latest
cc: gcc
cxx: g++
- name: linux-clang
os: ubuntu-latest
cc: clang
cxx: clang++
- name: macos-clang
os: macos-latest
cc: clang
cxx: clang++
steps:
- uses: actions/checkout@v4
- name: Install Linux dependencies
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y cmake ninja-build libeigen3-dev libomp-dev
- name: Install macOS dependencies
if: runner.os == 'macOS'
run: |
brew install cmake ninja libomp eigen
- name: Configure
shell: bash
run: |
export CC=${{ matrix.cc }}
export CXX=${{ matrix.cxx }}
CMAKE_ARGS=(
-S . -B build -G Ninja
-DCMAKE_BUILD_TYPE=Release
-DFLEXAIDS_USE_CUDA=OFF
-DFLEXAIDS_USE_METAL=OFF
-DBUILD_PYTHON_BINDINGS=OFF
-DBUILD_TESTING=ON
)
# Homebrew on Apple Silicon installs to /opt/homebrew
if [ "$RUNNER_OS" = "macOS" ]; then
CMAKE_ARGS+=(-DCMAKE_PREFIX_PATH="$(brew --prefix)")
fi
cmake "${CMAKE_ARGS[@]}"
- name: Build
run: cmake --build build --parallel
- name: Test
run: ctest --test-dir build --output-on-failure
python_bindings_smoke:
name: Python bindings smoke test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install build dependencies
run: |
sudo apt-get update
sudo apt-get install -y cmake ninja-build
python -m pip install --upgrade pip
python -m pip install 'pybind11[global]' pytest
- name: Configure Python bindings
run: |
cmake -S . -B build-python -G Ninja \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_PYTHON_BINDINGS=ON \
-DPYBIND11_FINDPYTHON=ON \
-DFLEXAIDS_USE_OPENMP=OFF \
-DFLEXAIDS_USE_EIGEN=OFF \
-DFLEXAIDS_USE_CUDA=OFF \
-DFLEXAIDS_USE_METAL=OFF \
-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=${{ github.workspace }}/python/flexaidds
- name: Build Python extension
run: cmake --build build-python --parallel --target _core
- name: Run statmech smoke test
run: |
PYTHONPATH=python pytest -q python/tests/test_statmech_smoke.py