From 727e4b32fd642c9e7e4ff303b5d2f4fab9bc5f58 Mon Sep 17 00:00:00 2001 From: owent Date: Sun, 6 Jun 2021 23:39:06 +0800 Subject: [PATCH] Fix document builder Signed-off-by: owent --- .github/workflows/main.yml | 37 +++++++++++++++++++++ README.rst | 66 +++++++++++++++++++++++--------------- ci/do_ci.sh | 19 +++++++++++ codecov.yml | 4 +-- 4 files changed, 98 insertions(+), 28 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 718b1bb..adc9338 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -18,6 +18,43 @@ jobs: shell: bash run: | bash ci/do_ci.sh format ; + document: # job id, can be any string + name: Document + # This job runs on Linux + strategy: + matrix: + include: + - os: ubuntu-latest + triplet: x64-linux + cc: gcc + runs-on: ${{ matrix.os }} + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Build & Test + shell: bash + run: | + sudo apt-get update ; + sudo apt-get install --no-install-recommends --no-install-suggests -y doxygen graphviz ; + bash ci/do_ci.sh document ; + - name: Deploy + if: ${{ github.event_name == 'push' }} + env: + COMMIT_REF: ${{ github.ref }} + DOCUMENT_DEPLOY_KEY: ${{ secrets.DOCUMENT_DEPLOY_KEY }} + shell: bash + run: | + cd docs/output ; + git config --global init.defaultBranch main ; + git init ; + git add . ; + mkdir -p $HOME/.ssh ; + chmod 700 $HOME/.ssh ; + echo "$DOCUMENT_DEPLOY_KEY" > $HOME/.ssh/deploy.key ; + chmod 600 $HOME/.ssh/deploy.key ; + export GIT_SSH_COMMAND="ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o IdentityFile=$HOME/.ssh/deploy.key" ; + git -c user.name='owent' -c user.email='admin@owent.net' commit -m "Delpoy document for $COMMIT_REF"; + git push -f -q git@github.com:owent/libcopp-doc.git HEAD:main ; unix_build: # job id, can be any string name: Unix Build # This job runs on Linux diff --git a/README.rst b/README.rst index c573224..f893ef6 100644 --- a/README.rst +++ b/README.rst @@ -13,59 +13,73 @@ libcopp Cross-platform coroutine library in C++ . -.. image:: https://img.shields.io/github/v/release/owent/libcopp - -.. image:: https://img.shields.io/github/languages/code-size/owent/libcopp -.. image:: https://img.shields.io/github/repo-size/owent/libcopp .. image:: https://img.shields.io/github/forks/owent/libcopp?style=social .. image:: https://img.shields.io/github/stars/owent/libcopp?style=social -|ci-badge| -|codecov-badge| -|lgtm-badge| +.. |release-badge| image:: https://img.shields.io/github/v/release/owent/libcopp + :alt: Release + :target: https://github.com/owent/libcopp/releases + +.. |code-size-badge| image:: https://img.shields.io/github/languages/code-size/owent/libcopp + :alt: Code size + :target: https://github.com/owent/libcopp + +.. |repo-size-badge| image:: https://img.shields.io/github/repo-size/owent/libcopp + :alt: Repo size + :target: https://github.com/owent/libcopp + +.. |forks-badge| image:: https://img.shields.io/github/forks/owent/libcopp?style=social + :alt: Forks + :target: https://github.com/owent/libcopp + +.. |stars-badge| image:: https://img.shields.io/github/stars/owent/libcopp?style=social + :alt: Stars + :target: https://github.com/owent/libcopp .. |ci-badge| image:: https://github.com/owent/libcopp/actions/workflows/main.yml/badge.svg - :alt: Travis build status + :alt: CI build status :target: https://github.com/owent/libcopp/actions/workflows/main.yml .. |codecov-badge| image:: https://codecov.io/gh/owent/libcopp/branch/v2/graph/badge.svg - :alt: Coveralls coverage - :target: https://codecov.io/gh/owent/libcopp + :alt: Coveralls coverage + :target: https://codecov.io/gh/owent/libcopp .. |lgtm-badge| image:: https://img.shields.io/lgtm/grade/cpp/g/owent/libcopp.svg?logo=lgtm&logoWidth=18 - :alt: Language grade: C/C++ - :target: https://lgtm.com/projects/g/owent/libcopp/context:cpp + :alt: Language grade: C/C++ + :target: https://lgtm.com/projects/g/owent/libcopp/context:cpp + +|release-badge| |code-size-badge| |repo-size-badge| |ci-badge| |codecov-badge| |lgtm-badge| |forks-badge| |stars-badge| CI Job Matrix ---------------- -|+++++++++++++++|++++++++++++++++++++|+++++++++++++++++++++++| ++---------------+--------------------+-----------------------+ | Target System | Toolchain | Note | -|===============|====================|=======================| ++===============+====================+=======================+ | Linux | GCC | Static linking | -|---------------|--------------------|-----------------------| ++---------------+--------------------+-----------------------+ | Linux | GCC | Dynamic linking | -|---------------|--------------------|-----------------------| ++---------------+--------------------+-----------------------+ | Linux | GCC-latest | | -|---------------|--------------------|-----------------------| ++---------------+--------------------+-----------------------+ | Linux | GCC-latest | No Exception | -|---------------|--------------------|-----------------------| ++---------------+--------------------+-----------------------+ | Linux | GCC-latest | Thread Unsafe | -|---------------|--------------------|-----------------------| ++---------------+--------------------+-----------------------+ | Linux | GCC 4.8 | Legacy | -|---------------|--------------------|-----------------------| ++---------------+--------------------+-----------------------+ | Linux | Clang-latest | With libc++ | -|---------------|--------------------|-----------------------| ++---------------+--------------------+-----------------------+ | MinGW64 | GCC | Dynamic linking | -|---------------|--------------------|-----------------------| ++---------------+--------------------+-----------------------+ | Windows | Visual Studio 2019 | Static linking | -|---------------|--------------------|-----------------------| ++---------------+--------------------+-----------------------+ | Windows | Visual Studio 2019 | Dynamic linking | -|---------------|--------------------|-----------------------| ++---------------+--------------------+-----------------------+ | Windows | Visual Studio 2017 | Legacy,Static linking | -|---------------|--------------------|-----------------------| ++---------------+--------------------+-----------------------+ | macOS | AppleClang | With libc++ | -|---------------|--------------------|-----------------------| ++---------------+--------------------+-----------------------+ LICENSE ------------ diff --git a/ci/do_ci.sh b/ci/do_ci.sh index 33e8117..5929d4f 100644 --- a/ci/do_ci.sh +++ b/ci/do_ci.sh @@ -100,6 +100,25 @@ elif [[ "$1" == "msys2.mingw.test" ]]; then cmake .. -G 'MinGW Makefiles' ${PROJECT_ADDON_OPTIONS[@]} \ -DLIBCOPP_MACRO_ENABLE_STD_COROUTINE=OFF -DLIBCOPP_MACRO_USE_STD_EXPERIMENTAL_COROUTINE=OFF ; cmake --build . -j2 || cmake --build . ; +elif [[ "$1" == "document" ]]; then + mkdir -p build_for_doxygen ; + cd build_for_doxygen ; + export PATH="$HOME/.local/bin:$PATH" ; + cmake .. -DCMAKE_BUILD_TYPE=RelWithDebInfo -DLIBCOPP_FCONTEXT_USE_TSX=ON -DPROJECT_ENABLE_UNITTEST=ON -DPROJECT_ENABLE_SAMPLE=ON ; + cd ../docs ; + python3 -m pip install --user --upgrade pip; + python3 -m pip install --user --upgrade -r requirements.txt; + mkdir -p sphinx/doxygen ; + doxygen libcopp.doxyfile; + du -sh sphinx/doxygen/* ; + sphinx-build -b html -a -D breathe_projects.libcopp=doxygen/xml sphinx output; + if [[ -e "output/doxygen/html" ]]; then + rm -rf "output/doxygen/html"; + fi + mkdir -p output/doxygen/ ; + mv -f "sphinx/doxygen/html" "output/doxygen/html"; + echo "libcopp.atframe.work" > output/CNAME ; + exit 0; else echo "Bad configure"; exit 1; diff --git a/codecov.yml b/codecov.yml index f965fa0..e3b27b6 100644 --- a/codecov.yml +++ b/codecov.yml @@ -1,6 +1,6 @@ ignore: - "**/third_party/**" - - "**/sample/**" - - "**/test/**" + - "**/sample/*" + - "**/test/**/*" - "**/tools/**" - "**/build_jobs_coverage/CMakeFiles/**" \ No newline at end of file