[pcode] refactor lifting scripts that use the Ghidra API for testability and maintainability, add tests and test environment, and add them into CI #497
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # | |
| # Copyright (c) 2024, Trail of Bits, Inc. | |
| # | |
| # This source code is licensed in accordance with the terms specified in | |
| # the LICENSE file found in the root directory of this source tree. | |
| # | |
| name: Build | |
| on: | |
| push: | |
| branches: | |
| - 'main' | |
| tags: | |
| - '*' | |
| pull_request: | |
| branches: | |
| - '*' | |
| jobs: | |
| build: | |
| strategy: | |
| matrix: | |
| llvm-version: [20] | |
| image-version: [22.04] | |
| build-type: [Release, Debug] | |
| sanitizers: [OFF] | |
| runs-on: ubuntu-${{ matrix.image-version }} | |
| timeout-minutes: 90 | |
| container: | |
| image: | |
| ghcr.io/lifting-bits/patchestry-ubuntu-${{ matrix.image-version }}-llvm-${{ matrix.llvm-version }}-dev:latest | |
| services: | |
| docker: | |
| image: docker:20.10-dind | |
| options: --privileged | |
| ports: | |
| - 2375:2375 | |
| env: | |
| CMAKE_PREFIX_PATH: "/usr/lib/llvm-${{ matrix.llvm-version }}/lib/cmake/mlir/;/usr/lib/llvm-${{ matrix.llvm-version }}/lib/cmake/clang/" | |
| LLVM_EXTERNAL_LIT: "/usr/local/bin/lit" | |
| ENABLE_SANITIZER_UNDEFINED_BEHAVIOR: ${{ matrix.sanitizers }} | |
| ENABLE_SANITIZER_ADDRESS: ${{ matrix.sanitizers }} | |
| CI: true | |
| steps: | |
| - name: Clean Docker to prevent space issues | |
| run: | | |
| docker system prune -af --volumes || true | |
| - name: Clone the Patchestry repository | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: true | |
| fetch-depth: 1 | |
| - name: Configure build - sanitizers ${{ matrix.sanitizers }} | |
| run: cmake --preset ci -DLLVM_EXTERNAL_LIT=$(which lit) -DLLVM_Z3_INSTALL_DIR=/usr/local | |
| - name: Build ${{ matrix.build-type }} with sanitizers set ${{ matrix.sanitizers }} | |
| run: cmake --build --preset ci --config ${{ matrix.build-type }} -j $(nproc) | |
| - name: Build the headless docker image | |
| run: | | |
| # Free more space before building Docker image | |
| docker system prune -af --volumes || true | |
| bash ./scripts/ghidra/build-headless-docker.sh | |
| - name: Test ${{ matrix.build-type }} with sanitizers set ${{ matrix.sanitizers }} | |
| run: | | |
| lit ./builds/ci/test -D BUILD_TYPE=${{ matrix.build-type }} -v -DCI_OUTPUT_FOLDER=${{ github.workspace }}/builds/ci/test/ghidra/Output |