Skip to content

Test github actions #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 60 additions & 0 deletions .github/workflows/clang.yml
Original file line number Diff line number Diff line change
@@ -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
58 changes: 58 additions & 0 deletions .github/workflows/libcxx.yml
Original file line number Diff line number Diff line change
@@ -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
28 changes: 28 additions & 0 deletions .github/workflows/utils/install_deps.sh
Original file line number Diff line number Diff line change
@@ -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
13 changes: 13 additions & 0 deletions .github/workflows/utils/install_deps_windows.ps1
Original file line number Diff line number Diff line change
@@ -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"
15 changes: 15 additions & 0 deletions .github/workflows/utils/vs_setup.bat
Original file line number Diff line number Diff line change
@@ -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
)