-
Notifications
You must be signed in to change notification settings - Fork 594
165 lines (143 loc) · 4.2 KB
/
ci.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
name: ci
on:
workflow_dispatch:
pull_request:
push:
branches:
- master
- develop
paths-ignore:
- '**.md'
- '**.rst'
- '**.sh'
jobs:
build:
name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash
strategy:
fail-fast: false
matrix:
python-version: [3.10]
name: [
windows-2019-cl,
ubuntu-20.04-gcc,
ubuntu-20.04-clang,
ubuntu-22.04-clang,
macOS-11-gcc,
macOS-11-clang,
]
include:
- name: windows-2019-cl
os: windows-2019
compiler: cl
- name: ubuntu-20.04-gcc
os: ubuntu-20.04
compiler: gcc
version: "11"
toxcmd: soname,tests
- name: ubuntu-20.04-clang
os: ubuntu-20.04
compiler: clang
version: "10"
toxcmd: clang
- name: ubuntu-22.04-clang
os: ubuntu-22.04
compiler: clang
version: "12"
toxcmd: build
- name: macOS-11-gcc
os: macOS-11
compiler: gcc
version: "11"
toxcmd: abc,tests
- name: macOS-11-clang
os: macOS-11
compiler: xcode
version: "12.4"
toxcmd: "base -- Xcode"
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Update CMake
uses: jwlawson/actions-setup-cmake@v1
if: runner.os == 'Windows'
- name: Install Tox
run: |
python -m pip install --upgrade pip
pip install tox
- name: Install and setup Linux packages
if: runner.os == 'Linux'
run: |
sudo apt-get -y -qq update
sudo apt-get install -y libreadline-dev ncurses-dev
if [ "${{ matrix.compiler }}" = gcc ]; then
sudo apt-get install -y g++-${{ matrix.version }} g++-${{ matrix.version }}-multilib
echo "CC=gcc-${{ matrix.version }}" >> $GITHUB_ENV
echo "CXX=g++-${{ matrix.version }}" >> $GITHUB_ENV
else
sudo apt-get install -y clang-${{ matrix.version }} llvm-${{ matrix.version }} lld-${{ matrix.version }} g++-multilib
echo "CC=clang-${{ matrix.version }}" >> $GITHUB_ENV
echo "CXX=clang++-${{ matrix.version }}" >> $GITHUB_ENV
fi
- name: Build and test Linux
if: runner.os == 'Linux'
env:
CC: ${{ env.CC }}
CXX: ${{ env.CXX }}
PREFIX: ../staging
run: |
tox -e ${{ matrix.toxcmd }}
- uses: actions/upload-artifact@v3
if: matrix.name == 'ubuntu-20.04-clang'
with:
name: src_coverage_data
path: |
build/coverage/html
build/coverage/lcov.info
- name: Install and setup MacOS packages
if: runner.os == 'macOS'
run: |
if [ "${{ matrix.compiler }}" = gcc ]; then
brew install gcc@${{ matrix.version }}
echo "CC=gcc-${{ matrix.version }}" >> $GITHUB_ENV
echo "CXX=g++-${{ matrix.version }}" >> $GITHUB_ENV
else
ls -ls /Applications/
sudo xcode-select -switch /Applications/Xcode_${{ matrix.version }}.app
fi
- name: Build and test MacOS
if: runner.os == 'macOS'
run: |
if [ "${{ matrix.compiler }}" = gcc ]; then
CC=${{ env.CC }} CXX=${{ env.CXX }} tox -e ${{ matrix.toxcmd }}
else
tox -e ${{ matrix.toxcmd }}
fi
- name: Configure Windows
if: runner.os == 'Windows'
run: >
cmake -S . -B build
-DBUILD_SHARED_LIBS=ON
-DABC_USE_NO_PTHREADS=ON
-DABC_USE_NO_READLINE=ON
-DCMAKE_BUILD_TYPE=Release
-DCMAKE_INSTALL_PREFIX=${{ env.PREFIX }}
env:
CC: cl
CXX: cl
PREFIX: staging
- name: Build Windows
if: runner.os == 'Windows'
run: cmake --build build --config Release -j 2 --target install
- name: Test Windows
if: runner.os == 'Windows'
run: |
ctest -V -C Release --test-dir build/
ls -lh staging/ || true