|
1 | | -name: FlexAIDdS CI (C++20) |
| 1 | +name: FlexAID CI |
2 | 2 |
|
3 | 3 | on: |
4 | 4 | push: |
5 | | - branches: ["claude/implement-todo-item-AJIMS", "main", "master"] |
6 | 5 | pull_request: |
| 6 | + workflow_dispatch: |
| 7 | + |
| 8 | +concurrency: |
| 9 | + group: ci-${{ github.workflow }}-${{ github.ref }} |
| 10 | + cancel-in-progress: true |
7 | 11 |
|
8 | 12 | jobs: |
9 | | - build: |
| 13 | + pure_python_results: |
| 14 | + name: Pure Python results tests |
| 15 | + runs-on: ubuntu-latest |
| 16 | + steps: |
| 17 | + - uses: actions/checkout@v4 |
| 18 | + - uses: actions/setup-python@v5 |
| 19 | + with: |
| 20 | + python-version: '3.11' |
| 21 | + - name: Install test dependencies |
| 22 | + run: | |
| 23 | + python -m pip install --upgrade pip |
| 24 | + python -m pip install pytest |
| 25 | + - name: Run read-only loader tests |
| 26 | + run: | |
| 27 | + PYTHONPATH=python pytest -q \ |
| 28 | + python/tests/test_results_io.py \ |
| 29 | + python/tests/test_results_loader_models.py |
| 30 | +
|
| 31 | + cxx_core_build: |
| 32 | + name: C++ core build (${{ matrix.name }}) |
| 33 | + runs-on: ${{ matrix.os }} |
10 | 34 | strategy: |
11 | 35 | fail-fast: false |
12 | 36 | matrix: |
13 | 37 | include: |
14 | | - - os: ubuntu-latest |
15 | | - compiler: g++ |
| 38 | + - name: linux-gcc |
| 39 | + os: ubuntu-latest |
16 | 40 | cc: gcc |
17 | | - - os: ubuntu-latest |
18 | | - compiler: clang++ |
| 41 | + cxx: g++ |
| 42 | + - name: linux-clang |
| 43 | + os: ubuntu-latest |
19 | 44 | cc: clang |
20 | | - - os: macos-latest |
21 | | - compiler: clang++ |
| 45 | + cxx: clang++ |
| 46 | + - name: macos-clang |
| 47 | + os: macos-latest |
22 | 48 | cc: clang |
23 | | - |
24 | | - runs-on: ${{ matrix.os }} |
25 | | - |
| 49 | + cxx: clang++ |
26 | 50 | steps: |
27 | 51 | - uses: actions/checkout@v4 |
28 | | - |
29 | | - - name: Install dependencies (Linux) |
| 52 | + - name: Install Linux dependencies |
30 | 53 | if: runner.os == 'Linux' |
31 | 54 | run: | |
32 | | - sudo apt-get update -qq |
33 | | - sudo apt-get install -y cmake build-essential libomp-dev |
34 | | -
|
35 | | - - name: Install dependencies (macOS) |
| 55 | + sudo apt-get update |
| 56 | + sudo apt-get install -y cmake ninja-build libeigen3-dev libomp-dev |
| 57 | + - name: Install macOS dependencies |
36 | 58 | if: runner.os == 'macOS' |
37 | | - run: brew install cmake libomp |
38 | | - |
39 | | - - name: Verify C++20 compiler support |
40 | | - run: | |
41 | | - ${{ matrix.compiler }} --version |
42 | | - echo '#include <span> |
43 | | - #include <concepts> |
44 | | - template<std::integral T> T id(T x){return x;} |
45 | | - int main(){std::span<int> s; return id(0);}' > /tmp/cxx20_check.cpp |
46 | | - ${{ matrix.compiler }} -std=c++20 /tmp/cxx20_check.cpp -o /tmp/cxx20_check |
47 | | - echo "C++20 support confirmed." |
48 | | -
|
| 59 | + run: | |
| 60 | + brew install cmake ninja libomp eigen |
49 | 61 | - name: Configure |
50 | | - env: |
51 | | - CXX: ${{ matrix.compiler }} |
52 | | - CC: ${{ matrix.cc }} |
53 | | - run: | |
54 | | - cmake -B build \ |
55 | | - -DCMAKE_BUILD_TYPE=Release \ |
56 | | - -DCMAKE_CXX_STANDARD=20 \ |
57 | | - -DCMAKE_CXX_STANDARD_REQUIRED=ON \ |
58 | | - -DCMAKE_CXX_EXTENSIONS=OFF \ |
59 | | - -DFLEXAIDS_USE_OPENMP=ON |
60 | | -
|
| 62 | + shell: bash |
| 63 | + run: | |
| 64 | + export CC=${{ matrix.cc }} |
| 65 | + export CXX=${{ matrix.cxx }} |
| 66 | + cmake -S . -B build -G Ninja \ |
| 67 | + -DCMAKE_BUILD_TYPE=Release \ |
| 68 | + -DFLEXAIDS_USE_CUDA=OFF \ |
| 69 | + -DFLEXAIDS_USE_METAL=OFF \ |
| 70 | + -DBUILD_PYTHON_BINDINGS=OFF |
61 | 71 | - name: Build |
62 | | - run: cmake --build build --verbose --parallel $(nproc 2>/dev/null || sysctl -n hw.ncpu) |
| 72 | + run: cmake --build build --parallel |
| 73 | + |
| 74 | + python_bindings_smoke: |
| 75 | + name: Python bindings smoke test |
| 76 | + runs-on: ubuntu-latest |
| 77 | + steps: |
| 78 | + - uses: actions/checkout@v4 |
| 79 | + - uses: actions/setup-python@v5 |
| 80 | + with: |
| 81 | + python-version: '3.11' |
| 82 | + - name: Install build dependencies |
| 83 | + run: | |
| 84 | + sudo apt-get update |
| 85 | + sudo apt-get install -y cmake ninja-build |
| 86 | + python -m pip install --upgrade pip |
| 87 | + python -m pip install 'pybind11[global]' pytest |
| 88 | + - name: Configure Python bindings |
| 89 | + run: | |
| 90 | + cmake -S . -B build-python -G Ninja \ |
| 91 | + -DCMAKE_BUILD_TYPE=Release \ |
| 92 | + -DBUILD_PYTHON_BINDINGS=ON \ |
| 93 | + -DFLEXAIDS_USE_OPENMP=OFF \ |
| 94 | + -DFLEXAIDS_USE_EIGEN=OFF \ |
| 95 | + -DFLEXAIDS_USE_CUDA=OFF \ |
| 96 | + -DFLEXAIDS_USE_METAL=OFF \ |
| 97 | + -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=${{ github.workspace }}/python/flexaidds |
| 98 | + - name: Build Python extension |
| 99 | + run: cmake --build build-python --parallel --target _core |
| 100 | + - name: Run statmech smoke test |
| 101 | + run: | |
| 102 | + PYTHONPATH=python pytest -q python/tests/test_statmech_smoke.py |
0 commit comments