Advertisement
Guest User

Untitled

a guest
May 20th, 2022
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 4.65 KB | None | 0 0
  1. name: Continuous Integration
  2.  
  3. on:
  4.   push:
  5.     branches:
  6.    - master
  7.  
  8.   pull_request:
  9.     branches:
  10.    - master
  11.  
  12. env:
  13.   VCPKG_COMMIT: "bae8f8c7d837c631ca72daec4b14e243824135a5"
  14.  
  15. jobs:
  16.   lint:
  17.     runs-on: ubuntu-latest
  18.  
  19.     steps:
  20.     - uses: actions/checkout@v2
  21.  
  22.     - uses: actions/setup-python@v2
  23.       with: { python-version: "3.8" }
  24.  
  25.     - name: Install codespell
  26.       run: pip3 install codespell
  27.  
  28.     - name: Lint
  29.       run: cmake -D FORMAT_COMMAND=clang-format-12 -P cmake/lint.cmake
  30.  
  31.     - name: Spell check
  32.       if: always()
  33.       run: cmake -P cmake/spell.cmake
  34.  
  35.   coverage:
  36.     needs: [lint]
  37.  
  38.     runs-on: ubuntu-latest
  39.  
  40.     # To enable coverage, delete the last line from the conditional below and
  41.     # edit the "<name>" placeholder to your GitHub name.
  42.     # If you do not wish to use codecov, then simply delete this job from the
  43.     # workflow.
  44.     if: github.repository_owner == '<name>'
  45.       && false
  46.  
  47.     steps:
  48.     - uses: actions/checkout@v2
  49.  
  50.     - name: Install LCov
  51.       run: sudo apt-get update -q
  52.         && sudo apt-get install lcov -q -y
  53.  
  54.     - name: Install vcpkg
  55.       uses: friendlyanon/setup-vcpkg@v1
  56.       with: { committish: ${{ env.VCPKG_COMMIT }} }
  57.  
  58.     - name: Configure
  59.       run: cmake --preset=ci-coverage
  60.  
  61.     - name: Build
  62.       run: cmake --build build/coverage -j 2
  63.  
  64.     - name: Test
  65.       working-directory: build/coverage
  66.       run: ctest --output-on-failure -j 2
  67.  
  68.     - name: Process coverage info
  69.       run: cmake --build build/coverage -t coverage
  70.  
  71.     - name: Submit to codecov.io
  72.       uses: codecov/codecov-action@v1
  73.       with:
  74.         file: build/coverage/coverage.info
  75.  
  76.   sanitize:
  77.     needs: [lint]
  78.  
  79.     runs-on: ubuntu-latest
  80.  
  81.     steps:
  82.     - uses: actions/checkout@v2
  83.  
  84.     - name: Install vcpkg
  85.       uses: friendlyanon/setup-vcpkg@v1
  86.       with: { committish: ${{ env.VCPKG_COMMIT }} }
  87.  
  88.     - name: Configure
  89.       env: { CXX: clang++-12 }
  90.       run: cmake --preset=ci-sanitize
  91.  
  92.     - name: Build
  93.       run: cmake --build build/sanitize -j 2
  94.  
  95.     - name: Test
  96.       working-directory: build/sanitize
  97.       env:
  98.         ASAN_OPTIONS: "strict_string_checks=1:\
  99.          detect_stack_use_after_return=1:\
  100.          check_initialization_order=1:\
  101.          strict_init_order=1:\
  102.          detect_leaks=1"
  103.         UBSAN_OPTIONS: print_stacktrace=1
  104.       run: ctest --output-on-failure -j 2
  105.  
  106.   test:
  107.     needs: [lint]
  108.  
  109.     strategy:
  110.       matrix:
  111.         os: [macos-latest, ubuntu-latest, windows-2022]
  112.  
  113.     runs-on: ${{ matrix.os }}
  114.  
  115.     steps:
  116.     - uses: actions/checkout@v2
  117.  
  118.     - name: Install static analyzers
  119.       if: matrix.os == 'ubuntu-latest'
  120.       run: sudo apt-get install clang-tidy cppcheck -y -q
  121.  
  122.     - name: Install vcpkg
  123.       uses: friendlyanon/setup-vcpkg@v1
  124.       with: { committish: ${{ env.VCPKG_COMMIT }} }
  125.  
  126.     - name: Configure
  127.       shell: pwsh
  128.       run: cmake "--preset=ci-$("${{ matrix.os }}".split("-")[0])"
  129.  
  130.     - name: Build
  131.       run: cmake --build build --config Release -j 2
  132.  
  133.     - name: Install
  134.       run: cmake --install build --config Release --prefix prefix
  135.  
  136.     - name: Test
  137.       working-directory: build
  138.       run: ctest --output-on-failure -C Release -j 2
  139.  
  140.   docs:
  141.    # Deploy docs only when builds succeed
  142.     needs: [sanitize, test]
  143.  
  144.     runs-on: ubuntu-latest
  145.  
  146.     # To enable, first you have to create an orphaned gh-pages branch:
  147.     #
  148.     #    git switch --orphan gh-pages
  149.     #    git commit --allow-empty -m "Initial commit"
  150.     #    git push -u origin gh-pages
  151.     #
  152.     # Edit the <name> placeholder below to your GitHub name, so this action
  153.     # runs only in your repository and no one else's fork. After these, delete
  154.     # this comment and the last line in the conditional below.
  155.     # If you do not wish to use GitHub Pages for deploying documentation, then
  156.     # simply delete this job similarly to the coverage one.
  157.     if: github.ref == 'refs/heads/master'
  158.       && github.event_name == 'push'
  159.       && github.repository_owner == '<name>'
  160.       && false
  161.  
  162.     steps:
  163.     - uses: actions/checkout@v2
  164.  
  165.     - uses: actions/setup-python@v2
  166.       with: { python-version: "3.8" }
  167.  
  168.     - name: Install m.css dependencies
  169.       run: pip3 install jinja2 Pygments
  170.  
  171.     - name: Install Doxygen
  172.       run: sudo apt-get update -q
  173.         && sudo apt-get install doxygen -q -y
  174.  
  175.     - name: Build docs
  176.       run: cmake "-DPROJECT_SOURCE_DIR=$PWD" "-DPROJECT_BINARY_DIR=$PWD/build"
  177.         -P cmake/docs-ci.cmake
  178.  
  179.     - name: Deploy docs
  180.       uses: peaceiris/actions-gh-pages@v3
  181.       with:
  182.         github_token: ${{ secrets.GITHUB_TOKEN }}
  183.         publish_dir: build/docs/html
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement