Skip to content

Commit

Permalink
Update doctest to 2.4.7, update CI, add badges
Browse files Browse the repository at this point in the history
Updates doctest and fixes issues with g++4.7 and MSVC2013 doctest
builds.

Adds new CI targets for g++ 9 and 10, clang 9 through 12.

Adds CI badges for github actions.
  • Loading branch information
AzothAmmo committed Jan 11, 2022
1 parent 8291f44 commit ca9aeaa
Show file tree
Hide file tree
Showing 5 changed files with 308 additions and 111 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/ci-macos.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Test cereal
name: cereal mac ci
on: [push, pull_request]

jobs:
Expand All @@ -17,6 +17,7 @@ jobs:
COMPILER: 'clang++'
XCODE_VERSION: 12
NAME: macos-latest-clang-xcode12
name: ${{ matrix.name }}

steps:
- name: Checkout code
Expand Down
55 changes: 49 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Test cereal
name: cereal linux ci
on: [push, pull_request]

jobs:
Expand Down Expand Up @@ -55,6 +55,18 @@ jobs:
EXTRA_APT_PACKAGES: 'g++-8'
CONTAINER: ubuntu:16.04
NAME: ubuntu-16.04-g++8

- CMAKE_OPTIONS: '-DSKIP_PORTABILITY_TEST=ON -DCMAKE_CXX_STANDARD=17'
COMPILER: 'g++-9'
EXTRA_APT_PACKAGES: 'g++-9'
CONTAINER: ubuntu:20.04
NAME: ubuntu-20.04-g++9

- CMAKE_OPTIONS: '-DSKIP_PORTABILITY_TEST=ON -DCMAKE_CXX_STANDARD=17'
COMPILER: 'g++-10'
EXTRA_APT_PACKAGES: 'g++-10'
CONTAINER: ubuntu:20.04
NAME: ubuntu-20.04-g++10

- CMAKE_OPTIONS: '-DSKIP_PORTABILITY_TEST=ON'
COMPILER: 'clang++-3.5'
Expand Down Expand Up @@ -125,6 +137,31 @@ jobs:
LLVM_APT_SOURCE: 'deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial-8 main'
CONTAINER: ubuntu:16.04
NAME: ubuntu-16.04-clang-8-cpp17

- CMAKE_OPTIONS: '-DSKIP_PORTABILITY_TEST=ON -DCMAKE_CXX_STANDARD=17'
COMPILER: 'clang++-9'
EXTRA_APT_PACKAGES: 'clang-9'
CONTAINER: ubuntu:20.04
NAME: ubuntu-20.04-clang-9-cpp17

- CMAKE_OPTIONS: '-DSKIP_PORTABILITY_TEST=ON -DCMAKE_CXX_STANDARD=17'
COMPILER: 'clang++-10'
EXTRA_APT_PACKAGES: 'clang-10'
CONTAINER: ubuntu:20.04
NAME: ubuntu-20.04-clang-10-cpp17

- CMAKE_OPTIONS: '-DSKIP_PORTABILITY_TEST=ON -DCMAKE_CXX_STANDARD=17'
COMPILER: 'clang++-11'
EXTRA_APT_PACKAGES: 'clang-11'
CONTAINER: ubuntu:20.04
NAME: ubuntu-20.04-clang-11-cpp17

- CMAKE_OPTIONS: '-DSKIP_PORTABILITY_TEST=ON -DCMAKE_CXX_STANDARD=17'
COMPILER: 'clang++-12'
EXTRA_APT_PACKAGES: 'clang-12'
CONTAINER: ubuntu:20.04
NAME: ubuntu-20.04-clang-12-cpp17
name: ${{ matrix.name }}

steps:
- name: Checkout code
Expand All @@ -139,15 +176,21 @@ jobs:
LLVM_APT_SOURCE: ${{ matrix.LLVM_APT_SOURCE }}
run: |
set -ex
# Add apt repositories
apt-get update -y
apt-get install software-properties-common wget python3-pip make apt-transport-https -y
add-apt-repository ppa:ubuntu-toolchain-r/test -y
add-apt-repository ppa:mhier/libboost-latest -y
wget -qO - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add -
DEBIAN_FRONTEND=noninteractive TZ=America/Los_Angeles apt-get install -y software-properties-common wget python3-pip make apt-transport-https
# Add apt repositories for older Ubuntu
. /etc/os-release
if [[ "${VERSION_ID}" == "16.04" ]]; then
add-apt-repository ppa:ubuntu-toolchain-r/test -y
add-apt-repository ppa:mhier/libboost-latest -y
fi
if [[ "${LLVM_APT_SOURCE}" != "" ]]; then
wget -qO - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add -
add-apt-repository "${LLVM_APT_SOURCE}"
fi
apt-get update -y
# Install apt packages
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,9 @@ cereal is licensed under the [BSD license](http://opensource.org/licenses/BSD-3-

## cereal build status

* master : [![Build Status](https://travis-ci.com/USCiLab/cereal.svg?branch=master)](https://travis-ci.com/USCiLab/cereal)
[![Build status](https://ci.appveyor.com/api/projects/status/91aou6smj36or0vb/branch/master?svg=true)](https://ci.appveyor.com/project/AzothAmmo/cereal/branch/master)
* [![Linux build status](https://github.com/USCiLab/cereal/actions/workflows/ci.yml/badge.svg)](https://github.com/USCiLab/cereal/actions/workflows/ci.yml)
* [![Mac build status](https://github.com/USCiLab/cereal/actions/workflows/ci-macos.yml/badge.svg)](https://github.com/USCiLab/cereal/actions/workflows/ci-macos.yml)
* [![Windows build status](https://ci.appveyor.com/api/projects/status/91aou6smj36or0vb/branch/master?svg=true)](https://ci.appveyor.com/project/AzothAmmo/cereal/branch/master)

---

Expand Down
16 changes: 16 additions & 0 deletions unittests/common.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,22 @@
#include <limits>
#include <random>

// gcc 4.7 workarounds for doctest
#if defined(__GNUC__) && !defined(__clang__)
#if __GNUC__ == 4 && __GNUC_MINOR__ < 8
#define DOCTEST_THREAD_LOCAL
#define DOCTEST_NORETURN
#pragma GCC diagnostic ignored "-Wreturn-type"
static bool cereal_doctest_debugger(){ return false; }
#define DOCTEST_IS_DEBUGGER_ACTIVE cereal_doctest_debugger
#endif // GNU version check
#endif // GCC but not clang

// MSVC 2013 workaround for doctest
#if defined(_MSC_VER) && _MSC_VER < 1900
__pragma(warning(disable : 4715))
#endif // _MSC_VER

#include "doctest.h"

namespace std
Expand Down
Loading

0 comments on commit ca9aeaa

Please sign in to comment.