-
Notifications
You must be signed in to change notification settings - Fork 1
46 lines (44 loc) · 1.69 KB
/
build-sanitized.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
name: Build + Test (Sanitized)
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
merge_group:
branches: [ "main" ]
workflow_dispatch:
jobs:
build-and-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: apt-get dependencies
run: |
sudo apt-get update
sudo apt-get -y install unzip wget cmake lsb-release software-properties-common gnupg
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh 16
sudo apt-get -y install clang-format-16
- name: Get googletest
run: |
wget https://github.com/google/googletest/archive/refs/tags/release-1.12.1.zip
unzip release-1.12.1.zip
cd googletest-release-1.12.1
mkdir build
cd build
cmake .. -DCMAKE_CXX_COMPILER=clang++-16 -DCMAKE_C_COMPILER=clang-16
make
- name: Build main executable
run: make LLVM_CONFIG=llvm-config-16 CXX=clang++-16 EXTRA_CPPFLAGS="-fsanitize=address -fsanitize=undefined"
- name: Build test executable
run: make test GTEST_HDR=googletest-release-1.12.1/googletest/include GTEST_LIB=googletest-release-1.12.1/build/lib LLVM_CONFIG=llvm-config-16 CXX=clang++-16 EXTRA_CPPFLAGS="-fsanitize=address -fsanitize=undefined"
- name: Run test executable
run: ./test
- name: Check formatting
run: make format-check LLVM_CONFIG=llvm-config-16 CLANG_FORMAT=clang-format-16
- name: Check main executable
run: |
./main test_input.txt | llc-16 -filetype=obj -o /tmp/out.o --relocation-model=pic
clang-16 /tmp/out.o
if [ "$(./a.out)" != "Hi! I am ALIVE!" ]; then echo "Output is: $(./a.out)'"exit 1; fi