Skip to content

Commit a3db593

Browse files
committed
chore: merge remote-tracking branch 'upstream/develop' from asap
2 parents 640ba57 + a3222dc commit a3db593

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+1949
-876
lines changed

.clangd.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# We need to configure the location of the compilation database in this file
2-
# and not in vscode `.settings` until we have a way to get the cmake build
2+
# and not in vscode `.settings` until we have a way to get the cmake build
33
# directory or preset name as a subsititution variable.
44
#
55
# See https://github.com/clangd/vscode-clangd/issues/48

.commitlintrc.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
"extends": [
33
"@commitlint/config-conventional"
44
]
5-
}
5+
}

.devcontainer/devcontainer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,4 +69,4 @@
6969
"enable_husky": "npx husky install < /dev/null",
7070
"update_python_modules": "pip --disable-pip-version-check --no-cache-dir install -r requirements.txt"
7171
}
72-
}
72+
}

.gersemirc

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# yaml-language-server: $schema=https://raw.githubusercontent.com/BlankSpruce/gersemi/master/gersemi/configuration.schema.json
2+
3+
cache: true
4+
color: false
5+
definitions: []
6+
indent: 2
7+
line_length: 130
8+
list_expansion: favour-expansion
9+
quiet: false
10+
unsafe: false
11+
warn_about_unknown_commands: false
12+
workers: max

.github/workflows/all-dev-builds.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
name: Matrix Development Builds
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
Linux:
7+
uses: ./.github/workflows/ubuntu-builds.yml
8+
Windows:
9+
uses: ./.github/workflows/windows-builds.yml
10+
MacOS:
11+
uses: ./.github/workflows/macos-builds.yml

.github/workflows/macos-builds.yml

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
name: macos-builds
2+
3+
on: workflow_call
4+
5+
env:
6+
CMAKE_VERSION: 3.21.1
7+
NINJA_VERSION: 1.11.1
8+
CCACHE_VERSION: 4.8
9+
CC: clang
10+
CXX: clang++
11+
12+
jobs:
13+
dev-build:
14+
runs-on: macos-latest
15+
strategy:
16+
matrix:
17+
generator: ['Unix Makefiles', Xcode]
18+
build_type: [Debug, Release]
19+
include:
20+
- build_type: Debug
21+
examples: ON
22+
tests: OFF # the template asap has no unit tests
23+
- build_type: Release
24+
examples: ON
25+
tests: OFF # the template asap has no unit tests
26+
27+
steps:
28+
- name: Setup cmake
29+
uses: jwlawson/actions-setup-cmake@v1
30+
with:
31+
cmake-version: ${{ env.CMAKE_VERSION }}
32+
33+
- name: Setup ccache
34+
uses: Chocobo1/setup-ccache-action@v1
35+
with:
36+
install_ccache: true
37+
update_packager_index: false
38+
prepend_symlinks_to_path: false
39+
40+
- name: Setup XCode
41+
if: matrix.generator == 'Xcode'
42+
uses: mobiledevops/xcode-select-version-action@v1
43+
with:
44+
xcode-select-version: 13.1
45+
46+
- name: Log environment properties
47+
run: |
48+
echo "Build Type : ${{matrix.build_type}}"
49+
echo "Generator : ${{matrix.generator}}"
50+
cmake --version
51+
clang --version
52+
ccache --version
53+
54+
- uses: actions/checkout@v3
55+
with:
56+
submodules: recursive
57+
58+
- name: Configure build
59+
working-directory: ${{runner.workspace}}
60+
run: |
61+
cmake -B build -S $GITHUB_WORKSPACE \
62+
-D CMAKE_BUILD_TYPE=${{matrix.build_type}} \
63+
-G "${{ matrix.generator }}" \
64+
-D USE_CCACHE=ON \
65+
-D ASAP_BUILD_TESTS=${{matrix.tests}} \
66+
-D ASAP_BUILD_EXAMPLES=${{matrix.examples}} \
67+
-D ASAP_BUILD_DOCS=OFF \
68+
-D CMAKE_INSTALL_PREFIX=install \
69+
-D CMAKE_VERBOSE_MAKEFILE=ON
70+
71+
- name: Build main targets
72+
working-directory: ${{runner.workspace}}
73+
run: |
74+
cmake --build build --config ${{matrix.build_type}}
75+
76+
- name: Build test targets
77+
working-directory: ${{runner.workspace}}
78+
if: ${{ matrix.tests == true }}
79+
run: |
80+
cmake --build build --config ${{matrix.build_type}} --target build-all-tests
81+
82+
- name: Run tests with ctest
83+
working-directory: ${{runner.workspace}}
84+
# Hardcode 2 cores we know are there
85+
run: |
86+
ctest --test-dir build -C ${{matrix.build_type}} -j 2 --output-on-failure

