-
Notifications
You must be signed in to change notification settings - Fork 0
136 lines (118 loc) · 4.39 KB
/
clang_release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
name: Clang Build Release
on:
push:
branches: [ master, develop ]
pull_request:
branches: [ master, develop ]
jobs:
build:
runs-on: ubuntu-20.04
name: ${{ matrix.config.name }}
env:
CC: ${{ matrix.config.cc }}
CXX: ${{ matrix.config.cxx }}
strategy:
fail-fast: false
matrix:
config:
- {
name: "Clang 9",
cc: "/usr/bin/clang-9",
cxx: "/usr/bin/clang++-9",
}
- {
name: "Clang 10",
cc: "/usr/bin/clang-10",
cxx: "/usr/bin/clang++-10",
}
- {
name: "Clang 11",
cc: "/usr/bin/clang-11",
cxx: "/usr/bin/clang++-11",
}
- {
name: "Clang 12",
cc: "/usr/bin/clang-12",
cxx: "/usr/bin/clang++-12",
}
steps:
- uses: actions/checkout@v2
- name: Set common repository and keys
run: |
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo wget -qO - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
sudo apt-get -qq update
sudo apt install libicu-dev libicu66 libxml2-dev zlib1g-dev
DEPS_DIR="${{ github.workspace }}/DEPS"
mkdir -p ${DEPS_DIR}
- name: Download CMake
run: |
cd ${DEPS_DIR}
CMAKE_URL="https://cmake.org/files/v3.20/cmake-3.20.2-linux-x86_64.tar.gz"
mkdir cmake && wget --no-check-certificate --quiet -O - ${CMAKE_URL} | tar --strip-components=1 -xz -C cmake
export PATH=${DEPS_DIR}/cmake/bin:${PATH}
- name: Install Clang 9
if: contains(matrix.config.cc, 'clang-9')
run: |
sudo add-apt-repository "deb http://apt.llvm.org/focal/ llvm-toolchain-focal-9 main"
sudo apt-get -qq update
sudo apt install clang-9 libstdc++-9-dev
sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-9 100
sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-9 100
- name: Install Clang 10
if: contains(matrix.config.cc, 'clang-10')
run: |
sudo add-apt-repository "deb http://apt.llvm.org/focal/ llvm-toolchain-focal-10 main"
sudo apt-get -qq update
sudo apt install clang-10 libstdc++-10-dev
sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-10 100
sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-10 100
- name: Install Clang 11
if: contains(matrix.config.cc, 'clang-11')
run: |
sudo add-apt-repository "deb http://apt.llvm.org/focal/ llvm-toolchain-focal-11 main"
sudo apt-get -qq update
sudo apt install clang-11 libstdc++-11-dev
sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-11 100
sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-11 100
- name: Install Clang 12
if: contains(matrix.config.cc, 'clang-12')
run: |
sudo add-apt-repository "deb http://apt.llvm.org/focal/ llvm-toolchain-focal-12 main"
sudo apt-get -qq update
sudo apt install clang-12 libstdc++-11-dev
sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-12 100
sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-12 100
- name: Build LLVM
run: |
${CXX} --version
cd ${{ github.workspace }}
sudo chmod +x install_llvm.sh
sudo sh ./install_llvm.sh ${DEPS_DIR}
export PATH=${DEPS_DIR}/llvm:${PATH}
- name: Build Boost
run: |
${CXX} --version
cd ${{ github.workspace }}
sudo chmod +x install_boost.sh
sudo sh ./install_boost.sh ${DEPS_DIR}
export PATH=${DEPS_DIR}/boost:${PATH}
- name: Build GTest
run: |
${CXX} --version
cd ${{ github.workspace }}
sudo chmod +x install_gtest.sh
sudo sh ./install_gtest.sh ${DEPS_DIR}
export PATH=${DEPS_DIR}/gtest:${PATH}
- name: Configure CMake
run: |
cd ${{ github.workspace }}
uname -a
cmake --version
${CXX} --version
cmake -DPDL_WITH_TESTS=1 -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_COMPILER=${{ matrix.config.cxx }} .
- name: Build Project
run: cmake --build . -j "$(nproc)"
- name: Test
working-directory: ${{ github.workspace }}
run: ctest --verbose