Verified Commit 86b78f4c authored by Adrian DC's avatar Adrian DC
Browse files

docs(mkdocs): embed coverage HTML page with 'mkdocs-coverage'

Signed-off-by: default avatarAdrian DC <radian.dc@gmail.com>
parent 512d3900
Loading
Loading
Loading
Loading
Loading
+5 −2
Changes for .gitlab-ci.yml: 5 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -859,10 +859,10 @@ pages:
      artifacts: false
      optional: true
    - job: coverage:linux
      artifacts: false
      artifacts: true
      optional: true
    - job: coverage:windows
      artifacts: false
      artifacts: true
      optional: true
    - job: py3.8
      artifacts: false
@@ -872,6 +872,9 @@ pages:
      optional: true
  variables:
    CI_LOCAL_NETWORK: 'host'
    COVERAGE_FILE: !reference [.coverage-scripts, variables, COVERAGE_COMMON_FILE]
    COVERAGE_FOLDER: !reference [.coverage-scripts, variables, COVERAGE_FOLDER]
    COVERAGE_RCFILE: !reference [.coverage-scripts, variables, COVERAGE_RCFILE]
    MKDOCS_EXPORTER_PDF_ENABLED: 'true'
    MKDOCS_EXPORTER_PDF_OUTPUT: 'gitlab-projects-settings'
  script:
+1 −0
Changes for docs/.pages.in: 1 added line, 0 removed lines.
Original line number Diff line number Diff line
@@ -4,6 +4,7 @@ nav:
      - ‣ Usage: index.md
  - About:
      - ‣ Changelog: about/changelog/
      - ‣ Coverage: about/coverage/
      - ‣ License: about/license/
      - ‣ Quality: about/quality/
      - ‣ Export as PDF: %MKDOCS_EXPORTER_PDF_OUTPUT%
+7 −0
Changes for docs/prepare.sh: 7 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -241,6 +241,13 @@ diff -u "${root_path}/CHANGELOG.md" "${docs_path}/about/changelog.md" || true
  done
} >"${docs_path}/about/quality.md"

# Generate about/coverage
rm -rf "${COVERAGE_FOLDER}/html"
if ls "${COVERAGE_FOLDER}/.coverage-"* >/dev/null 2>&1; then
  coverage combine --keep "${COVERAGE_FOLDER}/.coverage-"*
fi
coverage html --directory "${COVERAGE_FOLDER}/html" --precision=2 --skip-empty

# Show documentations
echo ' '
ls -laR "${docs_path}/"
+3 −0
Changes for mkdocs.yml: 3 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -75,6 +75,9 @@ plugins:
      collapse_single_pages: false
      filename: .pages
      strict: true
  - coverage:
      page_path: about/coverage
      html_report_dir: coverage-reports/html
  - git-revision-date-localized:
      enable_creation_date: true
      fallback_to_build_date: true