Skip to content

Commit

Permalink
[workflows] Modify CI scripts to add more test variants
Browse files Browse the repository at this point in the history
Also fix Dockerfile to install missing updates, and use apt instead of apt-get.
Install python-distutils for timeout handling.
  • Loading branch information
pwisniewskimobica authored and bryanpkc committed May 20, 2022
1 parent 4cecd6d commit 198a6b2
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 19 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/Ubuntu20Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@ RUN apt-get install -y software-properties-common && \
apt-get install -f -y llvm-11 clang-11

# Install the tools for release_13x
RUN apt install -y build-essential manpages-dev \
RUN apt --fix-missing update && \
apt install -y build-essential manpages-dev \
libssl-dev zlib1g-dev \
libbz2-dev libreadline-dev libsqlite3-dev libncurses5-dev \
libncursesw5-dev xz-utils tk-dev libffi-dev liblzma-dev python-openssl && \
add-apt-repository ppa:ubuntu-toolchain-r/test && \
apt install -y gcc-11 g++-11 python python3-distutils
apt install -y python3-distutils python3-psutil \
libncursesw5-dev xz-utils tk-dev libffi-dev liblzma-dev python-openssl

RUN cd /opt && \
wget https://github.com/Kitware/CMake/releases/download/v3.20.0/cmake-3.20.0-linux-aarch64.sh && \
Expand Down
27 changes: 14 additions & 13 deletions .github/workflows/llvm-project-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,12 @@ jobs:
lit-tests:
name: Lit Tests
runs-on: ${{ matrix.os }}
env:
install_prefix: /usr/local
strategy:
fail-fast: false
matrix:
target: [X86]
os:
- ubuntu-latest
# Use a specific version of macOS to ensure the CPLUS_INCLUDE_PATH workaround works.
Expand All @@ -49,17 +52,15 @@ jobs:
uses: hendrikmuhs/ccache-action@v1
with:
key: ${{ matrix.os }}
- 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 -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache'
build_target: '${{ inputs.build_target }}'

- name: Build and Test libclc
if: "!startsWith(matrix.os, 'windows') && contains(inputs.projects, 'libclc')"
- name: Test clang macOS
if: ${{ matrix.os == 'macOS-10.15'}}
run: |
./build-llvm-project.sh -t X86 -e "clang" -p /usr/local -s -n $(sysctl -n hw.logicalcpu) -i
cd build
make check-all
- name: Test clang ubuntu
if: ${{ matrix.os == 'ubuntu-latest'}}
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
./build-llvm-project.sh -t X86 -e "${{ inputs.projects }}" -p /usr/local -s -n $(nproc) -i
cd build
make check-all
7 changes: 5 additions & 2 deletions build-llvm-project.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ DO_INSTALL="0"
USE_SUDO="0"
C_COMPILER_PATH="/usr/bin/gcc"
CXX_COMPILER_PATH="/usr/bin/g++"
LLVM_ENABLE_PROJECTS="clang;openmp"

set -e # Exit script on first error.

Expand All @@ -32,8 +33,9 @@ function print_usage {
echo " -s Use sudo to install. Default: 0 - do not use sudo";
echo " -a C compiler path. Default: /usr/bin/gcc";
echo " -b C++ compiler path. Default: /usr/bin/g++";
echo " -e List of the LLVM sub-projects to build. Default: clang;openmp";
}
while getopts "t:p:n:c?i?s?a:b:" opt; do
while getopts "t:p:n:c?i?s?a:b:e:" opt; do
case "$opt" in
t) TARGET=$OPTARG;;
p) INSTALL_PREFIX=$OPTARG;;
Expand All @@ -43,6 +45,7 @@ while getopts "t:p:n:c?i?s?a:b:" opt; do
s) USE_SUDO="1";;
a) C_COMPILER_PATH=$OPTARG;;
b) CXX_COMPILER_PATH=$OPTARG;;
e) LLVM_ENABLE_PROJECTS=$OPTARG;;
?) print_usage; exit 0;;
esac
done
Expand All @@ -66,7 +69,7 @@ fi

# Build and install
mkdir -p build && cd build
cmake $CMAKE_OPTIONS -DLLVM_ENABLE_PROJECTS="clang;openmp" ../llvm
cmake $CMAKE_OPTIONS -DLLVM_ENABLE_PROJECTS=$LLVM_ENABLE_PROJECTS ../llvm
make -j$NPROC
if [ $DO_INSTALL == "1" ]; then
if [ $USE_SUDO == "1" ]; then
Expand Down

0 comments on commit 198a6b2

Please sign in to comment.