From 257c7f2873d21f3ca692412c7d434e258bd2fe66 Mon Sep 17 00:00:00 2001 From: Aurelien Francillon Date: Tue, 9 Apr 2024 20:22:52 +0200 Subject: [PATCH] adding basic CI tests --- .github/workflows/check_style.yml | 19 ++++++++ .github/workflows/run_tests.yml | 74 +++++++++++++++++++++++++++++++ 2 files changed, 93 insertions(+) create mode 100644 .github/workflows/check_style.yml create mode 100644 .github/workflows/run_tests.yml diff --git a/.github/workflows/check_style.yml b/.github/workflows/check_style.yml new file mode 100644 index 0000000..f358038 --- /dev/null +++ b/.github/workflows/check_style.yml @@ -0,0 +1,19 @@ +name: Check coding style +on: [pull_request] +jobs: + coding_style: + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + - name: Run clang-format + shell: bash + run: | + format_changes=$(git clang-format-14 --quiet --diff \ + ${{ github.event.pull_request.base.sha }} \ + ${{ github.event.pull_request.head.sha }} | wc -c) + if [[ $format_changes -ne 0 ]]; then + echo "Please format your changes with clang-format using the LLVM style, e.g., git clang-format --style LLVM before committing" + exit 1 + fi diff --git a/.github/workflows/run_tests.yml b/.github/workflows/run_tests.yml new file mode 100644 index 0000000..7418a5f --- /dev/null +++ b/.github/workflows/run_tests.yml @@ -0,0 +1,74 @@ +name: Compile SymCC RT +on: [pull_request, workflow_dispatch] +jobs: + build_symcc: + runs-on: ubuntu-22.04 + strategy: + matrix: + llvm_version: [11, 12, 13, 14, 15] + steps: + - uses: actions/checkout@v3 + with: + submodules: true + - name: Install dependencies + run: | + sudo apt-get update + sudo apt-get install -y \ + llvm-${{ matrix.llvm_version }}-dev \ + libz3-dev \ + - name: Build SymCC with the QSYM backend + run: | + mkdir build + cd build + cmake -G Ninja \ + -DCMAKE_BUILD_TYPE=Release \ + -DZ3_TRUST_SYSTEM_VERSION=ON \ + -DSYMCC_RT_BACKEND=qsym \ + -DLLVM_DIR=/usr/lib/llvm-${{ matrix.llvm_version }}/cmake \ + .. + ninja + - name: Build SymCC with the simple backend + run: | + mkdir build + cd build + cmake -G Ninja\ + -DCMAKE_BUILD_TYPE=Release \ + -DZ3_TRUST_SYSTEM_VERSION=ON \ + -DSYMCC_RT_BACKEND=qsym \ + -DLLVM_DIR=/usr/lib/llvm-${{ matrix.llvm_version }}/cmake \ + .. + ninja + llvm_compatibility_latest_llvm: + runs-on: ubuntu-22.04 + strategy: + matrix: + llvm_version: [16, 17] + steps: + - uses: actions/checkout@v3 + with: + submodules: true + - name: Add LLVM project deb repository + uses: myci-actions/add-deb-repo@11 + with: + repo: deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-${{ matrix.llvm_version }} main + repo-name: llvm + update: false + keys-asc: https://apt.llvm.org/llvm-snapshot.gpg.key + - name: Install dependencies + run: | + sudo apt-get update + sudo apt-get install -y \ + llvm-${{ matrix.llvm_version }}-dev \ + libz3-dev \ + - name: Build SymCC with the QSYM backend + run: | + mkdir build + cd build + cmake -G Ninja \ + -DCMAKE_BUILD_TYPE=Release \ + -DZ3_TRUST_SYSTEM_VERSION=ON \ + -DQSYM_BACKEND=ON \ + -DLLVM_DIR=/usr/lib/llvm-${{ matrix.llvm_version }}/cmake \ + .. + ninja +