1+ name : CMake Build Matrix
2+
3+ on :
4+ push :
5+ branches : [ master ]
6+ pull_request :
7+ branches : [ master ]
8+
9+ env :
10+ BUILD_TYPE : Debug
11+
12+ jobs :
13+ build :
14+ name : ${{ matrix.config.name }}
15+ runs-on : ${{ matrix.config.os }}
16+
17+ strategy :
18+ fail-fast : true
19+ matrix :
20+ config :
21+ - {
22+ name : " Ubuntu Latest GCC" ,
23+ os : ubuntu-latest,
24+ cc : " /usr/bin/gcc" ,
25+ cxx : " /usr/bin/g++" ,
26+ format : " /usr/bin/clang-format-8" ,
27+ tidy : " /usr/bin/clang-tidy-8"
28+ }
29+ - {
30+ name : " Ubuntu Latest Clang" ,
31+ os : ubuntu-latest,
32+ cc : " /usr/bin/clang-8" ,
33+ cxx : " /usr/bin/clang++8" ,
34+ format : " /usr/bin/clang-format-8" ,
35+ tidy : " /usr/bin/clang-tidy-8"
36+ }
37+ - {
38+ name : " macOS Latest Clang" ,
39+ os : macos-latest,
40+ cc : " /usr/bin/clang" ,
41+ cxx : " /usr/bin/clang++" ,
42+ format : " /usr/local/opt/llvm@8/bin/clang-format" ,
43+ tidy : " /usr/local/opt/llvm@8/bin/clang-tidy"
44+ }
45+
46+ steps :
47+ - uses : actions/checkout@v2
48+
49+ - name : Print env
50+ run : |
51+ echo github.event.action: ${{ github.event.action }}
52+ echo github.event_name: ${{ github.event_name }}
53+ - name : Install Dependencies (Ubuntu)
54+ if : runner.os == 'Linux'
55+ working-directory : ${{github.workspace}}
56+ run : sudo bash ./build_support/packages.sh -y
57+
58+ - name : Install Dependencies (OSX)
59+ if : runner.os == 'macOS'
60+ working-directory : ${{github.workspace}}
61+ run : bash ./build_support/packages.sh -y
62+
63+ - name : Configure CMake
64+ run : cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCC=${{matrix.config.cc}} -DCXX=${{matrix.config.cxx}} -DCLANG_FORMAT_BIN=${{matrix.config.format}} -DCLANG_TIDY_BIN=${{matrix.config.tidy}}
65+
66+ - name : Build
67+ run : cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
68+
69+ - name : Check Format
70+ working-directory : ${{github.workspace}}/build
71+ run : make check-format
72+
73+ - name : Check Lint
74+ working-directory : ${{github.workspace}}/build
75+ run : make check-lint
76+
77+ - name : Check Clang Tidy
78+ working-directory : ${{github.workspace}}/build
79+ run : make check-clang-tidy
80+
81+ - name : Check Tests (Ubuntu)
82+ if : runner.os == 'Linux'
83+ working-directory : ${{github.workspace}}/build
84+ run : make check-tests
85+
86+ - name : Check Tests (OSX)
87+ if : runner.os == 'macOS'
88+ working-directory : ${{github.workspace}}/build
89+ # Disable container overflow checks on OSX
90+ run : ASAN_OPTIONS=detect_container_overflow=0 make check-tests
0 commit comments