-
Notifications
You must be signed in to change notification settings - Fork 7
88 lines (88 loc) · 3.07 KB
/
check-commit.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
79
80
81
82
83
84
85
86
87
88
name: Post-commit check
on: [push]
jobs:
generate-invokers:
runs-on: ubuntu-22.04
timeout-minutes: 10
steps:
- name: Perform checkout
uses: actions/checkout@v3
- name: Install Java 11
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '11'
cache: 'sbt'
- name: Generate invokers
run: ./update_invokers.sh
- name: Save invokers as artifacts
uses: actions/upload-artifact@v3
with:
name: invokers
path: runtime/generated
build-and-test:
timeout-minutes: 10
needs: generate-invokers
env:
cxx_compilers: "{'gcc': 'g++', 'clang': 'clang++', 'afl-clang-fast': 'afl-clang-fast++'}"
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04, ubuntu-22.04]
compiler: [clang, gcc]
extra_cflags: ['']
extra_cmake_opts: ['']
extra_ubuntu_packages: ['']
include:
- os: ubuntu-22.04
compiler: clang
extra_cflags: "-fsanitize=undefined"
- os: ubuntu-22.04
compiler: clang
extra_cflags: "-fsanitize=address"
- os: ubuntu-22.04
compiler: afl-clang-fast
extra_cmake_opts: '-DKBDYSCH_PERFORM_AFL_TESTS=ON'
extra_ubuntu_packages: afl++
- os: ubuntu-22.04
compiler: clang
extra_cmake_opts: '-G Ninja'
extra_ubuntu_packages: ninja-build
runs-on: ${{matrix.os}}
steps:
- name: Perform checkout
uses: actions/checkout@v3
- name: Disable third-party software
# I would like to check the specific versions of build tools (especially CMake)
run: sudo mv /usr/local /usr/local.orig
- name: Install other dependencies
run: sudo apt-get install --no-install-recommends -y cmake libpth-dev clang ${{matrix.extra_ubuntu_packages}}
- name: Print summary
run: |
echo "OS: ${{matrix.os}}, compiler: ${{matrix.compiler}}"
echo "Extra Ubuntu packages: [${{matrix.extra_ubuntu_packages}}]"
echo "Extra CFLAGS: [${{matrix.extra_cflags}}]"
echo "Extra CMake options: [${{matrix.extra_cmake_opts}}]"
gcc --version
clang --version
afl-clang-fast || true
cmake --version
- name: Restore invokers from artifacts
uses: actions/download-artifact@v3
with:
name: invokers
path: runtime/generated
- name: Run CMake
run: |
mkdir build
cd build
cmake .. -DUSE_LKL=OFF -DUSE_DUMMY_LKL=ON \
-DCMAKE_C_COMPILER=${{matrix.compiler}} \
-DCMAKE_CXX_COMPILER=${{ fromJSON(env.cxx_compilers)[matrix.compiler] }} \
-DCMAKE_C_FLAGS="${{matrix.extra_cflags}}" \
-DCMAKE_CXX_FLAGS="${{matrix.extra_cflags}}" \
${{matrix.extra_cmake_opts}}
- name: Build harnesses
run: cmake --build ./build
- name: Run tests
run: cd build && ctest --output-on-failure --test-output-size-failed 65536