-
Notifications
You must be signed in to change notification settings - Fork 3
186 lines (182 loc) · 6.94 KB
/
cxx_tooling.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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
# Use, modification, and distribution are
# subject to the Boost Software License, Version 1.0. (See accompanying
# file LICENSE.txt)
#
# Copyright René Ferdinand Rivera Morell 2020-2021.
# Configuration for https://help.github.com/en/actions.
name: C++ Tooling
# We limit when to run the builds to specific branches. And also limit to avoid
# building when CI files from other services change.
on:
push:
branches: [ 'master' ]
paths-ignore: [
'.circleci/**',
'.cirrus.yml',
'.drone.star',
'.semaphore/**',
'.travis.yml',
'appveyor.yml',
'azure-pipelines.yml' ]
# We group the jobs based on platform and compiler.
jobs:
# This handles GCC and Clang on Linux platforms (Ubuntu apt based).
linux-gcc-clang:
strategy:
matrix:
include:
- { name: 'GCC 10', cxx: 'g++-10', packages: 'g++-10', os: 'ubuntu-18.04' }
- { name: 'GCC 9', cxx: 'g++-9', packages: 'g++-9', os: 'ubuntu-18.04' }
- { name: 'GCC 8', cxx: 'g++-8', packages: 'g++-8', os: 'ubuntu-18.04' }
- { name: 'GCC 7', cxx: 'g++-7', packages: 'g++-7', os: 'ubuntu-18.04' }
- { name: 'GCC 6', cxx: 'g++-6', packages: 'g++-6', os: 'ubuntu-18.04' }
- { name: 'GCC 5', cxx: 'g++-5', packages: 'g++-5', os: 'ubuntu-18.04' }
- { name: 'Clang 10', cxx: 'clang++-10', packages: 'clang-10', llvm_os: 'bionic', llvm_ver: '10', os: 'ubuntu-18.04' }
- { name: 'Clang 9', cxx: 'clang++-9', packages: 'clang-9', llvm_os: 'bionic', llvm_ver: '9', os: 'ubuntu-18.04' }
- { name: 'Clang 8', cxx: 'clang++-8', packages: 'clang-8', llvm_os: 'bionic', llvm_ver: '8', os: 'ubuntu-18.04' }
- { name: 'Clang 7', cxx: 'clang++-7', packages: 'clang-7', llvm_os: 'bionic', llvm_ver: '7', os: 'ubuntu-18.04' }
- { name: 'Clang 6.0', cxx: 'clang++-6.0', packages: 'clang-6.0', llvm_os: 'bionic', llvm_ver: '6.0', os: 'ubuntu-18.04' }
- { name: 'Clang 5.0', cxx: 'clang++-5.0', packages: 'clang-5.0', llvm_os: 'bionic', llvm_ver: '5.0', os: 'ubuntu-18.04' }
name: Linux ${{ matrix.name }}
runs-on: ${{ matrix.os }}
env:
CXX: ${{ matrix.cxx }}
CXXFLAGS: ${{ matrix.cxxflags }}
PACKAGES: ${{ matrix.packages }}
LLVM_OS: ${{ matrix.llvm_os }}
LLVM_VER: ${{ matrix.llvm_ver }}
steps:
# GitHub actions doesn't checkout your code by default. Instead we need
# to call an external action to do the checkout. We use the 'master'
# branch of that external action to automatically get fixes.
- name: 'Checkout'
uses: actions/checkout@master
with: { submodules: true }
# Two simple steps.. The install runs a helper script to do the install
# and any setup.
- name: 'Install Toolset'
run: |
set -e
uname -a
./.ci_playground/linux-cxx-install.sh
# And the compiler step just calls the compiler as specified in the
# matrix.
- name: 'Compile'
run: |
set -e
${CXX} --version
${CXX} ${CXXFLAGS} -v src/main.cpp
# This handles Xcode on macOS.
xcode:
strategy:
matrix:
include:
- { name: 'Xcode 11.5', cxx: 'clang++', xcode_version: '11.5', os: 'macOS-10.15' }
- { name: 'Xcode 11.4.1', cxx: 'clang++', xcode_version: '11.4.1', os: 'macOS-10.15' }
- { name: 'Xcode 11.3.1', cxx: 'clang++', xcode_version: '11.3.1', os: 'macOS-10.15' }
- { name: 'Xcode 11.2.1', cxx: 'clang++', xcode_version: '11.2.1', os: 'macOS-10.15' }
- { name: 'Xcode 10.3', cxx: 'clang++', xcode_version: '10.3', os: 'macOS-10.15' }
name: macOS ${{ matrix.name }}
runs-on: ${{ matrix.os }}
env:
CXX: ${{ matrix.cxx }}
CXXFLAGS: ${{ matrix.cxxflags }}
XCODE_VERSION: ${{ matrix.xcode_version }}
steps:
- name: 'Checkout'
uses: actions/checkout@master
with: { submodules: true }
- name: 'Install Toolset'
run: |
set -e
uname -a
./.ci_playground/macos-xcode-install.sh
- name: 'Compile'
run: |
set -e
${CXX} --version
${CXX} ${CXXFLAGS} -v --sysroot "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk" src/main.cpp
# These are for Visual Studio on Windows.
windows-vs:
strategy:
matrix:
include:
- name: 'VS 2019'
vswhere_version: '[16.0,17.0)'
cxx: 'cl.exe'
cxxflags: '/Femain'
platform: 'x64'
os: 'windows-2019'
- name: 'VS 2017'
vswhere_version: '[15.0,16.0)'
cxx: 'cl.exe'
cxxflags: '/Femain'
platform: 'x64'
os: 'vs2017-win2016'
defaults: { run: { shell: cmd } }
name: Windows ${{ matrix.name }}
runs-on: ${{ matrix.os }}
env:
CXX: ${{ matrix.cxx }}
CXXFLAGS: ${{ matrix.cxxflags }}
VSWHERE_VERSION: ${{ matrix.vswhere_version }}
VSWHERE_LEGACY: ${{ matrix.vswhere_legacy }}
PLATFORM: ${{ matrix.platform }}
steps:
- name: 'Checkout'
uses: actions/checkout@master
with: { submodules: true }
# Can install VS from a choco package.
- name: 'Install Toolset'
run: |
echo ">>>>>"
echo ">>>>> INSTALL TOOLSET .."
echo ">>>>>"
if not "%CHOCO_VS_PACKAGE%"=="" choco install %CHOCO_VS_PACKAGE% -packageParameters "--AdminFile .ci_playground/%CHOCO_VS_PACKAGE%.xml"
choco install vswhere
# Will setup the environment with vcvarsall.bat and call the compiler.
- name: 'Compile'
run: |
echo ">>>>>"
echo ">>>>> COMPILE, Setup .."
echo ">>>>>"
.ci_playground/windows-msvc-setup.cmd
echo ">>>>>"
echo ">>>>> COMPILE .."
echo ">>>>>"
"%CXX%" %CXXFLAGS% src/main.cpp
# MinGW on Windows toolsets.
windows-mingw:
strategy:
matrix:
# GitHub Actions only comes with one MinGW install.
include:
- name: 'MinGW 8.1'
cxx: 'g++.exe'
os: 'windows-2019'
defaults: { run: { shell: cmd } }
name: Windows ${{ matrix.name }}
runs-on: ${{ matrix.os }}
env:
CXX: ${{ matrix.cxx }}
CXXFLAGS: ${{ matrix.cxxflags }}
steps:
- name: 'Checkout'
uses: actions/checkout@master
with: { submodules: true }
# Currently we only use the pre-installed MinGW. Hence nothing to do.
# This works for MinGW on GitHub Actions because there's only one
# available and it's in the PATH.
- name: 'Install Toolset'
run: |
echo ">>>>>"
echo ">>>>> INSTALL TOOLSET .."
echo ">>>>>"
# The build itself just calls the compiler directly.
- name: 'Compile'
run: |
echo ">>>>>"
echo ">>>>> COMPILE .."
echo ">>>>>"
"%CXX%" --version
"%CXX%" %CXXFLAGS% -v src/main.cpp