diff --git a/.ci/build_doxygen.sh b/.ci/build_doxygen.sh deleted file mode 100644 index bd877d5..0000000 --- a/.ci/build_doxygen.sh +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/env sh -# (Source me) - -set -evx - -#DOXYGEN_URL="http://doxygen.nl/files/doxygen-1.8.17.src.tar.gz" -DOXYGEN_URL="https://github.com/doxygen/doxygen/archive/Release_1_8_15.tar.gz" -cd "${DEPS_DIR}" - -if [[ ! -f "${DEPS_DIR}/doxygen/build/bin/doxygen" ]] ; then - echo "Downloading Doxygen" - mkdir -p doxygen - travis_retry wget --no-check-certificate --quiet -O - "${DOXYGEN_URL}" | tar --strip-components=1 -xz -C doxygen - cd doxygen - mkdir -p build - cd build - cmake .. - make -j2 -fi - -export PATH="${DEPS_DIR}/doxygen/build/bin:${PATH}" - -cd "${TRAVIS_BUILD_DIR}" - -set +evx diff --git a/.ci/build_lcov.sh b/.ci/build_lcov.sh deleted file mode 100644 index 7232e99..0000000 --- a/.ci/build_lcov.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/env sh -# (Source me) -set -evx - -LCOV_URL="http://ftp.de.debian.org/debian/pool/main/l/lcov/lcov_1.13.orig.tar.gz" -cd "${DEPS_DIR}" - -if [[ ! -f "${DEPS_DIR}/lcov/bin/lcov" ]] ; then - echo "Downloading lcov" - mkdir -p lcov - travis_retry wget --no-check-certificate --quiet -O - "${LCOV_URL}" | tar --strip-components=1 -xz -C lcov -fi - -export PATH="${DEPS_DIR}/lcov/bin:${PATH}" -cd "${TRAVIS_BUILD_DIR}" - -set +evx diff --git a/.ci/make_and_test.sh b/.ci/make_and_test.sh deleted file mode 100755 index a52c946..0000000 --- a/.ci/make_and_test.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/usr/bin/env bash -echo -en "travis_fold:start:script.build\\r" -echo "Building..." -STD="$1" -shift -set -evx - - -mkdir -p build -cd build -cmake .. -DCLI11_WARNINGS_AS_ERRORS=ON -DCLI11_SINGLE_FILE=ON -DCMAKE_CXX_STANDARD="$STD" -DCLI11_SINGLE_FILE_TESTS=ON -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_COMPILER_LAUNCHER=ccache $@ -cmake --build . -- -j2 --keep-going - -set +evx -echo -en "travis_fold:end:script.build\\r" -echo -en "travis_fold:start:script.test\\r" -echo "Testing..." -set -evx - -ctest --output-on-failure - -set +evx -echo -en "travis_fold:end:script.test\\r" diff --git a/.ci/run_codecov.sh b/.ci/run_codecov.sh deleted file mode 100755 index fbc199c..0000000 --- a/.ci/run_codecov.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/usr/bin/env bash - -echo -en "travis_fold:start:script.build\\r" -echo "Building..." -set -evx - -cd "${TRAVIS_BUILD_DIR}" -mkdir -p build -cd build -cmake .. -DCLI11_SINGLE_FILE_TESTS=OFF -DCLI11_EXAMPLES=OFF -DCMAKE_BUILD_TYPE=Coverage -cmake --build . -- -j2 -cmake --build . --target CLI11_coverage - -set +evx -echo -en "travis_fold:end:script.build\\r" -echo -en "travis_fold:start:script.lcov\\r" -echo "Capturing and uploading LCov..." -set -evx - -lcov --directory . --capture --output-file coverage.info # capture coverage info -lcov --remove coverage.info '*/tests/*' '*/examples/*' '*gtest*' '*gmock*' '/usr/*' --output-file coverage.info # filter out system -lcov --list coverage.info #debug info -# Uploading report to CodeCov -bash <(curl -s https://codecov.io/bash) || echo "Codecov did not collect coverage reports" - -set +evx -echo -en "travis_fold:end:script.lcov\\r" diff --git a/.github/codecov.yml b/.github/codecov.yml new file mode 100644 index 0000000..a0b0667 --- /dev/null +++ b/.github/codecov.yml @@ -0,0 +1,7 @@ +codecov: + notify: + after_n_builds: 4 +coverage: + status: + project: + informational: true diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index efb15d2..1226caa 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -6,7 +6,55 @@ on: - v* pull_request: +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + jobs: + coverage: + name: Coverage + runs-on: ubuntu-latest + strategy: + matrix: + std: ["11", "14", "17", "20"] + steps: + - uses: actions/checkout@v3 + + - name: Get LCov + run: | + wget https://github.com/linux-test-project/lcov/releases/download/v1.16/lcov-1.16.tar.gz + tar -xzf lcov-1.16.tar.gz + cd lcov-1.16 + sudo make install + + - name: Configure + run: | + cmake -S . -B build \ + -DCMAKE_CXX_STANDARD=${{matrix.std}} \ + -DCLI11_SINGLE_FILE_TESTS=OFF \ + -DCLI11_EXAMPLES=OFF \ + -DCMAKE_BUILD_TYPE=Coverage + + - name: Build + run: cmake --build build -j4 + + - name: Test + run: cmake --build build --target CLI11_coverage + + - name: Prepare coverage + run: | + lcov --directory . --capture --output-file coverage.info + lcov --remove coverage.info '*/tests/*' '*/examples/*' '/usr/*' --output-file coverage.info + lcov --list coverage.info + working-directory: build + + - name: Upload coverage + run: | + curl -Os https://uploader.codecov.io/latest/linux/codecov + chmod +x codecov + ./codecov + working-directory: build + clang-tidy: name: Clang-Tidy runs-on: ubuntu-latest diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 11325d1..fd891ba 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -40,12 +40,12 @@ jobs: vmImage: "macOS-latest" cli11.std: 11 Windows17: - vmImage: "vs2017-win2016" + vmImage: "windows-2019" cli11.std: 17 Windows11: - vmImage: "vs2017-win2016" + vmImage: "windows-2019" cli11.std: 11 - Windowslatest: + WindowsLatest: vmImage: "windows-2019" cli11.std: 20 cli11.options: -DCMAKE_CXX_FLAGS="/std:c++latest /EHsc" diff --git a/scripts/MakeSingleHeader.py b/scripts/MakeSingleHeader.py index 6eaf749..4bc53dd 100755 --- a/scripts/MakeSingleHeader.py +++ b/scripts/MakeSingleHeader.py @@ -4,7 +4,7 @@ from __future__ import print_function, unicode_literals import os import re -from argparse import ArgumentParser +import argparse from subprocess import Popen, PIPE import warnings @@ -128,8 +128,9 @@ def make_header(output, main_header, files, tag, namespace, macro=None, version= if __name__ == "__main__": - parser = ArgumentParser( - usage="Convert source to single header include. Can optionally add namespace and search-replace replacements (for macros)." + parser = argparse.ArgumentParser( + usage="Convert source to single header include. Can optionally add namespace and search-replace replacements (for macros).", + formatter_class=argparse.ArgumentDefaultsHelpFormatter, ) parser.add_argument("--output", default=None, help="Single header file output") parser.add_argument( @@ -137,7 +138,7 @@ if __name__ == "__main__": default="CLI11.hpp.in", help="The main include file that defines the other files", ) - parser.add_argument("files", nargs="*", help="The header files") + parser.add_argument("files", nargs="+", help="The header files") parser.add_argument("--namespace", default="CLI", help="Set the namespace") parser.add_argument("--tag", default="CLI11", help="Tag to look up") parser.add_argument(