-
Notifications
You must be signed in to change notification settings - Fork 62
64 lines (55 loc) · 1.69 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
name: CMake
on:
push:
branches: ["main"]
paths:
- "ports/cpp/**"
- ".github/workflows/*"
pull_request:
branches: ["main"]
paths:
- "ports/cpp/**"
- ".github/workflows/*"
jobs:
build:
strategy:
matrix:
cmake_build_type: [Asan, Release]
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install dependencies
run: |
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
sudo add-apt-repository "deb http://apt.llvm.org/noble/ llvm-toolchain-noble-18 main"
sudo apt update
sudo apt install build-essential
sudo apt install clang-format-18 clang-tidy-18
- name: Setup ccache
uses: hendrikmuhs/ccache-action@v1.2
with:
create-symlink: true
key: ${{ github.job }}-${{ matrix.cmake_build_type }}
- name: Clang-Format
working-directory: ${{github.workspace}}/ports/cpp
run: sh ./ci/check-format.sh
- name: Configure
working-directory: ${{github.workspace}}/ports/cpp
run: |
mkdir build
cd build
cmake \
-DANTLR4C3_DEVELOPER=ON \
-DCMAKE_BUILD_TYPE=${{ matrix.cmake_build_type }} \
..
- name: Build
working-directory: ${{github.workspace}}/ports/cpp/build
run: make
- name: Unit Test
working-directory: ${{github.workspace}}/ports/cpp
run: sh ./ci/test.sh
- name: Clang-Tidy on sources
if: matrix.cmake_build_type == 'Release'
working-directory: ${{github.workspace}}/ports/cpp
run: sh ./ci/check-style.sh