forked from pairinteraction/pairinteraction
-
Notifications
You must be signed in to change notification settings - Fork 0
93 lines (79 loc) · 2.74 KB
/
cpp-backend.yml
File metadata and controls
93 lines (79 loc) · 2.74 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
name: C++ Backend
on:
push:
branches: ["*"]
pull_request:
types: [opened, reopened, synchronize]
workflow_call:
workflow_dispatch:
inputs:
debug_enabled:
type: boolean
description: 'Run the build with tmate debugging enabled'
required: false
default: false
env:
CMAKE_BUILD_PARALLEL_LEVEL: 2
VERBOSE: 1
CLICOLOR_FORCE: 1
jobs:
backend:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
distro: [debian, ubuntu, manylinux, opensuse, static-analysis]
CXXFLAGS: ["-march=x86-64-v3"]
TEST_TARGET: ["test"]
BUILD_ARGS: ["-- --keep-going"]
include:
- distro: opensuse
EXTRA_CMAKE_ARGS: -DCMAKE_CXX_COMPILER="g++-12"
- distro: static-analysis
EXTRA_CMAKE_ARGS: -DCMAKE_CXX_COMPILER="clang++" -DCMAKE_CXX_CLANG_TIDY="clang-tidy"
- os: macos-15-intel
distro: macos
name: macos-x86_64
TEST_TARGET: "test"
BUILD_ARGS: "-- --keep-going"
- os: macos-14
distro: macos
name: macos-arm64
TEST_TARGET: "test"
BUILD_ARGS: "-- --keep-going"
- os: windows-2022
distro: windows
EXTRA_CMAKE_ARGS: -G "Visual Studio 17 2022" -DPython3_FIND_REGISTRY=LAST
CXXFLAGS: "/Ox /arch:AVX2"
TEST_TARGET: "RUN_TESTS"
BUILD_ARGS: "--config RelWithDebInfo"
name: ${{ matrix.name || matrix.distro }}
runs-on: ${{ matrix.os }}
timeout-minutes: 60
env:
CXXFLAGS: ${{ matrix.CXXFLAGS }}
container:
image: ${{ matrix.os == 'ubuntu-latest' && format('ghcr.io/pairinteraction/pairinteraction-{0}:docker', matrix.distro) || null }}
steps:
- uses: actions/checkout@v6
- name: Restore Git LFS from cache
uses: ./.github/actions/cache-lfs
- name: Install macOS dependencies
if: runner.os == 'macOS'
run: brew install --force-bottle spdlog nlohmann-json eigen tbb lapack fmt
- name: Install Windows dependencies
if: runner.os == 'Windows'
uses: ./.github/actions/setup-vcpkg
- name: Setup uv build virtual environment
uses: ./.github/actions/setup-uv-build-venv
- name: Configure
run: uv run --no-project cmake -S . -B build/ ${{ matrix.EXTRA_CMAKE_ARGS }}
- name: Build
run: cmake --build build/ ${{ matrix.BUILD_ARGS }}
- name: Test
run: cmake --build build/ --target ${{ matrix.TEST_TARGET }} ${{ matrix.BUILD_ARGS }}
- name: Run debugging session in tmate
if: github.event_name == 'workflow_dispatch' && github.event.inputs.debug_enabled && always()
uses: mxschmitt/action-tmate@v3
with:
limit-access-to-actor: true