@@ -12,28 +12,64 @@ 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
34
54
35
- - name : Install dependencies
36
- run : sudo apt-get install ${{ matrix.install }}
55
+ - name : Install Clang 11
56
+ id : install_clang_11
57
+ if : startsWith(matrix.config.os, 'ubuntu') && ( matrix.config.cxx == 'clang++-11' )
58
+ shell : bash
59
+ working-directory : ${{ env.HOME }}
60
+ run : |
61
+ wget https://apt.llvm.org/llvm.sh
62
+ chmod +x llvm.sh
63
+ sudo ./llvm.sh 11
64
+
65
+ - name : Install g++ 10
66
+ id : install_gcc_10
67
+ if : startsWith(matrix.config.os, 'ubuntu') && ( matrix.config.cxx == 'g++-10' )
68
+ shell : bash
69
+ working-directory : ${{ env.HOME }}
70
+ run : |
71
+ sudo add-apt-repository ppa:ubuntu-toolchain-r/ppa
72
+ sudo apt-get install g++-10
37
73
38
74
- name : Create Build Environment
39
75
# Some projects don't allow in-source building, so create a separate build directory
@@ -45,16 +81,16 @@ jobs:
45
81
# access regardless of the host operating system
46
82
shell : bash
47
83
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.
84
+ env :
85
+ CXX : ${{ matrix.config.cxx }}
86
+ # Note the current convention is to use the -S and -B options here to specify source
87
+ # and build directories, but this is only available with CMake 3.13 and higher.
52
88
# The CMake binaries on the Github Actions machines are (as of this writing) 3.12
53
89
run : |
54
- cmake ${{runner.workspace}} \
90
+ cmake $GITHUB_WORKSPACE \
55
91
-DCMAKE_BUILD_TYPE=$BUILD_TYPE \
56
- -DCMAKE_CXX_FLAGS=${{ matrix.cxx_flags }} \
57
- -DCMAKE_EXE_LINKER_FLAGS=${{ matrix.exe_linker_flags }} \
92
+ -DCMAKE_CXX_FLAGS=${{ matrix.config. cxx_flags }} \
93
+ -DCMAKE_EXE_LINKER_FLAGS=${{ matrix.config. exe_linker_flags }} \
58
94
-DCMAKE_VERBOSE_MAKEFILE=ON
59
95
60
96
- name : Build
0 commit comments