Skip to content

Commit

Permalink
workflows: Consolidate tests to reduce the number of build jobs
Browse files Browse the repository at this point in the history
Merge the llvm, clang, and libclc tests into a single job.  This is the
most sub-projects we can test at once without running out of disk space
on the GitHub runners.

Reviewed By: thieta

Differential Revision: https://reviews.llvm.org/D120872
  • Loading branch information
tstellar committed Mar 31, 2022
1 parent bd8dc96 commit 0547ffe
Show file tree
Hide file tree
Showing 6 changed files with 129 additions and 154 deletions.
38 changes: 10 additions & 28 deletions .github/workflows/clang-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@ on:
- '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.
Expand All @@ -21,29 +23,9 @@ concurrency:
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: llvm/llvm-project/.github/workflows/llvm-project-tests.yml@release/14.x
with:
build_target: check-clang
projects: clang;lldb;libclc
51 changes: 12 additions & 39 deletions .github/workflows/libclc-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,56 +5,29 @@ on:
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.
# Cancel intermediate builds: only if it is a pull request build.
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: llvm/llvm-project/.github/workflows/llvm-project-tests.yml@release/14.x
with:
build_target: ''
projects: clang;libclc
38 changes: 10 additions & 28 deletions .github/workflows/lld-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@ on:
- '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.
Expand All @@ -21,29 +23,9 @@ concurrency:
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: llvm/llvm-project/.github/workflows/llvm-project-tests.yml@release/14.x
with:
build_target: check-lld
projects: lld
45 changes: 11 additions & 34 deletions .github/workflows/lldb-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,18 @@ on:
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.
Expand All @@ -25,33 +27,8 @@ concurrency:

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: llvm/llvm-project/.github/workflows/llvm-project-tests.yml@release/14.x
with:
build_target: ''
projects: clang;lldb
62 changes: 62 additions & 0 deletions .github/workflows/llvm-project-tests.yml
Original file line number Diff line number Diff line change
@@ -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
49 changes: 24 additions & 25 deletions .github/workflows/llvm-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@ on:
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.
Expand All @@ -20,31 +22,28 @@ concurrency:


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: llvm/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: llvm/llvm-project/.github/workflows/llvm-project-tests.yml@release/14.x
with:
build_target: ''
projects: clang;lldb

check_lld:
name: Test lld
uses: llvm/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
Expand Down

0 comments on commit 0547ffe

Please sign in to comment.