.github/workflows/ubuntu-builds.yml

Lines changed: 198 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,198 @@
1+
name: ubuntu-builds
2+
3+
on: workflow_call
4+
5+
env:
6+
CMAKE_VERSION: 3.21.1
7+
NINJA_VERSION: 1.11.1
8+
CCACHE_VERSION: 4.8
9+
CC: ''
10+
CXX: ''
11+
GCC_VERSION: ''
12+
CLANG_VERSION: ''
13+
14+
jobs:
15+
dev-build:
16+
runs-on: ubuntu-22.04
17+
strategy:
18+
matrix:
19+
compiler: [gcc-10, gcc-11, gcc-12, clang-14, clang-15, clang-16]
20+
build_type: [Debug, Release]
21+
include:
22+
- build_type: Debug
23+
examples: ON
24+
tests: OFF # the template asap has no unit tests
25+
- build_type: Release
26+
examples: ON
27+
tests: OFF # the template asap has no unit tests
28+
29+
steps:
30+
- name: Split compiler name and version
31+
id: split
32+
env:
33+
COMPILER: ${{ matrix.compiler }}
34+
COMPILER_NAME: ''
35+
COMPILER_VERSION: ''
36+
run: |
37+
COMPILER_NAME=${COMPILER%%-*}
38+
COMPILER_VERSION=${COMPILER##*-}
39+
echo "compiler_name=$COMPILER_NAME" >> $GITHUB_OUTPUT
40+
if [ $COMPILER_NAME == 'gcc' ]
41+
then
42+
echo "gcc_version=$COMPILER_VERSION" >> $GITHUB_OUTPUT
43+
elif [ $COMPILER_NAME == 'clang' ]
44+
then
45+
echo "clang_version=$COMPILER_VERSION" >> $GITHUB_OUTPUT
46+
echo "gcc_version=11" >> $GITHUB_OUTPUT
47+
fi
48+
49+
- name: Install basic OS packages
50+
run: |
51+
sudo apt-get -qq update
52+
sudo apt-get -qq -y install \
53+
software-properties-common \
54+
apt-transport-https \
55+
lsb-release \
56+
ca-certificates \
57+
curl \
58+
gnupg \
59+
build-essential
60+
61+
- name: Install GCC (always runs)
62+
run: |
63+
# sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
64+
sudo apt-get -qq update && \
65+
sudo apt-get -qq -y install gcc-${{steps.split.outputs.gcc_version}} g++-${{steps.split.outputs.gcc_version}}
66+
67+
- name: Install clang (only if building with clang)
68+
if: ${{ steps.split.outputs.compiler_name == 'clang' }}
69+
run: |
70+
curl https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
71+
sudo add-apt-repository -y 'deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-${{steps.split.outputs.clang_version}} main'
72+
sudo apt-get -qq update
73+
sudo apt-get -qq -y install \
74+
libllvm${{steps.split.outputs.clang_version}} \
75+
llvm-${{steps.split.outputs.clang_version}} \
76+
llvm-${{steps.split.outputs.clang_version}}-dev \
77+
llvm-${{steps.split.outputs.clang_version}}-runtime \
78+
llvm-${{steps.split.outputs.clang_version}}-linker-tools \
79+
lld-${{steps.split.outputs.clang_version}} \
80+
clang-${{steps.split.outputs.clang_version}} \
81+
clang-tools-${{steps.split.outputs.clang_version}} \
82+
clang-format-${{steps.split.outputs.clang_version}} \
83+
libclang1-${{steps.split.outputs.clang_version}} \
84+
libc++-${{steps.split.outputs.clang_version}}-dev \
85+
libc++abi-${{steps.split.outputs.clang_version}}-dev \
86+
clang-format-${{steps.split.outputs.clang_version}} \
87+
python3-clang-${{steps.split.outputs.clang_version}} \
88+
clang-tools-${{steps.split.outputs.clang_version}} \
89+
clang-tidy-${{steps.split.outputs.clang_version}}
90+
91+
- uses: actions/checkout@v3
92+
with:
93+
submodules: recursive
94+
95+
- name: Use GNU compilers (only if building with gcc/g++)
96+
if: ${{ steps.split.outputs.compiler_name == 'gcc' }}
97+
run: |
98+
echo "CC=gcc" >> $GITHUB_ENV
99+
echo "CXX=g++" >> $GITHUB_ENV
100+
sudo update-alternatives --install \
101+
/usr/bin/gcc gcc /usr/bin/gcc-${{steps.split.outputs.gcc_version}} 110 \
102+
--slave /usr/bin/g++ g++ /usr/bin/g++-${{steps.split.outputs.gcc_version}} \
103+
--slave /usr/bin/gcov gcov /usr/bin/gcov-${{steps.split.outputs.gcc_version}}
104+
105+
- name: Use clang (only if building with clang/clang++)
106+
if: ${{ steps.split.outputs.compiler_name == 'clang' }}
107+
run: |
108+
echo "CC=clang" >> $GITHUB_ENV
109+
echo "CXX=clang++" >> $GITHUB_ENV
110+
for command in clang clang++ clang-apply-replacements clang-check \
111+
clang-query clang-tidy clang-format scan-build scan-view llvm-cov \
112+
llvm-profdata
113+
do
114+
sudo update-alternatives --install /usr/bin/$command $command \
115+
/usr/bin/$command-${{steps.split.outputs.clang_version}} 110
116+
done
117+
clang --version
118+
119+
- name: Setup ninja
120+
# Do not use ninja-build from the distro repos as it is always old
121+
uses: abdes/gha-setup-ninja@master
122+
with:
123+
version: ${{ env.NINJA_VERSION }}
124+
125+
- name: Setup cmake
126+
# Do not use cmake from the distro repos as it is not the version we
127+
# want
128+
uses: jwlawson/actions-setup-cmake@v1
129+
with:
130+
cmake-version: ${{ env.CMAKE_VERSION }}
131+
132+
- name: Install ccache from latest
133+
run: |
134+
CCACHE_DIST="ccache-${{ env.CCACHE_VERSION }}-linux-x86_64"
135+
CCACHE_URL="https://github.com/ccache/ccache/releases/download/v$CCACHE_VERSION/$CCACHE_DIST.tar.xz"
136+
echo "Installing ccache from: $CCACHE_URL"
137+
curl -s -L -o ./ccache.tar.xz $CCACHE_URL
138+
tar xf ./ccache.tar.xz
139+
rm -f ./ccache.tar.xz
140+
echo "$GITHUB_WORKSPACE/$CCACHE_DIST" >> $GITHUB_PATH
141+
142+
- name: Log environment properties
143+
run: |
144+
echo "Build Type : ${{matrix.build_type}}"
145+
echo "Compiler Name : ${{steps.split.outputs.compiler_name}}"
146+
if [ ${{steps.split.outputs.compiler_name}} == 'clang' ]
147+
then
148+
echo "Clang Version : ${{steps.split.outputs.clang_version}}"
149+
fi
150+
echo "GCC Version : ${{steps.split.outputs.gcc_version}}"
151+
ninja --version
152+
cmake --version
153+
gcc --version
154+
clang --version
155+
ccache --version
156+
157+
- name: Setup ccache
158+
uses: Chocobo1/setup-ccache-action@v1
159+
with:
160+
install_ccache: false
161+
update_packager_index: false
162+
prepend_symlinks_to_path: false
163+
windows_compile_environment: msvc # this field is required
164+
165+
- name: Configure build
166+
working-directory: ${{runner.workspace}}
167+
run: |
168+
cmake -B build -S $GITHUB_WORKSPACE \
169+
-D CMAKE_BUILD_TYPE=${{matrix.build_type}} \
170+
-G Ninja \
171+
-D CMAKE_MAKE_PROGRAM=ninja \
172+
-D USE_CCACHE=ON \
173+
-D ASAP_BUILD_TESTS=${{matrix.tests}} \
174+
-D ASAP_BUILD_EXAMPLES=${{matrix.examples}} \
175+
-D ASAP_BUILD_DOCS=OFF \
176+
-D CMAKE_INSTALL_PREFIX=install \
177+
-D CMAKE_VERBOSE_MAKEFILE=ON
178+
179+
- name: Build main targets
180+
working-directory: ${{runner.workspace}}
181+
run: |
182+
cmake --build build --target all
183+
184+
- name: Build test targets
185+
working-directory: ${{runner.workspace}}
186+
if: ${{ matrix.tests == true }}
187+
run: |
188+
cmake --build build --target build-all-tests
189+
190+
- name: Run tests with ctest
191+
working-directory: ${{runner.workspace}}
192+
# Hardcode 2 cores we know are there
193+
run: |
194+
ctest \
195+
--test-dir build \
196+
-C ${{matrix.build_type}} \
197+
-j 2 \
198+
--output-on-failure

0 commit comments

Comments
 (0)