diff --git a/.github/workflows/clang-tests.yml b/.github/workflows/clang-tests.yml --- a/.github/workflows/clang-tests.yml +++ b/.github/workflows/clang-tests.yml @@ -6,13 +6,15 @@ - 'release/**' paths: - 'clang/**' - - 'llvm/**' - '.github/workflows/clang-tests.yml' + - '.github/workflows/llvm-project-tests.yml' + - '!llvm/**' pull_request: paths: - 'clang/**' - - 'llvm/**' - '.github/workflows/clang-tests.yml' + - '.github/workflows/llvm-project-tests.yml' + - '!llvm/**' concurrency: # Skip intermediate builds: always. @@ -21,29 +23,9 @@ cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }} jobs: - build_clang: - name: clang check-all - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - os: - - ubuntu-latest - - windows-latest - - macOS-latest - steps: - - name: Setup Windows - if: startsWith(matrix.os, 'windows') - uses: llvm/actions/setup-windows@main - with: - arch: amd64 - - name: Install Ninja - uses: llvm/actions/install-ninja@main - - uses: actions/checkout@v1 - with: - fetch-depth: 250 - - name: Test clang - uses: llvm/actions/build-test-llvm-project@main - with: - cmake_args: -G Ninja -DLLVM_ENABLE_PROJECTS="clang" -DCMAKE_BUILD_TYPE=Release - build_target: check-clang + check_clang: + name: Test clang,lldb,libclc + uses: tstellar/llvm-project/.github/workflows/llvm-project-tests.yml@release/14.x + with: + build_target: check-clang + projects: clang;lldb;libclc diff --git a/.github/workflows/libclc-tests.yml b/.github/workflows/libclc-tests.yml --- a/.github/workflows/libclc-tests.yml +++ b/.github/workflows/libclc-tests.yml @@ -5,16 +5,18 @@ branches: - 'release/**' paths: - - 'clang/**' - - 'llvm/**' - 'libclc/**' - '.github/workflows/libclc-tests.yml' + - '.github/workflows/llvm-project-tests.yml' + - '!clang/**' + - '!llvm/**' pull_request: paths: - - 'clang/**' - - 'llvm/**' - 'libclc/**' - '.github/workflows/libclc-tests.yml' + - '.github/workflows/llvm-project-tests.yml' + - '!clang/**' + - '!llvm/**' concurrency: # Skip intermediate builds: always. @@ -22,39 +24,10 @@ group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }} - jobs: - build_libclc: - name: libclc test - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - os: - - ubuntu-latest - # Disable build on windows, because I can't figure out where llvm-config is. - #- windows-latest - - macOS-latest - steps: - - name: Setup Windows - if: startsWith(matrix.os, 'windows') - uses: llvm/actions/setup-windows@main - with: - arch: amd64 - - name: Install Ninja - uses: llvm/actions/install-ninja@main - - uses: actions/checkout@v1 - with: - fetch-depth: 250 - - name: Build clang - uses: llvm/actions/build-test-llvm-project@main - with: - cmake_args: -G Ninja -DLLVM_ENABLE_PROJECTS="clang" -DCMAKE_BUILD_TYPE=Release - build_target: "" - - name: Build and test libclc - # spirv targets require llvm-spirv, so skip building them until we figure out - # how to install this tool. - run: | - 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" - ninja -C libclc-build - ninja -C libclc-build test + check_libclc: + name: Test libclc + uses: tstellar/llvm-project/.github/workflows/llvm-project-tests.yml@release/14.x + with: + build_target: '' + projects: clang;libclc diff --git a/.github/workflows/lld-tests.yml b/.github/workflows/lld-tests.yml --- a/.github/workflows/lld-tests.yml +++ b/.github/workflows/lld-tests.yml @@ -6,13 +6,15 @@ - 'release/**' paths: - 'lld/**' - - 'llvm/**' - '.github/workflows/lld-tests.yml' + - '.github/workflows/llvm-project-tests.yml' + - '!llvm/**' pull_request: paths: - 'lld/**' - - 'llvm/**' - '.github/workflows/lld-tests.yml' + - '.github/workflows/llvm-project-tests.yml' + - '!llvm/**' concurrency: # Skip intermediate builds: always. @@ -21,29 +23,9 @@ cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }} jobs: - build_lld: - name: lld check-all - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - os: - - ubuntu-latest - - windows-latest - - macOS-latest - steps: - - name: Setup Windows - if: startsWith(matrix.os, 'windows') - uses: llvm/actions/setup-windows@main - with: - arch: amd64 - - name: Install Ninja - uses: llvm/actions/install-ninja@main - - uses: actions/checkout@v1 - with: - fetch-depth: 250 - - name: Test lld - uses: llvm/actions/build-test-llvm-project@main - with: - cmake_args: -G Ninja -DLLVM_ENABLE_PROJECTS="lld" -DCMAKE_BUILD_TYPE=Release - build_target: check-lld + check_lld: + name: Test lld + uses: tstellar/llvm-project/.github/workflows/llvm-project-tests.yml@release/14.x + with: + build_target: check-lld + projects: lld diff --git a/.github/workflows/lldb-tests.yml b/.github/workflows/lldb-tests.yml --- a/.github/workflows/lldb-tests.yml +++ b/.github/workflows/lldb-tests.yml @@ -5,16 +5,18 @@ branches: - 'release/**' paths: - - 'clang/**' - - 'llvm/**' - 'lldb/**' - '.github/workflows/lldb-tests.yml' + - '.github/workflows/llvm-project-tests.yml' + - '!clang/**' + - '!llvm/**' pull_request: paths: - - 'clang/**' - - 'llvm/**' - 'lldb/**' - '.github/workflows/lldb-tests.yml' + - '.github/workflows/llvm-project-tests.yml' + - '!clang/**' + - '!llvm/**' concurrency: # Skip intermediate builds: always. @@ -25,33 +27,8 @@ jobs: build_lldb: - name: lldb build - runs-on: ${{ matrix.os }} - # Workaround for build faliure on Mac OS X: llvm.org/PR46190, https://github.com/actions/virtual-environments/issues/2274 - env: - CPLUS_INCLUDE_PATH: /usr/local/opt/llvm/include/c++/v1:/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include - strategy: - fail-fast: false - matrix: - os: - - ubuntu-latest - - windows-latest - - macOS-10.15 - steps: - - name: Setup Windows - if: startsWith(matrix.os, 'windows') - uses: llvm/actions/setup-windows@main - with: - arch: amd64 - - name: Install Ninja - uses: llvm/actions/install-ninja@main - - uses: actions/checkout@v1 - with: - fetch-depth: 250 - - name: Build lldb - uses: llvm/actions/build-test-llvm-project@main - with: - # Mac OS requries that libcxx is enabled for lldb tests, so we need to disable them. - cmake_args: -G Ninja -DLLVM_ENABLE_PROJECTS="clang;lldb" -DCMAKE_BUILD_TYPE=Release -DLLDB_INCLUDE_TESTS=OFF - # check-lldb is not consistent, so we only build lldb. - build_target: "" + name: Build lldb + uses: tstellar/llvm-project/.github/workflows/llvm-project-tests.yml@release/14.x + with: + build_target: '' + projects: clang;lldb diff --git a/.github/workflows/llvm-project-tests.yml b/.github/workflows/llvm-project-tests.yml new file mode 100644 --- /dev/null +++ b/.github/workflows/llvm-project-tests.yml @@ -0,0 +1,62 @@ +name: LLVM Project Tests + +on: + workflow_call: + inputs: + build_target: + required: true + type: string + + projects: + required: true + type: string + +concurrency: + # Skip intermediate builds: always. + # Cancel intermediate builds: only if it is a pull request build. + # If the group name here is the same as the group name in the workflow that includes + # this one, then the action will try to wait on itself and get stuck. + group: llvm-project-${{ github.workflow }}-${{ inputs.projects}}${{ github.ref }} + cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }} + +env: + # Workaround for build faliure on Mac OS X: llvm.org/PR46190, https://github.com/actions/virtual-environments/issues/2274 + CPLUS_INCLUDE_PATH: /usr/local/opt/llvm/include/c++/v1:/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include + +jobs: + lit-tests: + name: Lit Tests + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: + - ubuntu-latest + - windows-latest + # Use a specific version of macOS to ensure the CPLUS_INCLUDE_PATH workaround works. + - macOS-10.15 + steps: + - name: Setup Windows + if: startsWith(matrix.os, 'windows') + uses: llvm/actions/setup-windows@main + with: + arch: amd64 + - name: Install Ninja + uses: llvm/actions/install-ninja@main + - uses: actions/checkout@v1 + with: + fetch-depth: 250 + - name: Build and Test + uses: llvm/actions/build-test-llvm-project@main + with: + cmake_args: '-GNinja -DLLVM_ENABLE_PROJECTS="${{ inputs.projects }}" -DCMAKE_BUILD_TYPE=Release -DLLDB_INCLUDE_TESTS=OFF' + build_target: '${{ inputs.build_target }}' + + - name: Build and Test libclc + if: "!startsWith(matrix.os, 'windows') && contains(inputs.projects, 'libclc')" + run: | + # Make sure all of LLVM libraries that llvm-config needs are built. + ninja -C build + 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" + ninja -C libclc-build + ninja -C libclc-build test diff --git a/.github/workflows/llvm-tests.yml b/.github/workflows/llvm-tests.yml --- a/.github/workflows/llvm-tests.yml +++ b/.github/workflows/llvm-tests.yml @@ -7,10 +7,12 @@ paths: - 'llvm/**' - '.github/workflows/llvm-tests.yml' + - '.github/workflows/llvm-project-tests.yml' pull_request: paths: - 'llvm/**' - '.github/workflows/llvm-tests.yml' + - '.github/workflows/llvm-project-tests.yml' concurrency: # Skip intermediate builds: always. @@ -20,31 +22,28 @@ jobs: - build_llvm: - name: llvm check-all - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - os: - - ubuntu-latest - - windows-latest - - macOS-latest - steps: - - name: Setup Windows - if: startsWith(matrix.os, 'windows') - uses: llvm/actions/setup-windows@main - with: - arch: amd64 - - name: Install Ninja - uses: llvm/actions/install-ninja@main - - uses: actions/checkout@v1 - with: - fetch-depth: 250 - - name: Test llvm - uses: llvm/actions/build-test-llvm-project@main - with: - cmake_args: -G Ninja -DCMAKE_BUILD_TYPE=Release + check_all: + name: Test llvm,clang,libclc + uses: tstellar/llvm-project/.github/workflows/llvm-project-tests.yml@release/14.x + with: + build_target: check-all + projects: clang;libclc + + # These need to be separate from the check_all job, becuase there is not enough disk + # space to build all these projects on Windows. + build_lldb: + name: Build lldb + uses: tstellar/llvm-project/.github/workflows/llvm-project-tests.yml@release/14.x + with: + build_target: '' + projects: clang;lldb + + check_lld: + name: Test lld + uses: tstellar/llvm-project/.github/workflows/llvm-project-tests.yml@release/14.x + with: + build_target: check-lld + projects: lld abi-dump-setup: runs-on: ubuntu-latest