Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
abdes committed Feb 16, 2024
2 parents 4165fcc + 88219fd commit ca80d55
Show file tree
Hide file tree
Showing 39 changed files with 811 additions and 69,128 deletions.
11 changes: 11 additions & 0 deletions .github/workflows/all-dev-builds.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: Matrix Development Builds

on: [push, pull_request]

jobs:
Linux:
uses: ./.github/workflows/ubuntu-builds.yml
Windows:
uses: ./.github/workflows/windows-builds.yml
MacOS:
uses: ./.github/workflows/macos-builds.yml
86 changes: 86 additions & 0 deletions .github/workflows/macos-builds.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
name: macos-builds

on: workflow_call

env:
CMAKE_VERSION: 3.21.1
NINJA_VERSION: 1.11.1
CCACHE_VERSION: 4.8
CC: clang
CXX: clang++

jobs:
dev-build:
runs-on: macos-latest
strategy:
matrix:
generator: ['Unix Makefiles', Xcode]
build_type: [Debug, Release]
include:
- build_type: Debug
examples: ON
tests: OFF # the template asap has no unit tests
- build_type: Release
examples: ON
tests: OFF # the template asap has no unit tests

steps:
- name: Setup cmake
uses: jwlawson/actions-setup-cmake@v1
with:
cmake-version: ${{ env.CMAKE_VERSION }}

- name: Setup ccache
uses: Chocobo1/setup-ccache-action@v1
with:
install_ccache: true
update_packager_index: false
prepend_symlinks_to_path: false

- name: Setup XCode
if: matrix.generator == 'Xcode'
uses: mobiledevops/xcode-select-version-action@v1
with:
xcode-select-version: 13.1

- name: Log environment properties
run: |
echo "Build Type : ${{matrix.build_type}}"
echo "Generator : ${{matrix.generator}}"
cmake --version
clang --version
ccache --version
- uses: actions/checkout@v3
with:
submodules: recursive

- name: Configure build
working-directory: ${{runner.workspace}}
run: |
cmake -B build -S $GITHUB_WORKSPACE \
-D CMAKE_BUILD_TYPE=${{matrix.build_type}} \
-G "${{ matrix.generator }}" \
-D USE_CCACHE=ON \
-D ASAP_BUILD_TESTS=${{matrix.tests}} \
-D ASAP_BUILD_EXAMPLES=${{matrix.examples}} \
-D ASAP_BUILD_DOCS=OFF \
-D CMAKE_INSTALL_PREFIX=install \
-D CMAKE_VERBOSE_MAKEFILE=ON
- name: Build main targets
working-directory: ${{runner.workspace}}
run: |
cmake --build build --config ${{matrix.build_type}}
- name: Build test targets
working-directory: ${{runner.workspace}}
if: ${{ matrix.tests == true }}
run: |
cmake --build build --config ${{matrix.build_type}} --target build-all-tests
- name: Run tests with ctest
working-directory: ${{runner.workspace}}
# Hardcode 2 cores we know are there
run: |
ctest --test-dir build -C ${{matrix.build_type}} -j 2 --output-on-failure
202 changes: 202 additions & 0 deletions .github/workflows/ubuntu-builds.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,202 @@
name: ubuntu-builds

on: workflow_call

env:
CMAKE_VERSION: 3.21.1
NINJA_VERSION: 1.11.1
CCACHE_VERSION: 4.8
CC: ""
CXX: ""
GCC_VERSION: ""
CLANG_VERSION: ""

jobs:
dev-build:
runs-on: ubuntu-22.04
strategy:
matrix:
compiler: [gcc-10, gcc-11, gcc-12, clang-14, clang-15, clang-16]
build_type: [Debug, Release]
include:
- build_type: Debug
examples: ON
tests: OFF # the template asap has no unit tests
- build_type: Release
examples: ON
tests: OFF # the template asap has no unit tests

