@@ -12,28 +12,66 @@ jobs:
12
12
# well on Windows or Mac. You can convert this to a matrix build if you need
13
13
# cross-platform coverage.
14
14
# See: https://docs.github.com/en/actions/configuring-and-managing-workflows/configuring-a-workflow#configuring-a-build-matrix
15
- runs-on : ubuntu-20.04
15
+ name : ${{ matrix.config.name }}
16
+ runs-on : ${{ matrix.config.os }}
16
17
17
18
strategy :
18
19
fail-fast : false
19
20
matrix :
20
- compiler : [g++-10, clang]
21
- include :
22
- - compiler : clang
23
- cxx_flags : -stdlib=libc++
24
- # TODO figure out why this is not set automatically
25
- exe_linker_flags : -lc++
26
- - compiler : g++-10
27
- install : ' g++-10'
21
+ config :
22
+ - {
23
+ name : " Linux g++ 10.2" ,
24
+ os : ubuntu-20.04,
25
+ cxx : " g++-10" ,
26
+ }
27
+ - {
28
+ name : " Linux clang-10" ,
29
+ os : ubuntu-20.04,
30
+ cxx : " clang++-10" ,
31
+ cxx_flags : -stdlib=libc++,
32
+ exe_linker_flags : -lc++,
33
+ }
34
+ - {
35
+ name : " Linux clang-11" ,
36
+ os : ubuntu-20.04,
37
+ cxx : " clang++-11" ,
38
+ cxx_flags : -stdlib=libc++,
39
+ exe_linker_flags : -lc++,
40
+ }
28
41
29
42
steps :
30
43
- uses : actions/checkout@v2
31
44
32
- - name : Install ppa
33
- run : sudo add-apt-repository ppa:ubuntu-toolchain-r/ppa
45
+ - name : Install Clang 10
46
+ id : install_clang_10
47
+ if : startsWith(matrix.config.os, 'ubuntu') && ( matrix.config.cxx == 'clang++-10' )
48
+ shell : bash
49
+ working-directory : ${{ env.HOME }}
50
+ run : |
51
+ wget https://apt.llvm.org/llvm.sh
52
+ chmod +x llvm.sh
53
+ sudo ./llvm.sh 10
54
+ sudo apt-get install libc++-10-dev libc++abi-10-dev
34
55
35
- - name : Install dependencies
36
- run : sudo apt-get install ${{ matrix.install }}
56
+ - name : Install Clang 11
57
+ id : install_clang_11
58
+ if : startsWith(matrix.config.os, 'ubuntu') && ( matrix.config.cxx == 'clang++-11' )
59
+ shell : bash
60
+ working-directory : ${{ env.HOME }}
61
+ run : |
62
+ wget https://apt.llvm.org/llvm.sh
63
+ chmod +x llvm.sh
64
+ sudo ./llvm.sh 11
65
+ sudo apt-get install libc++-11-dev libc++abi-11-dev
66
+
67
+ - name : Install g++ 10
68
+ id : install_gcc_10
69
+ if : startsWith(matrix.config.os, 'ubuntu') && ( matrix.config.cxx == 'g++-10' )
70
+ shell : bash
71
+ working-directory : ${{ env.HOME }}
72
+ run : |
73
+ sudo add-apt-repository ppa:ubuntu-toolchain-r/ppa
74
+ sudo apt-get install g++-10
37
75
38
76
- name : Create Build Environment
39
77
# Some projects don't allow in-source building, so create a separate build directory
@@ -45,16 +83,16 @@ jobs:
45
83
# access regardless of the host operating system
46
84
shell : bash
47
85
working-directory : ${{runner.workspace}}/build
48
- env :
49
- CXX : ${{ matrix.compiler }}
50
- # Note the current convention is to use the -S and -B options here to specify source
51
- # and build directories, but this is only available with CMake 3.13 and higher.
86
+ env :
87
+ CXX : ${{ matrix.config.cxx }}
88
+ # Note the current convention is to use the -S and -B options here to specify source
89
+ # and build directories, but this is only available with CMake 3.13 and higher.
52
90
# The CMake binaries on the Github Actions machines are (as of this writing) 3.12
53
91
run : |
54
- cmake ${{runner.workspace}} \
92
+ cmake $GITHUB_WORKSPACE \
55
93
-DCMAKE_BUILD_TYPE=$BUILD_TYPE \
56
- -DCMAKE_CXX_FLAGS=${{ matrix.cxx_flags }} \
57
- -DCMAKE_EXE_LINKER_FLAGS=${{ matrix.exe_linker_flags }} \
94
+ -DCMAKE_CXX_FLAGS=${{ matrix.config. cxx_flags }} \
95
+ -DCMAKE_EXE_LINKER_FLAGS=${{ matrix.config. exe_linker_flags }} \
58
96
-DCMAKE_VERBOSE_MAKEFILE=ON
59
97
60
98
- name : Build
0 commit comments