Skip to content

Fix string_view::cend() recursively calling self (#27) #21

Fix string_view::cend() recursively calling self (#27)

Fix string_view::cend() recursively calling self (#27) #21

Workflow file for this run

name: Ubuntu
on:
push:
paths:
- 'include/**.hpp'
- 'test/**.cpp'
- '**.cmake'
- 'conanfile.py'
- 'CMakeLists.txt'
- 'test/CMakeLists.txt'
- '.github/workflows/build-ubuntu.yml'
pull_request:
paths:
- 'include/**.hpp'
- 'test/**.cpp'
- '**.cmake'
- 'conanfile.py'
- 'CMakeLists.txt'
- 'test/CMakeLists.txt'
- '.github/workflows/build-ubuntu.yml'
jobs:
test:
name: Ubuntu ${{matrix.compiler.cc}} (${{matrix.arch}})
runs-on: ubuntu-20.04
env:
build-directory: build
strategy:
fail-fast: false
matrix:
compiler:
# GCC Versions
- { cc: gcc-5, cxx: g++-5 }
- { cc: gcc-6, cxx: g++-6 }
- { cc: gcc-7, cxx: g++-7 }
- { cc: gcc-8, cxx: g++-8 }
- { cc: gcc-9, cxx: g++-9 }
- { cc: gcc-10, cxx: g++-10 }
# Clang Versions
- { cc: clang-3.5, cxx: clang++-3.5 }
- { cc: clang-3.6, cxx: clang++-3.6 }
- { cc: clang-3.7, cxx: clang++-3.7 }
- { cc: clang-3.8, cxx: clang++-3.8 }
- { cc: clang-3.9, cxx: clang++-3.9 }
- { cc: clang-4.0, cxx: clang++-4.0 }
- { cc: clang-5.0, cxx: clang++-5.0 }
- { cc: clang-6.0, cxx: clang++-6.0 }
- { cc: clang-7, cxx: clang++-7 }
- { cc: clang-8, cxx: clang++-8 }
- { cc: clang-9, cxx: clang++-9 }
- { cc: clang-10, cxx: clang++-10 }
arch: [x86, x86_64]
# clang 3.5 through 3.8 fail to compiler for 32-bit
# Disable these builds for time being
exclude:
- arch: x86
compiler: { cc: clang-3.5, cxx: clang++-3.5 }
- arch: x86
compiler: { cc: clang-3.6, cxx: clang++-3.6 }
- arch: x86
compiler: { cc: clang-3.7, cxx: clang++-3.7 }
- arch: x86
compiler: { cc: clang-3.8, cxx: clang++-3.8 }
steps:
- name: Clone
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: 3.7
- name: Prepare Environment
run: |
if [[ "${{matrix.arch}}" == "x86" ]]; then
sudo dpkg --add-architecture i386
fi
sudo apt-get update
# Older versions of clang and gcc are not available on Ubuntu 20.04; so
# we need to add the repos manually first.
sudo add-apt-repository "deb http://dk.archive.ubuntu.com/ubuntu/ bionic main universe"
sudo add-apt-repository "deb http://dk.archive.ubuntu.com/ubuntu/ xenial main universe"
sudo apt-get update
if [[ "${{matrix.compiler.cc}}" =~ "gcc" ]]; then
sudo apt-get install -y ${{matrix.compiler.cxx}} ${{matrix.compiler.cxx}}-multilib
else
sudo apt-get install -y ${{matrix.compiler.cc}} g++-multilib
# g++5 needed for clang 32-bit builds
if [[ "${{matrix.arch}}" == "x86" ]]; then
sudo apt-get install -y g++-5
fi
fi
python -m pip install --upgrade pip
pip install conan
cmake -E make_directory ${{env.build-directory}}
cmake -E chdir ${{env.build-directory}} conan install ..
- name: Prepare Architecture
run: |
if [[ "${{matrix.arch}}" = "x86" ]]; then
echo "CXXFLAGS=${CXXFLAGS} -m32" >> ${GITHUB_ENV}
fi
# Debug Configuration
- name: Configure (Debug)
working-directory: ${{env.build-directory}}
env:
CC: ${{matrix.compiler.cc}}
CXX: ${{matrix.compiler.cxx}}
run: cmake .. -DCMAKE_BUILD_TYPE=Debug -DBACKPORT_COMPILE_UNIT_TESTS=On
- name: Build
working-directory: ${{env.build-directory}}
run: cmake --build .
- name: Test
working-directory: ${{env.build-directory}}
run: ctest --output-on-failure
# Release Configuration
- name: Configure (Release)
working-directory: ${{env.build-directory}}
run: cmake .. -DCMAKE_BUILD_TYPE=Release
- name: Build (Release)
working-directory: ${{env.build-directory}}
run: cmake --build .
- name: Test (Release)
working-directory: ${{env.build-directory}}
run: ctest --output-on-failure
sanitize:
name: Ubuntu ${{matrix.compiler.cc}} '${{matrix.sanitizer}}' sanitizer
runs-on: ubuntu-20.04
needs: test
env:
build-directory: build
strategy:
matrix:
compiler:
- { cc: gcc, cxx: g++ }
- { cc: clang, cxx: clang++ }
sanitizer: [address, undefined]
steps:
- name: Clone
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: 3.7
- name: Prepare Environment
run: |
python -m pip install --upgrade pip
pip install conan
cmake -E make_directory ${{env.build-directory}}
cmake -E chdir ${{env.build-directory}} conan install ..
- name: Configure
working-directory: ${{env.build-directory}}
env:
CC: ${{matrix.compiler.cc}}
CXX: ${{matrix.compiler.cxx}}
run: |
cmake .. \
-DCMAKE_BUILD_TYPE=Debug \
-DBACKPORT_COMPILE_UNIT_TESTS=On \
-DCMAKE_CXX_FLAGS="-fsanitize=${{matrix.sanitizer}}"
- name: Build
working-directory: ${{env.build-directory}}
run: cmake --build .
- name: Test (Sanitize)
working-directory: ${{env.build-directory}}
run: ctest --output-on-failure