diff --git a/.github/workflows/clang.yml b/.github/workflows/clang.yml new file mode 100644 index 000000000000..22f03df2969a --- /dev/null +++ b/.github/workflows/clang.yml @@ -0,0 +1,60 @@ +name: Clang builds + +on: [push] + +jobs: + test_clang: + strategy: + fail-fast: false + matrix: + name: + - ubuntu18.04-gcc5 + - ubuntu18.04-clang8 + - ubuntu18.04-clang8 + - win2019-clang + - macos10.14-xcode11 + include: + - name: ubuntu18.04-gcc5 + os: ubuntu-18.04 + compiler: gcc + compiler-version: 5 + - name: ubuntu18.04-clang8 + os: ubuntu-18.04 + compiler: clang + compiler-version: 8 + - name: win2019-clang + os: windows-2019 + compiler: clang + compiler-version: latest + - name: macos10.14-xcode11 + os: macos-10.14 + compiler: xcode + compiler-version: 11 + name: ${{ matrix.name }} + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v1 + with: + fetch-depth: 1 + - name: Install deps + shell: bash + run: .github/workflows/utils/install_deps.sh ${{ runner.os }} ${{ matrix.compiler }} ${{ matrix.compiler-version }} + - if: runner.os == 'Linux' + run: echo "::set-env name=extra_cmake_args::-DLLVM_USE_LINKER=gold" + - name: configure + shell: bash + run: | + mkdir build + cd build + cmake -GNinja \ + -DLLVM_ENABLE_PROJECTS="clang;clang-tools-extra" \ + -DCMAKE_BUILD_TYPE=Release \ + -DLLVM_ENABLE_ASSERTIONS:BOOL=ON \ + ${extra_cmake_args:-} \ + ../llvm + - name: build + run: ninja -C build + - name: test + run: ninja -C build check + - name: test-clang + run: ninja -C build check-clang diff --git a/.github/workflows/libcxx.yml b/.github/workflows/libcxx.yml new file mode 100644 index 000000000000..cece2849f182 --- /dev/null +++ b/.github/workflows/libcxx.yml @@ -0,0 +1,58 @@ +name: LibCXX builds + +on: [push] + +jobs: + test_libcxx: + strategy: + fail-fast: false + matrix: + name: + - ubuntu18.04-clang8-cxx03 + - ubuntu18.04-clang8-cxx11 + - macos10.14-xcode11-cxx11 + include: + - name: ubuntu18.04-clang8-cxx03 + os: ubuntu-18.04 + compiler: clang + compiler-version: 8 + cxx-std: c++03 + - name: ubuntu18.04-clang8-cxx11 + os: ubuntu-18.04 + compiler: clang + compiler-version: 8 + cxx-std: c++11 + - name: macos10.14-xcode11-cxx11 + os: macos-10.14 + compiler: xcode + compiler-version: 11 + cxx-std: c++11 + name: ${{ matrix.name }} + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v1 + with: + fetch-depth: 1 + - name: Install deps + shell: bash + run: .github/workflows/utils/install_deps.sh ${{ runner.os }} ${{ matrix.compiler }} ${{ matrix.compiler-version }} + - name: configure + shell: bash + run: | + echo $PATH + mkdir build + cd build + cmake -GNinja \ + -DLLVM_ENABLE_PROJECTS="libcxx;libcxxabi;libunwind" \ + -DLLVM_LIT_ARGS="-sv --show-unsupported --show-xfail --param=std=${{ matrix.cxx-std }}" \ + ../llvm + - name: build libcxxabi + run: ninja -C build cxxabi + - name: build libcxxabi + run: ninja -C build cxx + - name: test libcxxabi + run: ninja -C build check-libcxxabi + - name: test libcxx + run: ninja -C build check-libcxx +# - name: test abilist +# run: ninja -C build check-cxx-abilist diff --git a/.github/workflows/utils/install_deps.sh b/.github/workflows/utils/install_deps.sh new file mode 100755 index 000000000000..b4bb0c7f7114 --- /dev/null +++ b/.github/workflows/utils/install_deps.sh @@ -0,0 +1,28 @@ +#!/bin/bash +set -e +set -u + +os_kind=$1 +compiler=$2 +compiler_version=$3 + +if [[ $os_kind == 'Linux' ]]; then + if [[ $compiler = gcc ]]; then + compiler_pkg="g++-${compiler_version}" + compiler_cxx="g++" + elif [[ $compiler = clang ]]; then + compiler_pkg="${compiler}-${compiler_version}" + compiler_cxx="clang++" + fi + sudo apt-get install -y ninja-build "${compiler_pkg}" + echo "::set-env name=CC::${compiler}-${compiler_version}" + echo "::set-env name=CXX::${compiler_cxx}-${compiler_version}" + +elif [[ $os_kind == 'macOS' ]]; then + brew install ninja + sudo xcode-select -switch "/Applications/Xcode_${compiler_version}.app" + echo "::set-env name=CC::clang" + echo "::set-env name=CXX::clang++" +elif [[ $os_kind == 'Windows' ]]; then + powershell.exe -command "& .github\workflows\utils\install_deps_windows.ps1" +fi diff --git a/.github/workflows/utils/install_deps_windows.ps1 b/.github/workflows/utils/install_deps_windows.ps1 new file mode 100644 index 000000000000..1671ca109108 --- /dev/null +++ b/.github/workflows/utils/install_deps_windows.ps1 @@ -0,0 +1,13 @@ +# Powershell script + +iex (new-object net.webclient).downloadstring('https://get.scoop.sh') +scoop install ninja +scoop install llvm + +.\.github\workflows\utils\vs_setup.bat -arch=amd64 + +# Remove link.exe from git-bash, as it conflicts with msvc link.exe... +del c:\PROGRA~1\Git\usr\bin\link.exe + +echo "::set-env name=CC::clang-cl" +echo "::set-env name=CXX::clang-cl" diff --git a/.github/workflows/utils/vs_setup.bat b/.github/workflows/utils/vs_setup.bat new file mode 100755 index 000000000000..750ce69561fa --- /dev/null +++ b/.github/workflows/utils/vs_setup.bat @@ -0,0 +1,15 @@ +@echo off +setlocal + +:: From https://github.com/microsoft/vswhere/wiki/Find-VC +for /f "usebackq tokens=*" %%i in (`"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -latest -property installationPath`) do ( + set InstallDir=%%i +) + +:: Setup environment +call "%InstallDir%\Common7\Tools\vsdevcmd.bat" %* + +:: Echo all env vars as github runner commands, so they persist for subsequent steps. +for /f "tokens=1,2 delims==" %%a in ('set') do ( + echo ::set-env name=%%a::%%b +)