Skip to content

Commit 1d1feeb

Browse files
committed
Test github actions
1 parent 9567940 commit 1d1feeb

File tree

5 files changed

+174
-0
lines changed

5 files changed

+174
-0
lines changed

.github/workflows/clang.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: Clang builds
2+
3+
on: [push]
4+
5+
jobs:
6+
test_clang:
7+
strategy:
8+
fail-fast: false
9+
matrix:
10+
name:
11+
- ubuntu18.04-gcc5
12+
- ubuntu18.04-clang8
13+
- ubuntu18.04-clang8
14+
- win2019-clang
15+
- macos10.14-xcode11
16+
include:
17+
- name: ubuntu18.04-gcc5
18+
os: ubuntu-18.04
19+
compiler: gcc
20+
compiler-version: 5
21+
- name: ubuntu18.04-clang8
22+
os: ubuntu-18.04
23+
compiler: clang
24+
compiler-version: 8
25+
- name: win2019-clang
26+
os: windows-2019
27+
compiler: clang
28+
compiler-version: latest
29+
- name: macos10.14-xcode11
30+
os: macos-10.14
31+
compiler: xcode
32+
compiler-version: 11
33+
name: ${{ matrix.name }}
34+
runs-on: ${{ matrix.os }}
35+
steps:
36+
- uses: actions/checkout@v1
37+
with:
38+
fetch-depth: 1
39+
- name: Install deps
40+
shell: bash
41+
run: .github/workflows/utils/install_deps.sh ${{ runner.os }} ${{ matrix.compiler }} ${{ matrix.compiler-version }}
42+
- if: runner.os == 'Linux'
43+
run: echo "::set-env name=extra_cmake_args::-DLLVM_USE_LINKER=gold"
44+
- name: configure
45+
shell: bash
46+
run: |
47+
mkdir build
48+
cd build
49+
cmake -GNinja \
50+
-DLLVM_ENABLE_PROJECTS="clang;clang-tools-extra" \
51+
-DCMAKE_BUILD_TYPE=Release \
52+
-DLLVM_ENABLE_ASSERTIONS:BOOL=ON \
53+
${extra_cmake_args:-} \
54+
../llvm
55+
- name: build
56+
run: ninja -C build
57+
- name: test
58+
run: ninja -C build check
59+
- name: test-clang
60+
run: ninja -C build check-clang

.github/workflows/libcxx.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: LibCXX builds
2+
3+
on: [push]
4+
5+
jobs:
6+
test_libcxx:
7+
strategy:
8+
fail-fast: false
9+
matrix:
10+
name:
11+
- ubuntu18.04-clang8-cxx03
12+
- ubuntu18.04-clang8-cxx11
13+
- macos10.14-xcode11-cxx11
14+
include:
15+
- name: ubuntu18.04-clang8-cxx03
16+
os: ubuntu-18.04
17+
compiler: clang
18+
compiler-version: 8
19+
cxx-std: c++03
20+
- name: ubuntu18.04-clang8-cxx11
21+
os: ubuntu-18.04
22+
compiler: clang
23+
compiler-version: 8
24+
cxx-std: c++11
25+
- name: macos10.14-xcode11-cxx11
26+
os: macos-10.14
27+
compiler: xcode
28+
compiler-version: 11
29+
cxx-std: c++11
30+
name: ${{ matrix.name }}
31+
runs-on: ${{ matrix.os }}
32+
steps:
33+
- uses: actions/checkout@v1
34+
with:
35+
fetch-depth: 1
36+
- name: Install deps
37+
shell: bash
38+
run: .github/workflows/utils/install_deps.sh ${{ runner.os }} ${{ matrix.compiler }} ${{ matrix.compiler-version }}
39+
- name: configure
40+
shell: bash
41+
run: |
42+
echo $PATH
43+
mkdir build
44+
cd build
45+
cmake -GNinja \
46+
-DLLVM_ENABLE_PROJECTS="libcxx;libcxxabi;libunwind" \
47+
-DLLVM_LIT_ARGS="-sv --show-unsupported --show-xfail --param=std=${{ matrix.cxx-std }}" \
48+
../llvm
49+
- name: build libcxxabi
50+
run: ninja -C build cxxabi
51+
- name: build libcxxabi
52+
run: ninja -C build cxx
53+
- name: test libcxxabi
54+
run: ninja -C build check-libcxxabi
55+
- name: test libcxx
56+
run: ninja -C build check-libcxx
57+
# - name: test abilist
58+
# run: ninja -C build check-cxx-abilist
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#!/bin/bash
2+
set -e
3+
set -u
4+
5+
os_kind=$1
6+
compiler=$2
7+
compiler_version=$3
8+
9+
if [[ $os_kind == 'Linux' ]]; then
10+
if [[ $compiler = gcc ]]; then
11+
compiler_pkg="g++-${compiler_version}"
12+
compiler_cxx="g++"
13+
elif [[ $compiler = clang ]]; then
14+
compiler_pkg="${compiler}-${compiler_version}"
15+
compiler_cxx="clang++"
16+
fi
17+
sudo apt-get install -y ninja-build "${compiler_pkg}"
18+
echo "::set-env name=CC::${compiler}-${compiler_version}"
19+
echo "::set-env name=CXX::${compiler_cxx}-${compiler_version}"
20+
21+
elif [[ $os_kind == 'macOS' ]]; then
22+
brew install ninja
23+
sudo xcode-select -switch "/Applications/Xcode_${compiler_version}.app"
24+
echo "::set-env name=CC::clang"
25+
echo "::set-env name=CXX::clang++"
26+
elif [[ $os_kind == 'Windows' ]]; then
27+
powershell.exe -command "& .github\workflows\utils\install_deps_windows.ps1"
28+
fi
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Powershell script
2+
3+
iex (new-object net.webclient).downloadstring('https://get.scoop.sh')
4+
scoop install ninja
5+
scoop install llvm
6+
7+
.\.github\workflows\utils\vs_setup.bat -arch=amd64
8+
9+
# Remove link.exe from git-bash, as it conflicts with msvc link.exe...
10+
del c:\PROGRA~1\Git\usr\bin\link.exe
11+
12+
echo "::set-env name=CC::clang-cl"
13+
echo "::set-env name=CXX::clang-cl"

.github/workflows/utils/vs_setup.bat

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
@echo off
2+
setlocal
3+
4+
:: From https://github.com/microsoft/vswhere/wiki/Find-VC
5+
for /f "usebackq tokens=*" %%i in (`"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -latest -property installationPath`) do (
6+
set InstallDir=%%i
7+
)
8+
9+
:: Setup environment
10+
call "%InstallDir%\Common7\Tools\vsdevcmd.bat" %*
11+
12+
:: Echo all env vars as github runner commands, so they persist for subsequent steps.
13+
for /f "tokens=1,2 delims==" %%a in ('set') do (
14+
echo ::set-env name=%%a::%%b
15+
)

0 commit comments

Comments
 (0)