|
| 1 | +# |
| 2 | +# Copyright (c) 2021-present, Trail of Bits, Inc. |
| 3 | +# All rights reserved. |
| 4 | +# |
| 5 | +# This source code is licensed in accordance with the terms specified in |
| 6 | +# the LICENSE file found in the root directory of this source tree. |
| 7 | +# |
| 8 | + |
| 9 | +name: "LLVM test suite" |
| 10 | + |
| 11 | +on: |
| 12 | + workflow_run: |
| 13 | + workflows: ["Pre Release"] |
| 14 | + types: |
| 15 | + - completed |
| 16 | + branches: |
| 17 | + - "master" |
| 18 | + |
| 19 | +jobs: |
| 20 | + test: |
| 21 | + name: "LLVM test suite" |
| 22 | + strategy: |
| 23 | + matrix: |
| 24 | + llvm-version: [17] |
| 25 | + image-version: [22.04] |
| 26 | + vast-target: ['hl', 'llvm', ''] |
| 27 | + |
| 28 | + runs-on: ubuntu-${{ matrix.image-version }} |
| 29 | + if: ${{ github.event.workflow_run.conclusion == 'success' }} |
| 30 | + timeout-minutes: 60 |
| 31 | + container: |
| 32 | + image: |
| 33 | + ghcr.io/trailofbits/vast-ubuntu-${{ matrix.image-version }}-llvm-${{ matrix.llvm-version }}-dev:latest |
| 34 | + |
| 35 | + steps: |
| 36 | + - name: Fetch VAST artifact |
| 37 | + uses: actions/download-artifact@v4 |
| 38 | + with: |
| 39 | + run-id: ${{ github.event.workflow_run.id }} |
| 40 | + |
| 41 | + - name: Unpack VAST |
| 42 | + run: | |
| 43 | + mkdir vast && tar -xf VAST-* -C vast --strip-components=1 |
| 44 | +
|
| 45 | + - name: Export vast-front |
| 46 | + run: | |
| 47 | + echo "${PWD}/vast/bin/" >> $GITHUB_PATH |
| 48 | +
|
| 49 | + - name: Install test suite dependencies |
| 50 | + run: | |
| 51 | + pip3 install lit pandas scipy |
| 52 | +
|
| 53 | + - name: Clone test suite repository |
| 54 | + uses: actions/checkout@v4 |
| 55 | + with: |
| 56 | + repository: Jezurko/llvm-test-suite |
| 57 | + path: llvm-test-suite |
| 58 | + fetch-depth: 1 |
| 59 | + |
| 60 | + - name: Run test-suite |
| 61 | + run: | |
| 62 | + mkdir llvm-test-suite/build && cd llvm-test-suite/build/ |
| 63 | + cmake ../ -DCMAKE_BUILD_TYPE=Release \ |
| 64 | + -DCMAKE_C_COMPILER=$(readlink -f ../tools/compiler) \ |
| 65 | + -DCMAKE_CXX_COMPILER=$(readlink -f ../tools/compiler++) \ |
| 66 | + -C=../cmake/caches/O3.cmake \ |
| 67 | + -DTEST_SUITE_SUBDIRS=SingleSource \ |
| 68 | + -DTEST_SUITE_VAST_ENABLE=ON \ |
| 69 | + -DTEST_SUITE_VAST_TARGET=${{ matrix.vast-target }} |
| 70 | + make -j $(nproc) -k |
| 71 | +
|
| 72 | + - name: Collect run data (mlir) |
| 73 | + if: ${{ matrix.vast-target }} != '' |
| 74 | + run: | |
| 75 | + cd llvm-test-suite/build |
| 76 | + ../utils/mlir_compile_json_gen.py >> ../../results.json |
| 77 | +
|
| 78 | + - name: Collect run data (bin) |
| 79 | + if: ${{ matrix.vast-target }} == '' |
| 80 | + run: | |
| 81 | + cd llvm-test-suite/build |
| 82 | + lit --timeout=60 -v -o ../../results.json |
| 83 | +
|
| 84 | + - name: Upload results |
| 85 | + uses: actions/upload-artifact@v4 |
| 86 | + with: |
| 87 | + files: results.json |
| 88 | + name: results${{ matrix.vast-target}} |
0 commit comments