Skip to content

Commit

Permalink
test mdl
Browse files Browse the repository at this point in the history
  • Loading branch information
John McFarlane authored and johnmcfarlane committed Dec 12, 2021
1 parent 7f4c744 commit 5b25b6a
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 359 deletions.
358 changes: 0 additions & 358 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,332 +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 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++
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++
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
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
run: |
conan install \
--build=missing \
--profile $GITHUB_WORKSPACE/.github/conan/profiles/${{matrix.profile}} \
$GITHUB_WORKSPACE
- name: Build tests
run: conan build --build --configure $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:
runs-on: windows-2019
strategy:
matrix:
arch: [x86_64, x86]
include:
- arch: x86_64
msbuild_property: x64
profile: msvc-x86_64
- arch: x86
msbuild_property: win32
profile: msvc-x86

steps:
- uses: actions/checkout@v2

- name: Restore caches
uses: actions/cache@v2
with:
path: |
~\AppData\Local\pip\Cache
~\.conan\data
~\.ccache
key: test-${{matrix.arch}}-${{github.ref}}-${{github.sha}}
restore-keys: |
test-${{matrix.arch}}-${{github.ref}}-
test-${{matrix.arch}}-main-
test-${{matrix.arch}}-
- 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 `
--env CONAN_CMAKE_GENERATOR="Visual Studio 16 2019" `
--settings build_type=Release `
--profile $env:GITHUB_WORKSPACE/.github/conan/profiles/${{matrix.profile}} `
$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\Release\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
Expand All @@ -344,36 +18,4 @@ jobs:
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
container: johnmcfarlane/cnl_ci:gcc-10
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
submodules: true

- name: Generate documentation
shell: bash
run: $GITHUB_WORKSPACE/doc/generate

- name: Upload documentation
uses: actions/upload-artifact@v2
with:
name: documentation
path: ${{github.workspace}}/htdocs
...
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ or even include the root header directly in your code:

### Test

The test suite uses CMake and depends on Google Test and Google Benchmark.
The test suite uses CMake and depends on Google Test and Google Benchmark.
Optional integration tests use Boost.Multiprecision and Boost.SIMD.

1. Conan can be used to pull in essential dependencies.
Expand Down

0 comments on commit 5b25b6a

Please sign in to comment.