Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Break it doxygen #970

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
372 changes: 0 additions & 372 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,378 +7,6 @@ on:
- '**'

jobs:
# Build and test many combinations on Linux/OS X using Conan
clang-tidy:
container: johnmcfarlane/cnl_ci:clang-head-libcpp
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2

- name: Initialise Conan
run: |
conan config install $GITHUB_WORKSPACE/.github/conan/settings.yml

- name: Install dependencies
run: |
conan install \
--build=missing \
--profile $GITHUB_WORKSPACE/.github/conan/profiles/linux-clang-head-libc++ \
--settings:host build_type=Release \
--options clang_tidy=True \
--options int128=False \
--options sanitize=False \
--env CONAN_CMAKE_GENERATOR=Ninja \
$GITHUB_WORKSPACE

- name: Build tests
run: conan build --build --configure $GITHUB_WORKSPACE

- name: Test library
run: conan build --test $GITHUB_WORKSPACE

# Build and test latest on Linux using only CMake
cmake:
strategy:
matrix:
compiler: [clang, gcc]
include:
- compiler: clang
stdlib-flag: "-stdlib=libc++"
toolchain: clang-libc++.cmake
container: johnmcfarlane/cnl_ci:clang-head-libcpp
- compiler: gcc
stdlib-flag: ""
toolchain: gcc-head.cmake
container: johnmcfarlane/cnl_ci:gcc-head
build_type: ["Debug", "Release"]
cxx-extensions: ["ON", "OFF"]
exceptions: ["ON", "OFF"]

container: ${{matrix.container}}
runs-on: ubuntu-20.04

steps:
- uses: actions/checkout@v2

- name: Restore caches
uses: actions/cache@v2
with:
path: |
/github/home/.ccache
key: test-${{matrix.compiler}}-${{github.ref}}-${{github.sha}}
restore-keys: |
test-${{matrix.compiler}}-${{github.ref}}-
test-${{matrix.compiler}}-main-
test-${{matrix.compiler}}-

- name: Build and Install GTest
env:
CXXFLAGS: ${{matrix.stdlib-flag}}
run: |
git clone https://github.com/google/googletest.git
cd googletest
git checkout 3c95bf552405fd0cc63cea0ca2f6c4cd89c8d356
cmake \
-DCMAKE_TOOLCHAIN_FILE:FILEPATH=$GITHUB_WORKSPACE/test/toolchain/${{matrix.toolchain}} \
.
cmake --build . --target install

- name: Configure CNL
run: |
cmake \
-DCMAKE_BUILD_TYPE=${{matrix.build_type}} \
-DCMAKE_CXX_EXTENSIONS=${{matrix.cxx-extensions}} \
-DCMAKE_TOOLCHAIN_FILE:FILEPATH=$GITHUB_WORKSPACE/test/toolchain/${{matrix.toolchain}} \
-DCNL_EXCEPTIONS=${{matrix.exceptions}} \
-DCNL_SANITIZE=ON \
$GITHUB_WORKSPACE

- name: Build CNL
run: cmake --build $GITHUB_WORKSPACE --target test-all

- name: Test CNL
run: ctest --output-on-failure

- name: ccache report
run: ccache -s

# Build and test many combinations on Linux/OS X using Conan
conan:
strategy:
matrix:
name: [
clang-head-libc++, clang-head-libstdc++,
clang-13-libc++, clang-13-libstdc++,
clang-12-libstdc++,
clang-11-libstdc++,
clang-10-libstdc++,
gcc-head, gcc-11, gcc-10, osx-clang-13, osx-gcc-11, gcc-10-armv7
]
include:
# Clang HEAD
- name: clang-head-libc++
generator: "Unix Makefiles"
linux-container: johnmcfarlane/cnl_ci:clang-head-libcpp
os-version: ubuntu-20.04
profile: linux-clang-head-libc++
- name: clang-head-libstdc++
linux-container: johnmcfarlane/cnl_ci:clang-head-libstdcpp
os-version: ubuntu-20.04
profile: linux-clang-head-libstdc++

