[IRBuilder] Refactor FMF interface (#121657)
[llvm-project.git] / .github / workflows / premerge.yaml
blob7a9762812cc18c63afce78d54b04f1ddc2f3d788
1 name: LLVM Premerge Checks
3 permissions:
4   contents: read
6 on:
7   pull_request:
8     paths:
9       - .github/workflows/premerge.yaml
10   push:
11     branches:
12       - 'main'
14 jobs:
15   premerge-checks-linux:
16     if: github.repository_owner == 'llvm'
17     runs-on: llvm-premerge-linux-runners
18     concurrency:
19       group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
20       cancel-in-progress: true
21     container:
22       image: ghcr.io/llvm/ci-ubuntu-22.04:latest
23     defaults:
24       run:
25         shell: bash
26     steps:
27       - name: Checkout LLVM
28         uses: actions/checkout@v4
29         with:
30           fetch-depth: 2
31       - name: Setup ccache
32         uses: hendrikmuhs/ccache-action@v1.2.14
33       - name: Build and Test
34         run: |
35           git config --global --add safe.directory '*'
37           modified_files=$(git diff --name-only HEAD~1...HEAD)
38           modified_dirs=$(echo "$modified_files" | cut -d'/' -f1 | sort -u)
40           echo $modified_files
41           echo $modified_dirs
43           . ./.ci/compute-projects.sh
45           all_projects="bolt clang clang-tools-extra compiler-rt cross-project-tests flang libc libclc lld lldb llvm mlir openmp polly pstl"
46           modified_projects="$(keep-modified-projects ${all_projects})"
48           linux_projects_to_test=$(exclude-linux $(compute-projects-to-test 0 ${modified_projects}))
49           linux_check_targets=$(check-targets ${linux_projects_to_test} | sort | uniq)
50           linux_projects=$(add-dependencies ${linux_projects_to_test} | sort | uniq)
52           linux_runtimes_to_test=$(compute-runtimes-to-test ${linux_projects_to_test})
53           linux_runtime_check_targets=$(check-targets ${linux_runtimes_to_test} | sort | uniq)
54           linux_runtimes=$(echo ${linux_runtimes_to_test} | sort | uniq)
56           if [[ "${linux_projects}" == "" ]]; then
57             echo "No projects to build"
58             exit 0
59           fi
61           echo "Building projects: ${linux_projects}"
62           echo "Running project checks targets: ${linux_check_targets}"
63           echo "Building runtimes: ${linux_runtimes}"
64           echo "Running runtimes checks targets: ${linux_runtime_check_targets}"
66           export CC=/opt/llvm/bin/clang
67           export CXX=/opt/llvm/bin/clang++
69           ./.ci/monolithic-linux.sh "$(echo ${linux_projects} | tr ' ' ';')" "$(echo ${linux_check_targets})" "$(echo ${linux_runtimes} | tr ' ' ';')" "$(echo ${linux_runtime_check_targets})"