|
| 1 | +name: LLVM Project Tests |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_call: |
| 5 | + inputs: |
| 6 | + build_target: |
| 7 | + required: true |
| 8 | + type: string |
| 9 | + |
| 10 | + projects: |
| 11 | + required: true |
| 12 | + type: string |
| 13 | + |
| 14 | +concurrency: |
| 15 | + # Skip intermediate builds: always. |
| 16 | + # Cancel intermediate builds: only if it is a pull request build. |
| 17 | + # If the group name here is the same as the group name in the workflow that includes |
| 18 | + # this one, then the action will try to wait on itself and get stuck. |
| 19 | + group: llvm-project-${{ github.workflow }}-${{ inputs.projects}}${{ github.ref }} |
| 20 | + cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }} |
| 21 | + |
| 22 | +env: |
| 23 | + # Workaround for build faliure on Mac OS X: llvm.org/PR46190, https://github.com/actions/virtual-environments/issues/2274 |
| 24 | + CPLUS_INCLUDE_PATH: /usr/local/opt/llvm/include/c++/v1:/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include |
| 25 | + |
| 26 | +jobs: |
| 27 | + lit-tests: |
| 28 | + name: Lit Tests |
| 29 | + runs-on: ${{ matrix.os }} |
| 30 | + strategy: |
| 31 | + fail-fast: false |
| 32 | + matrix: |
| 33 | + os: |
| 34 | + - ubuntu-latest |
| 35 | + - windows-latest |
| 36 | + # Use a specific version of macOS to ensure the CPLUS_INCLUDE_PATH workaround works. |
| 37 | + - macOS-10.15 |
| 38 | + steps: |
| 39 | + - name: Setup Windows |
| 40 | + if: startsWith(matrix.os, 'windows') |
| 41 | + uses: llvm/actions/setup-windows@main |
| 42 | + with: |
| 43 | + arch: amd64 |
| 44 | + - name: Install Ninja |
| 45 | + uses: llvm/actions/install-ninja@main |
| 46 | + - uses: actions/checkout@v1 |
| 47 | + with: |
| 48 | + fetch-depth: 250 |
| 49 | + - name: Build and Test |
| 50 | + uses: llvm/actions/build-test-llvm-project@main |
| 51 | + with: |
| 52 | + cmake_args: '-GNinja -DLLVM_ENABLE_PROJECTS="${{ inputs.projects }}" -DCMAKE_BUILD_TYPE=Release -DLLDB_INCLUDE_TESTS=OFF' |
| 53 | + build_target: '${{ inputs.build_target }}' |
| 54 | + |
| 55 | + - name: Build and Test libclc |
| 56 | + if: "!startsWith(matrix.os, 'windows') && contains(inputs.projects, 'libclc')" |
| 57 | + run: | |
| 58 | + # Make sure all of LLVM libraries that llvm-config needs are built. |
| 59 | + ninja -C build |
| 60 | + cmake -G Ninja -S libclc -B libclc-build -DLLVM_CONFIG=`pwd`/build/bin/llvm-config -DLIBCLC_TARGETS_TO_BUILD="amdgcn--;amdgcn--amdhsa;r600--;nvptx--;nvptx64--;nvptx--nvidiacl;nvptx64--nvidiacl" |
| 61 | + ninja -C libclc-build |
| 62 | + ninja -C libclc-build test |
0 commit comments