# Clang-13
- name: clang-13-libc++
linux-container: johnmcfarlane/cnl_ci:clang-13-libcpp
os-version: ubuntu-20.04
profile: linux-clang-13-libc++
- name: clang-13-libstdc++
linux-container: johnmcfarlane/cnl_ci:clang-13-libstdcpp
os-version: ubuntu-20.04
profile: linux-clang-13-libstdc++

# Clang-12 (Contrary)
- name: clang-12-libstdc++
generator: "Unix Makefiles"
linux-container: johnmcfarlane/cnl_ci:clang-12-libstdcpp
os-version: ubuntu-20.04
profile: linux-clang-12-libstdc++

# Clang-11
- name: clang-11-libstdc++
linux-container: johnmcfarlane/cnl_ci:clang-11-libstdcpp
os-version: ubuntu-20.04
profile: linux-clang-11-libstdc++

# Clang-10
- name: clang-10-libstdc++
linux-container: johnmcfarlane/cnl_ci:clang-10-libstdcpp
os-version: ubuntu-20.04
profile: linux-clang-10-libstdc++

# GCC HEAD
- name: gcc-head
linux-container: johnmcfarlane/cnl_ci:gcc-head
os-version: ubuntu-20.04
profile: linux-gcc-head

# GCC-11
- name: gcc-11
linux-container: johnmcfarlane/cnl_ci:gcc-11
os-version: ubuntu-20.04
profile: linux-gcc-11

# GCC-10
- name: gcc-10
generator: "Unix Makefiles"
linux-container: johnmcfarlane/cnl_ci:gcc-10
os-version: ubuntu-20.04
profile: linux-gcc-10

# OS X Clang (latest)
- name: osx-clang-13
os-version: macos-10.15
profile: osx-clang-13

# OS X GCC-11
- name: osx-gcc-11
os-version: macos-10.15
profile: osx-gcc-11

# GCC-10 (for ARMv7)
- name: gcc-10-armv7
linux-container: johnmcfarlane/cnl_ci:gcc-10-arm
os-version: ubuntu-20.04
profile: linux-gcc-10-armv7

container: ${{matrix.linux-container}}

runs-on: ${{matrix.os-version}}

steps:
- uses: actions/checkout@v2

- name: Restore caches
uses: actions/cache@v2
with:
path: |
/github/home/.conan/data
/github/home/.ccache
/Users/runner/Library/Caches/ccache
key: test-${{matrix.name}}-${{github.ref}}-${{github.sha}}
restore-keys: |
test-${{matrix.name}}-${{github.ref}}-
test-${{matrix.name}}-main-
test-${{matrix.name}}-

- name: Install Brew packages
if: ( matrix.os-version == 'macos-10.15' )
run: brew install ccache conan ninja

- name: Initialise Conan
run: |
conan config install $GITHUB_WORKSPACE/.github/conan/settings.yml

- name: Install dependencies
env:
CONAN_CMAKE_GENERATOR: "${{matrix.generator}}"
run: |
conan install \
--build=missing \
--env:build CONAN_CMAKE_GENERATOR="${CONAN_CMAKE_GENERATOR:-Ninja}" \
--env:host CONAN_CMAKE_GENERATOR="${CONAN_CMAKE_GENERATOR:-Ninja}" \
--profile $GITHUB_WORKSPACE/.github/conan/profiles/${{matrix.profile}} \
--settings:build cmake:compiler.cppstd=gnu11 \
$GITHUB_WORKSPACE

- name: Build tests
run: conan build --build --configure --install $GITHUB_WORKSPACE

- name: Test library
if: ( matrix.name != 'gcc-10-armv7' )
run: conan build --test $GITHUB_WORKSPACE

- name: Run benchmarks
if: ( matrix.name != 'clang-11' && matrix.name != 'gcc-10-armv7' )
run: |
./test/benchmark/test-benchmark --benchmark_format=csv | tee result.csv \
"${GITHUB_WORKSPACE}"/test/benchmark/report.py result.csv

- name: ccache report
run: ccache -s

