Debian Codegraph @

libs/qCC_db/extern/CCCoreLib/.github/workflows/build.yml

raw
1 name: Build
2
3 on: [ push, pull_request ]
4
5 jobs:
6 build:
7 name: ${{ matrix.config.name }} SCALAR_DOUBLE=${{ matrix.scalar_double }}
8 runs-on: ${{ matrix.config.os }}
9 if: "!contains(github.event.head_commit.message, '[skip ci]')"
10
11 strategy:
12 fail-fast: false
13 matrix:
14 scalar_double: ["OFF", "ON"]
15 config:
16 - {
17 name: "Windows MSVC",
18 os: windows-latest,
19 generator: "Ninja",
20 conda_library_dir: "Library"
21 }
22 - {
23 name: "macOS Clang",
24 os: macos-latest,
25 generator: "Ninja",
26 conda_library_dir: "."
27 }
28
29 steps:
30 - name: Checkout
31 uses: actions/checkout@v4
32 with:
33 submodules: recursive
34
35 - name: Install Dependencies
36 uses: conda-incubator/setup-miniconda@v3
37 with:
38 activate-environment: CCCoreLib
39 auto-activate-base: false
40 environment-file: .ci/conda.yml
41 mamba-version: '*'
42
43 - name: Configure MSVC console (Windows)
44 if: matrix.config.os == 'windows-latest'
45 uses: ilammy/msvc-dev-cmd@v1
46
47 - name: Set environment for MSVC (Windows)
48 if: matrix.config.os == 'windows-latest'
49 run: |
50 # Set these env vars so cmake picks the correct compiler
51 # https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-commands-for-github-actions#environment-files
52 echo "CXX=cl.exe" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
53 echo "CC=cl.exe" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
54
55 - name: Configure (macOS)
56 if: matrix.config.os == 'macos-latest'
57 shell: bash -l {0}
58 run: |
59 mkdir cccorelib-build
60
61 export CONDA_LIB_DIR="$CONDA_PREFIX/${{ matrix.config.conda_library_dir }}"
62
63 cmake \
64 -B cccorelib-build \
65 -G "${{ matrix.config.generator }}" \
66 -DCMAKE_BUILD_TYPE=Release \
67 -DCMAKE_PREFIX_PATH="$CONDA_LIB_DIR" \
68 -DCCCORELIB_SCALAR_DOUBLE=${{ matrix.scalar_double }} \
69 -DCCCORELIB_USE_CGAL=FALSE \
70 -DCCCORELIB_USES_TBB=TRUE \
71 .
72
73 - name: Configure (Windows)
74 if: matrix.config.os == 'windows-latest'
75 shell: bash -l {0}
76 run: |
77 mkdir build
78
79 # DGM: without caching, using conda takes too long.
80 # Therefore we can't set -DCCCORELIB_USE_CGAL=TRUE
81 cmake \
82 -B cccorelib-build \
83 -G "${{ matrix.config.generator }}" \
84 -DCMAKE_BUILD_TYPE=Release \
85 -DCMAKE_PREFIX_PATH="$CONDA_LIB_DIR" \
86 -DCCCORELIB_SCALAR_DOUBLE=${{ matrix.scalar_double }} \
87 -DCCCORELIB_USE_CGAL=FALSE \
88 -DCCCORELIB_USES_TBB=TRUE \
89 .
90
91 - name: Build
92 run: cmake --build cccorelib-build --parallel
93
94 ubuntu-build:
95 name: Ubuntu ${{ matrix.compiler }} SCALAR_DOUBLE=${{ matrix.scalar_double }}
96 runs-on: ubuntu-22.04
97 if: "!contains(github.event.head_commit.message, '[skip ci]')"
98
99 strategy:
100 fail-fast: false
101 matrix:
102 scalar_double: [ "OFF", "ON" ]
103 compiler: ["GCC", "Clang"]
104
105 steps:
106 - name: Checkout
107 uses: actions/checkout@v3
108 with:
109 submodules: recursive
110
111 - name: Install Dependencies
112 run: >
113 sudo apt-get update -qq
114
115 sudo apt-get install -qy cmake ninja-build
116 qtbase5-dev qttools5-dev qttools5-dev-tools
117 libtbb-dev
118 libcgal-dev libcgal-qt5-dev
119
120 - name: Setup GCC
121 if: matrix.compiler == 'GCC'
122 run: |
123 echo "CC=gcc" >> $GITHUB_ENV
124 echo "CXX=g++" >> $GITHUB_ENV
125
126 - name: Setup Clang
127 if: matrix.compiler == 'Clang'
128 run: |
129 echo "CC=clang" >> $GITHUB_ENV
130 echo "CXX=clang++" >> $GITHUB_ENV
131
132 - name: Configure cmake
133 run: >
134 mkdir cccorelib-build
135
136 cmake
137 -B cccorelib-build
138 -S .
139 -G Ninja
140 -DCMAKE_BUILD_TYPE=Release
141 -DCCCORELIB_SCALAR_DOUBLE=${{ matrix.scalar_double }}
142 -DCCCORELIB_USE_CGAL=TRUE
143 -DCCCORELIB_USES_TBB=TRUE
144 .
145
146 - name: Build
147 run: cmake --build cccorelib-build --parallel