Skip to content

Commit abc69eb

Browse files
committed
CI
1 parent 8fada2a commit abc69eb

File tree

4 files changed

+50
-8
lines changed

4 files changed

+50
-8
lines changed

.github/workflows/workflow.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: build and run tests
2+
on:
3+
push:
4+
branches: [ master ]
5+
pull_request:
6+
branches: [ master ]
7+
8+
jobs:
9+
build-and-test:
10+
runs-on: ubuntu-latest
11+
strategy:
12+
matrix:
13+
CXX: [clang++-10, clang++-11, clang++-12]
14+
include:
15+
- CXX: clang++-10
16+
DEPS: clang-10 llvm-10-dev libclang-10-dev libclang-cpp10-dev
17+
18+
- CXX: clang++-11
19+
DEPS: clang-11 llvm-11-dev libclang-11-dev libclang-cpp11-dev
20+
21+
- CXX: clang++-12
22+
DEPS: clang-12 llvm-12-dev libclang-12-dev libclang-cpp12-dev
23+
24+
steps:
25+
- uses: actions/checkout@v2
26+
with:
27+
submodules: recursive
28+
29+
- name: install-dependencies
30+
run: >
31+
sudo apt-get update &&
32+
sudo apt-get install -yq ${{ matrix.DEPS }}
33+
34+
- name: cmake-configure
35+
run: >
36+
cmake -B build
37+
-DCMAKE_BUILD_TYPE=Debug
38+
-DCMAKE_CXX_COMPILER=${{ matrix.CXX }}
39+
40+
- name: cmake-build
41+
run: cmake --build build --parallel $(nproc)
42+
43+
- name: test-run
44+
run: cmake --build build --target test
45+
env:
46+
CTEST_OUTPUT_ON_FAILURE: 1

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ include(ClangSetup)
2727
# build
2828
add_executable(${AutoYAML_bin} "${AutoYAML_src}")
2929
target_compile_features(${AutoYAML_bin} PRIVATE cxx_std_17)
30-
target_compile_definitions(${AutoYAML_bin} PRIVATE -DCLANG_INCLUDE_PATHS="${CLANG_INCLUDE_PATHS}")
30+
target_compile_definitions(${AutoYAML_bin} PRIVATE -DCLANG_INCLUDE_PATHS="${Clang_INCLUDE_PATHS}")
3131
target_link_libraries(${AutoYAML_bin} PRIVATE clang-cpp)
3232
llvm_config(${AutoYAML_bin} USE_SHARED option)
3333

README.md

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -94,16 +94,12 @@ repository:
9494

9595
```
9696
mkdir build && cd build
97-
cmake .. -DCMAKE_CXX_COMPILER=clang++ -DClang_DIR=/usr/lib/clang/12.0.0/ -DClang_VERSION=12
97+
cmake .. -DCMAKE_CXX_COMPILER=clang++
9898
cmake --build .
9999
```
100100

101101
This will create the `AutoYAML` executable at the root of the build directory.
102-
You can install it to `${CMAKE_INSTALL_PREFIX}/bin` by running `cmake --install
103-
.`. Note that you need to build with clang and that the `Clang_DIR` and
104-
`Clang_VERSION` parameters are mandatory. The correct `Clang_DIR` location
105-
might be different on your system and you can also try building against another
106-
version of Clang/LLVM (at your own risk).
102+
You can install it to `${CMAKE_INSTALL_PREFIX}/bin` by running `cmake --install.
107103

108104
## TODO
109105

0 commit comments

Comments
 (0)