-
Notifications
You must be signed in to change notification settings - Fork 0
67 lines (55 loc) · 2.1 KB
/
Copy pathci-cpp-linux.yml
File metadata and controls
67 lines (55 loc) · 2.1 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
name: CI C++ (Linux)
on:
push:
branches: ['**']
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref_name }}
cancel-in-progress: true
jobs:
build-cpp:
name: Build C++ (Linux)
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Unshallow vcpkg
run: git -C deps/vcpkg fetch --unshallow
- uses: ./.github/actions/setup-vcpkg-linux
- name: Configure
run: >
cmake -S . -B build
-DCMAKE_BUILD_TYPE:STRING=Release
-DMSCL_BUILD_TESTS:BOOL=ON
-DMSCL_BUILD_CPP_EXAMPLES:BOOL=ON
-DMSCL_BUILD_PYTHON3:BOOL=ON
- name: Build
run: cmake --build build --parallel $(nproc)
- name: Test
run: >
ctest
--test-dir build
--build-config Release
--output-on-failure
--parallel $(nproc)
# This install is only a throwaway fixture for the consumer smoke test below -
# it verifies that cmake/mscl-config.cmake.in works when consumed via
# find_package() from a separate project, since that path has no other
# coverage in this workflow. It is not related to MSCL_BUILD_PACKAGE/CPack
# release packaging.
- name: Install MSCL (for consumer smoke test)
run: cmake --install build --prefix ${{ github.workspace }}/mscl-install
- name: Configure C++ consumer smoke test
run: >
cmake -S tests/cpp-consumer-smoke -B build-cpp-consumer-smoke
-DCMAKE_BUILD_TYPE:STRING=Release
-DMSCL_ROOT_DIR=${{ github.workspace }}/mscl-install
-DCMAKE_TOOLCHAIN_FILE=${{ github.workspace }}/deps/vcpkg/scripts/buildsystems/vcpkg.cmake
-DVCPKG_TARGET_TRIPLET=x64-linux-dynamic
-DVCPKG_INSTALLED_DIR=${{ github.workspace }}/build/vcpkg_installed
- name: Build C++ consumer smoke test
run: cmake --build build-cpp-consumer-smoke --parallel $(nproc)
- name: Run C++ consumer smoke test
run: ./build-cpp-consumer-smoke/smoke-test