steps:
- name: Split compiler name and version
id: split
env:
COMPILER: ${{ matrix.compiler }}
COMPILER_NAME: ""
COMPILER_VERSION: ""
run: |
COMPILER_NAME=${COMPILER%%-*}
COMPILER_VERSION=${COMPILER##*-}
echo "compiler_name=$COMPILER_NAME" >> $GITHUB_OUTPUT
if [ $COMPILER_NAME == 'gcc' ]
then
echo "gcc_version=$COMPILER_VERSION" >> $GITHUB_OUTPUT
elif [ $COMPILER_NAME == 'clang' ]
then
echo "clang_version=$COMPILER_VERSION" >> $GITHUB_OUTPUT
echo "gcc_version=11" >> $GITHUB_OUTPUT
fi
- name: Install basic OS packages
run: |
sudo apt-get -qq update
sudo apt-get -qq -y install \
software-properties-common \
apt-transport-https \
lsb-release \
ca-certificates \
curl \
gnupg \
build-essential
- name: Install X11 dependencies
run: |
sudo apt-get install -y -qq xorg-dev libglu1-mesa-dev
- name: Install GCC (always runs)
run: |
# sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
sudo apt-get -qq update && \
sudo apt-get -qq -y install gcc-${{steps.split.outputs.gcc_version}} g++-${{steps.split.outputs.gcc_version}}
- name: Install clang (only if building with clang)
if: ${{ steps.split.outputs.compiler_name == 'clang' }}
run: |
curl https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
sudo add-apt-repository -y 'deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-${{steps.split.outputs.clang_version}} main'
sudo apt-get -qq update
sudo apt-get -qq -y install \
libllvm${{steps.split.outputs.clang_version}} \
llvm-${{steps.split.outputs.clang_version}} \
llvm-${{steps.split.outputs.clang_version}}-dev \
llvm-${{steps.split.outputs.clang_version}}-runtime \
llvm-${{steps.split.outputs.clang_version}}-linker-tools \
lld-${{steps.split.outputs.clang_version}} \
clang-${{steps.split.outputs.clang_version}} \
clang-tools-${{steps.split.outputs.clang_version}} \
clang-format-${{steps.split.outputs.clang_version}} \
libclang1-${{steps.split.outputs.clang_version}} \
libc++-${{steps.split.outputs.clang_version}}-dev \
libc++abi-${{steps.split.outputs.clang_version}}-dev \
clang-format-${{steps.split.outputs.clang_version}} \
python3-clang-${{steps.split.outputs.clang_version}} \
clang-tools-${{steps.split.outputs.clang_version}} \
clang-tidy-${{steps.split.outputs.clang_version}}
- uses: actions/checkout@v3
with:
submodules: recursive

- name: Use GNU compilers (only if building with gcc/g++)
if: ${{ steps.split.outputs.compiler_name == 'gcc' }}
run: |
echo "CC=gcc" >> $GITHUB_ENV
echo "CXX=g++" >> $GITHUB_ENV
sudo update-alternatives --install \
/usr/bin/gcc gcc /usr/bin/gcc-${{steps.split.outputs.gcc_version}} 110 \
--slave /usr/bin/g++ g++ /usr/bin/g++-${{steps.split.outputs.gcc_version}} \
--slave /usr/bin/gcov gcov /usr/bin/gcov-${{steps.split.outputs.gcc_version}}
- name: Use clang (only if building with clang/clang++)
if: ${{ steps.split.outputs.compiler_name == 'clang' }}
run: |
echo "CC=clang" >> $GITHUB_ENV
echo "CXX=clang++" >> $GITHUB_ENV
for command in clang clang++ clang-apply-replacements clang-check \
clang-query clang-tidy clang-format scan-build scan-view llvm-cov \
llvm-profdata
do
sudo update-alternatives --install /usr/bin/$command $command \
/usr/bin/$command-${{steps.split.outputs.clang_version}} 110
done
clang --version
- name: Setup ninja
# Do not use ninja-build from the distro repos as it is always old
uses: abdes/gha-setup-ninja@master
with:
version: ${{ env.NINJA_VERSION }}

- name: Setup cmake
# Do not use cmake from the distro repos as it is not the version we
# want
uses: jwlawson/actions-setup-cmake@v1
with:
cmake-version: ${{ env.CMAKE_VERSION }}

- name: Install ccache from latest
run: |
CCACHE_DIST="ccache-${{ env.CCACHE_VERSION }}-linux-x86_64"
CCACHE_URL="https://github.com/ccache/ccache/releases/download/v$CCACHE_VERSION/$CCACHE_DIST.tar.xz"
echo "Installing ccache from: $CCACHE_URL"
curl -s -L -o ./ccache.tar.xz $CCACHE_URL
tar xf ./ccache.tar.xz
rm -f ./ccache.tar.xz
echo "$GITHUB_WORKSPACE/$CCACHE_DIST" >> $GITHUB_PATH
- name: Log environment properties
run: |
echo "Build Type : ${{matrix.build_type}}"
echo "Compiler Name : ${{steps.split.outputs.compiler_name}}"
if [ ${{steps.split.outputs.compiler_name}} == 'clang' ]
then
echo "Clang Version : ${{steps.split.outputs.clang_version}}"
fi
echo "GCC Version : ${{steps.split.outputs.gcc_version}}"
ninja --version
cmake --version
gcc --version
clang --version
ccache --version
- name: Setup ccache
uses: Chocobo1/setup-ccache-action@v1
with:
install_ccache: false
update_packager_index: false
prepend_symlinks_to_path: false
windows_compile_environment: msvc # this field is required

- name: Configure build
working-directory: ${{runner.workspace}}
run: |
cmake -B build -S $GITHUB_WORKSPACE \
-D CMAKE_BUILD_TYPE=${{matrix.build_type}} \
-G Ninja \
-D CMAKE_MAKE_PROGRAM=ninja \
-D USE_CCACHE=ON \
-D ASAP_BUILD_TESTS=${{matrix.tests}} \
-D ASAP_BUILD_EXAMPLES=${{matrix.examples}} \
-D ASAP_BUILD_DOCS=OFF \
-D CMAKE_INSTALL_PREFIX=install \
-D CMAKE_VERBOSE_MAKEFILE=ON
- name: Build main targets
working-directory: ${{runner.workspace}}
run: |
cmake --build build --target all
- name: Build test targets
working-directory: ${{runner.workspace}}
if: ${{ matrix.tests == true }}
run: |
cmake --build build --target build-all-tests
- name: Run tests with ctest
working-directory: ${{runner.workspace}}
# Hardcode 2 cores we know are there
run: |
ctest \
--test-dir build \
-C ${{matrix.build_type}} \
-j 2 \
--output-on-failure
91 changes: 91 additions & 0 deletions .github/workflows/windows-builds.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
name: windows-builds

on: workflow_call

env:
CMAKE_VERSION: 3.21.1
NINJA_VERSION: 1.11.1
CCACHE_VERSION: 4.8

jobs:
dev-build:
runs-on: windows-latest
strategy:
matrix:
generator: ['Ninja', 'NMake Makefiles', 'Visual Studio 17 2022']
build_type: [Debug, Release]
include:
- build_type: Debug
examples: ON
tests: OFF # the template asap has no unit tests
- build_type: Release
examples: ON
tests: OFF # the template asap has no unit tests

steps:
- name: Setup ninja (only if the generator is 'Ninja')
if: matrix.generator == 'Ninja'
uses: abdes/gha-setup-ninja@master
with:
version: ${{ env.NINJA_VERSION }}

- name: Setup cmake
uses: jwlawson/actions-setup-cmake@v1
with:
cmake-version: ${{ env.CMAKE_VERSION }}

- name: Setup ccache
uses: Chocobo1/setup-ccache-action@v1
with:
install_ccache: true
update_packager_index: false
prepend_symlinks_to_path: false
windows_compile_environment: msvc # this field is required

- name: Set MSVC environment
uses: ilammy/msvc-dev-cmd@v1

- name: Log environment properties
run: |
echo "Build Type : ${{matrix.build_type}}"
echo "Generator : ${{matrix.generator}}"
if ('${{matrix.generator}}' -eq 'Ninja') {
ninja --version
}
cmake --version
ccache --version
- uses: actions/checkout@v3
with:
submodules: recursive

- name: Configure build
working-directory: ${{runner.workspace}}
run: |
cmake -B build -S asap `
-D CMAKE_BUILD_TYPE=${{matrix.build_type}} `
-G "${{ matrix.generator }}" `
-D USE_CCACHE=ON `
-D ASAP_BUILD_TESTS=${{matrix.tests}} `
-D ASAP_BUILD_EXAMPLES=${{matrix.examples}} `
-D ASAP_BUILD_DOCS=OFF `
-D CMAKE_INSTALL_PREFIX=install `
-D CMAKE_VERBOSE_MAKEFILE=ON
dir build
- name: Build main targets
working-directory: ${{runner.workspace}}
run: |
cmake --build build --config ${{matrix.build_type}}
- name: Build test targets
working-directory: ${{runner.workspace}}
if: matrix.tests == true
run: |
cmake --build build --config ${{matrix.build_type}} --target build-all-tests
- name: Run tests with ctest
working-directory: ${{runner.workspace}}
# Hardcode 2 cores we know are there
run: |
ctest --test-dir build -C ${{matrix.build_type}} -j 2 --output-on-failure
Loading

0 comments on commit ca80d55

Please sign in to comment.