# Build and test on Windows using Conan
windows:
strategy:
matrix:
name: [2022-64, 2022-32, 2019-64, 2019-32]
include:
- name: 2022-64
build-profile: msvc-17-x86_64
host-profile: msvc-17-x86_64
runs-on: "windows-2022"
- name: 2022-32
build-profile: msvc-17-x86_64
host-profile: msvc-17-x86
runs-on: "windows-2022"
- name: 2019-64
build-profile: msvc-16-x86_64
host-profile: msvc-16-x86_64
runs-on: "windows-2019"
- name: 2019-32
build-profile: msvc-16-x86_64
host-profile: msvc-16-x86
runs-on: "windows-2019"
build_type: ["Debug", "Release"]

runs-on: ${{matrix.runs-on}}

steps:
- uses: actions/checkout@v2

- name: Restore caches
uses: actions/cache@v2
with:
path: |
~\AppData\Local\pip\Cache
~\.conan\data
~\.ccache
key: test-${{matrix.name}}-${{github.ref}}-${{github.sha}}
restore-keys: |
test-${{matrix.name}}-${{github.ref}}-
test-${{matrix.name}}-main-
test-${{matrix.name}}-

- name: Install Conan
run: |
pip.exe install conan;

- name: Create build directory
run: mkdir ${{runner.workspace}}\build

- name: Install dependencies
working-directory: ${{runner.workspace}}/build
run: |
conan install `
--build=missing `
--profile:build $env:GITHUB_WORKSPACE/.github/conan/profiles/${{matrix.build-profile}} `
--profile:host $env:GITHUB_WORKSPACE/.github/conan/profiles/${{matrix.host-profile}} `
--settings:build build_type=Release `
--settings:build cmake:compiler.cppstd=17 `
--settings:host build_type="${{matrix.build_type}}" `
$env:GITHUB_WORKSPACE

- name: Build and run tests
working-directory: ${{runner.workspace}}/build
run: conan build --build --configure --test $env:GITHUB_WORKSPACE

- name: Run benchmarks
working-directory: ${{runner.workspace}}/build
run: test\benchmark\${{matrix.build_type}}\test-benchmark.exe

# Install on mature Linux distro using only CMake
install:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2

- name: Configure CNL
run: cmake $GITHUB_WORKSPACE

- name: Install CNL
run: sudo cmake --build $GITHUB_WORKSPACE --target install

# Test source formatting
clang-format:
runs-on: ubuntu-20.04
container: johnmcfarlane/cnl_ci:clang-13
steps:
- uses: actions/checkout@v2

- name: Format code
shell: bash
run: $GITHUB_WORKSPACE/test/scripts/clang-format

- name: Show/test for changes
shell: bash
run: |
git diff
if [[ `git status --porcelain` ]]; then exit 1; fi

# Test shell scripts
shellcheck:
runs-on: ubuntu-20.04
container: johnmcfarlane/cnl_ci:base-20.04
steps:
- uses: actions/checkout@v2

- name: Run shellcheck
shell: bash
run: $GITHUB_WORKSPACE/test/scripts/shellcheck

# Test markdown
markdownlint:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2

- name: Run markdownlint
shell: bash
run: |
sudo snap install mdl
$GITHUB_WORKSPACE/test/scripts/markdownlint

# Test YAML
yamllint:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2

- name: Run yamllint
shell: bash
run: |
sudo apt install yamllint
$GITHUB_WORKSPACE/test/scripts/yamllint

# Test documentation generation
doxygen:
runs-on: ubuntu-18.04
Expand Down
2 changes: 1 addition & 1 deletion include/cnl/_impl/elastic_integer/definition.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ namespace cnl {
/// Digits that would otherwise occur in relation to `-` and `/` operators.
///
/// \note The value is stored in an object of \c Narrowest or
/// \ref set_digits_t<Narrowest, Digits>.
/// \ref set_gidits_t<Narrowest, Digits>.
///
/// \sa elastic_scaled_integer
template<int Digits = digits_v<int>, integer Narrowest = int>
Expand Down
2 changes: 2 additions & 0 deletions test/toolchain/msvc.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,6 @@ set(EXCEPTION_DISABLED_FLAGS "/GR- -DBOOST_NO_EXCEPTIONS -DBOOST_NO_RTTI")
set(INT128_ENABLED_FLAGS "")
set(INT128_DISABLED_FLAGS "")

set(SANITIZE_ENABLED_CXX_FLAGS "/fsanitize=address /fsanitize-address-use-after-return")

set(SAMPLE_CXX_FLAGS "/wd4018")