-
Notifications
You must be signed in to change notification settings - Fork 4
163 lines (152 loc) · 5.1 KB
/
github-build.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
# Copyright Glen Knowles 2021 - 2024.
# Distributed under the Boost Software License, Version 1.0.
#
# github-build.yml
name: build
on:
push:
branches: [ master, dev ]
pull_request:
branches: [ master, dev ]
workflow_dispatch: {}
jobs:
build-win:
strategy:
fail-fast: false
matrix:
platform: [Win32, x64]
configuration: [Debug, Release]
toolset: [v140, v141, v142, v143]
include:
- toolset: v140
image: windows-2019
- toolset: v141
image: windows-2019
- toolset: v142
image: windows-2019
- toolset: v143
image: windows-2022
runs-on: ${{matrix.image}}
defaults:
run:
shell: cmd
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: true
- name: Build
working-directory: ${{github.workspace}}
run: |
md build
cd build
if "${{matrix.toolset}}" == "v143" (
set generator=Visual Studio 17 2022
) else (
set generator=Visual Studio 16 2019
)
cmake .. -G "%generator%" -A ${{matrix.platform}} -T ${{matrix.toolset}}
cmake . -DCMAKE_BUILD_TYPE=${{matrix.configuration}}^
-DCMAKE_INSTALL_PREFIX=publish -DINSTALL_LIBS:BOOL=ON
cmake --build . --target install --config ${{matrix.configuration}}
cd publish
:: 7z a dimcli-latest.zip include lib
- name: Test
working-directory: ${{github.workspace}}
run: '"bin/cli" --test'
build-unix:
strategy:
fail-fast: false
matrix:
configuration: [Debug, Release]
env:
- CXX=clang++-6.0 CC=clang-6.0 INSTALL_LLVM_BIONIC=6.0
- CXX=clang++-9 CC=clang-9 INSTALL_LLVM=9
- CXX=clang++-10 CC=clang-10
- CXX=clang++-11 CC=clang-11
- CXX=clang++-12 CC=clang-12 INSTALL_LLVM=12
- CXX=clang++-13 CC=clang-13 INSTALL_LLVM=13
- CXX=clang++-14 CC=clang-14 INSTALL_LLVM=14
- CXX=clang++-15 CC=clang-15 INSTALL_LLVM=15
- CXX=clang++-16 CC=clang-16 INSTALL_LLVM=16
- CXX=clang++-17 CC=clang-17 INSTALL_LLVM=17
- CXX=g++-7 CC=gcc-7 INSTALL_APT=7
- CXX=g++-8 CC=gcc-8 INSTALL_APT=8
- CXX=g++-9 CC=gcc-9
- CXX=g++-10 CC=gcc-10
- CXX=g++-11 CC=gcc-11
- CXX=g++-12 CC=gcc-12
- CXX=g++-13 CC=gcc-13 INSTALL_APT=13
include:
- env: CXX=g++-10 CC=gcc-10 GCOV=gcov-10 BUILD_COVERAGE=ON
image: ubuntu-22.04
configuration: Debug
coverage: true
- image: ubuntu-22.04
- env: CXX=clang++-6.0 CC=clang-6.0 INSTALL_LLVM_BIONIC=6.0
image: ubuntu-20.04
- env: CXX=clang++-9 CC=clang-9 INSTALL_LLVM=9
image: ubuntu-20.04
- env: CXX=clang++-10 CC=clang-10
image: ubuntu-20.04
- env: CXX=clang++-11 CC=clang-11
image: ubuntu-20.04
- env: CXX=clang++-12 CC=clang-12 INSTALL_LLVM=12
image: ubuntu-20.04
- env: CXX=clang++-13 CC=clang-13 INSTALL_LLVM=13
image: ubuntu-20.04
- env: CXX=clang++-14 CC=clang-14 INSTALL_LLVM=14
image: ubuntu-20.04
- env: CXX=clang++-15 CC=clang-15 INSTALL_LLVM=15
image: ubuntu-20.04
- env: CXX=g++-7 CC=gcc-7 INSTALL_APT=7
image: ubuntu-20.04
- env: CXX=g++-8 CC=gcc-8 INSTALL_APT=8
image: ubuntu-20.04
runs-on: ${{matrix.image}}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: true
- name: Install
run: |
export ${{matrix.env}}
if [ -n "$INSTALL_LLVM_BIONIC" ]; then
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | \
sudo apt-key add -
sudo add-apt-repository "deb http://apt.llvm.org/bionic/ \
llvm-toolchain-bionic-$INSTALL_LLVM_BIONIC main"
export INSTALL_APT=${INSTALL_LLVM_BIONIC}
fi
if [ -n "$INSTALL_LLVM" ]; then
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh $INSTALL_LLVM
elif [ -n "$INSTALL_APT" ]; then
sudo apt-get update
sudo apt-get install software-properties-common
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install -y ${CC} ${CXX} ${{matrix.apt-get}}
fi
- name: Build
working-directory: ${{github.workspace}}
run: |
export ${{matrix.env}}
mkdir -p build && cd build
cmake .. -DBUILD_COVERAGE:BOOL=${BUILD_COVERAGE}
cmake --build . --config ${{matrix.configuration}}
- name: Test
working-directory: ${{github.workspace}}
run: |
export ${{matrix.env}}
export LANG=en_US.UTF-8
export COLUMNS=80
bin/cli --test
- name: Report Coverage
if: matrix.coverage
uses: codecov/codecov-action@v4
with:
token: ${{secrets.CODECOV_TOKEN}}
fail_ci_if_error: true