-
Notifications
You must be signed in to change notification settings - Fork 0
78 lines (69 loc) · 2.42 KB
/
cmake.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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
name: CMake
on:
push:
tags:
- v*
branches:
- master
- development
paths-ignore:
- README.md
pull_request:
branches:
- master
- development
env:
vcpkgCommitId: c9919121dde6f61c0436adda94624636e041226b
jobs:
build:
strategy:
fail-fast: false
matrix:
os:
- ubuntu-22.04
compiler:
- { name: Clang 15, cc: /usr/bin/clang-15, cxx: /usr/bin/clang++-15 }
# - { name: GCC 10, cc: /usr/bin/gcc-10, cxx: /usr/bin/g++-10 }
- { name: GCC 11, cc: /usr/bin/gcc-11, cxx: /usr/bin/g++-11 }
- { name: GCC 12, cc: /usr/bin/gcc-12, cxx: /usr/bin/g++-12 }
- { name: GCC 13, cc: /usr/bin/gcc-13, cxx: /usr/bin/g++-13 }
generator:
- "Ninja Multi-Config"
build_type:
- Release
- Debug
include:
- os: windows-2022
compiler: msvc
generator: "Visual Studio 17 2022"
build_type: Debug
- os: windows-2022
compiler: msvc
generator: "Visual Studio 17 2022"
build_type: Release
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: seanmiddleditch/gha-setup-ninja@master
- name: Set CC & CXX env
if: ${{ matrix.os == 'ubuntu-22.04' }}
shell: bash
run: |
${{ matrix.compiler.cc }} --version
${{ matrix.compiler.cxx }} --version
echo "CC=${{ matrix.compiler.cc }}" >> $GITHUB_ENV
echo "CXX=${{ matrix.compiler.cxx }}" >> $GITHUB_ENV
- name: Restore from cache and setup vcpkg executable and data files.
uses: lukka/run-vcpkg@v11
with:
vcpkgJsonGlob: 'vcpkg.json'
vcpkgGitCommitId: '${{ env.vcpkgCommitId }}'
- name: Configure CMake
run: cmake -B ${{github.workspace}}/build -G "${{matrix.generator}}" -DCMAKE_BUILD_TYPE:STRING=${{matrix.build_type}} -DTEXT_PROCESSING_ENABLE_TESTS=ON -DDEVELOPER_BUILD=ON -DCMAKE_TOOLCHAIN_FILE=${{ env.VCPKG_ROOT }}/scripts/buildsystems/vcpkg.cmake
- name: Build
run: cmake --build ${{github.workspace}}/build --config ${{matrix.build_type}}
- name: Test
working-directory: ${{github.workspace}}/build
# Execute tests defined by the CMake configuration.
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
run: ctest --output-on-failure -C ${{matrix.build_type}}