diff options
-rw-r--r-- | .github/workflows/build.yaml | 185 | ||||
-rw-r--r-- | README.md | 1 | ||||
-rw-r--r-- | scripts/build/v-clang.inc | 15 | ||||
-rw-r--r-- | scripts/build/v-llvm.inc | 4 |
4 files changed, 200 insertions, 5 deletions
diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml new file mode 100644 index 00000000..bebba374 --- /dev/null +++ b/.github/workflows/build.yaml @@ -0,0 +1,185 @@ +name: CI + +on: + pull_request: + branches: master + push: + branches: master + +# Defaults for building KLEE +env: + BASE_IMAGE: ubuntu:bionic-20200807 + REPOSITORY: klee + COVERAGE: 0 + DISABLE_ASSERTIONS: 0 + ENABLE_DOXYGEN: 0 + ENABLE_OPTIMIZED: 1 + ENABLE_DEBUG: 1 + GTEST_VERSION: 1.7.0 + KLEE_RUNTIME_BUILD: "Debug+Asserts" + LLVM_VERSION: 9 + METASMT_VERSION: qf_abv + MINISAT_VERSION: "master" + REQUIRES_RTTI: 0 + SANITIZER_BUILD: + SOLVERS: STP:Z3 + STP_VERSION: 2.3.3 + TCMALLOC_VERSION: 2.7 + UCLIBC_VERSION: klee_uclibc_v1.2 + USE_TCMALLOC: 1 + USE_LIBCXX: 1 + Z3_VERSION: 4.8.4 + +jobs: + Linux: + runs-on: ubuntu-latest + strategy: + matrix: + name: [ + "LLVM 10", + "LLVM 9", + "LLVM 8", + "LLVM 7", + "LLVM 6", + "LLVM 5", + "LLVM 4", + "LLVM 3.9", + "LLVM 3.8", + "ASan", + "UBSan", + "MSan", + "Z3 only", + "metaSMT STP", + "metaSMT Boolector", + "STP master", + "Latest klee-uclibc", + "Asserts enabled", + "No TCMalloc, optimised runtime", + ] + include: + - name: "LLVM 10" + env: + LLVM_VERSION: 10 + - name: "LLVM 9" + env: + LLVM_VERSION: 9 + - name: "LLVM 8" + env: + LLVM_VERSION: 8 + - name: "LLVM 7" + env: + LLVM_VERSION: 7 + - name: "LLVM 6" + env: + LLVM_VERSION: 6 + - name: "LLVM 5" + env: + LLVM_VERSION: 5 + - name: "LLVM 4" + env: + LLVM_VERSION: 4 + - name: "LLVM 3.9" + env: + LLVM_VERSION: 3.9 + - name: "LLVM 3.8" + env: + LLVM_VERSION: 3.8 + USE_LIBCXX: 0 + # Sanitizer builds. Do unoptimized build otherwise the optimizer might remove problematic code + - name: "ASan" + env: + SANITIZER_BUILD: address + ENABLE_OPTIMIZED: 0 + USE_TCMALLOC: 0 + - name: "UBSan" + env: + SANITIZER_BUILD: undefined + ENABLE_OPTIMIZED: 0 + USE_TCMALLOC: 0 + - name: "MSan" + env: + SANITIZER_BUILD: memory + ENABLE_OPTIMIZED: 0 + USE_TCMALLOC: 0 + SOLVERS: STP + # Test just using Z3 only + - name: "Z3 only" + env: + SOLVERS: Z3 + # Test just using metaSMT + - name: "metaSMT STP" + env: + SOLVERS: metaSMT + METASMT_DEFAULT: STP + REQUIRES_RTTI: 1 + - name: "metaSMT Boolector" + env: + SOLVERS: metaSMT + METASMT_DEFAULT: BTOR + REQUIRES_RTTI: 1 + # Test we can build against STP master + - name: "STP master" + env: + SOLVERS: STP + STP_VERSION: master + # Check we can build latest klee-uclibc branch + - name: "Latest klee-uclibc" + env: + UCLIBC_VERSION: klee_0_9_29 + # Check at least one build with Asserts disabled. + - name: "Asserts enabled" + env: + SOLVERS: STP + DISABLE_ASSERTIONS: 1 + # Check without TCMALLOC and with an optimised runtime library + - name: "No TCMalloc, optimised runtime" + env: + USE_TCMALLOC: 0 + KLEE_RUNTIME_BUILD: "Release+Debug+Asserts" + steps: + - name: Checkout KLEE source code + uses: actions/checkout@v2 + - name: Build KLEE + env: ${{ matrix.env }} + run: scripts/build/build.sh klee --docker --create-final-image + - name: Run tests + run: sudo scripts/build/run-tests.sh --run-docker --debug + + macOS: + runs-on: macos-latest + env: + BASE: /tmp + SOLVERS: STP + UCLIBC_VERSION: 0 + USE_TCMALLOC: 0 + USE_LIBCXX: 0 + steps: + - name: Install newer version of Bash + run: brew install bash + - name: Checkout KLEE source code + uses: actions/checkout@v2 + - name: Build KLEE + run: scripts/build/build.sh klee --debug --install-system-deps + - name: Run tests + run: scripts/build/run-tests.sh /tmp/klee_build* --debug + + Docker: + runs-on: ubuntu-latest + steps: + - name: Checkout KLEE Code + uses: actions/checkout@v2 + - name: Build Docker image + run: docker build . + + Coverage: + runs-on: ubuntu-latest + env: + ENABLE_OPTIMIZED: 0 + COVERAGE: 1 + steps: + - name: Checkout KLEE source code + uses: actions/checkout@v2 + - name: Build KLEE + run: scripts/build/build.sh klee --docker --create-final-image + - name: Run tests + run: sudo scripts/build/run-tests.sh --coverage --upload-coverage --run-docker --debug \ No newline at end of file diff --git a/README.md b/README.md index d1b18c57..bbadb242 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,7 @@ KLEE Symbolic Virtual Machine ============================= [![Build Status](https://travis-ci.com/klee/klee.svg?branch=master)](https://travis-ci.com/klee/klee) +[![Build Status](https://github.com/klee/klee/workflows/CI/badge.svg)](https://github.com/klee/klee/actions?query=workflow%3ACI) [![Build Status](https://api.cirrus-ci.com/github/klee/klee.svg)](https://cirrus-ci.com/github/klee/klee) [![Coverage](https://codecov.io/gh/klee/klee/branch/master/graph/badge.svg)](https://codecov.io/gh/klee/klee) diff --git a/scripts/build/v-clang.inc b/scripts/build/v-clang.inc index 29dce9cb..c6a2cf58 100644 --- a/scripts/build/v-clang.inc +++ b/scripts/build/v-clang.inc @@ -5,7 +5,20 @@ required_variables_clang=( artifact_dependency_clang=("") setup_variables_clang() { - LLVM_VERSION_SHORT="${LLVM_VERSION/./}" + local v_a + v_a=(${LLVM_VERSION//./ }) + + LLVM_VERSION_MAJOR="0" + LLVM_VERSION_MINOR="0" + + if [[ "${#v_a[@]}" -ge 1 ]]; then + LLVM_VERSION_MAJOR="${v_a[0]}" + fi + if [[ "${#v_a[@]}" -ge 2 ]]; then + LLVM_VERSION_MINOR="${v_a[1]}" + fi + + LLVM_VERSION_SHORT="${LLVM_VERSION_MAJOR}${LLVM_VERSION_MINOR}" } export_variables_clang=( diff --git a/scripts/build/v-llvm.inc b/scripts/build/v-llvm.inc index 9d84f6c2..7c3ade0a 100644 --- a/scripts/build/v-llvm.inc +++ b/scripts/build/v-llvm.inc @@ -27,7 +27,6 @@ setup_variables_llvm() { LLVM_VERSION_MAJOR="0" LLVM_VERSION_MINOR="0" - LLVM_VERSION_PATCH="0" if [[ "${#v_a[@]}" -ge 1 ]]; then LLVM_VERSION_MAJOR="${v_a[0]}" @@ -35,9 +34,6 @@ setup_variables_llvm() { if [[ "${#v_a[@]}" -ge 2 ]]; then LLVM_VERSION_MINOR="${v_a[1]}" fi - if [[ "${#v_a[@]}" -ge 3 ]]; then - LLVM_VERSION_PATCH="${v_a[2]}" - fi LLVM_VERSION_SHORT="${LLVM_VERSION_MAJOR}${LLVM_VERSION_MINOR}" } |