Skip to content

Commit

Permalink
Fix documentation generation (#81)
Browse files Browse the repository at this point in the history
  • Loading branch information
mkorbel1 authored Feb 26, 2024
1 parent fc7ece0 commit 1d96e0f
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 43 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/general.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:
run: tool/gh_actions/analyze_source.sh

- name: Check project documentation
run: tool/gh_actions/check_documentation.sh
run: tool/gh_actions/generate_documentation.sh

- name: Run project tests
run: tool/gh_actions/run_tests.sh
Expand Down
32 changes: 0 additions & 32 deletions tool/gh_actions/check_documentation.sh

This file was deleted.

23 changes: 14 additions & 9 deletions tool/gh_actions/generate_documentation.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

# Copyright (C) 2022-2023 Intel Corporation
# Copyright (C) 2022-2024 Intel Corporation
# SPDX-License-Identifier: BSD-3-Clause
#
# generate_documentation.sh
Expand All @@ -11,16 +11,21 @@

set -euo pipefail

# See script "check_documentation.sh" for a note on processing "dart doc" output.

# The documentation will be placed in the "doc/api" folder.
# Output parsing is required because "dart doc" is not capable of
# signaling a warning with an exit code:
# https://github.com/dart-lang/dartdoc/issues/2846
# https://github.com/dart-lang/dartdoc/issues/2907
# https://github.com/dart-lang/dartdoc/issues/1959

# Disabling --validate-links due to https://github.com/dart-lang/dartdoc/issues/3584
# output=$(dart doc --validate-links 2>&1 | tee)

# We want relative link paths to be OK in the README
output=$(dart doc 2>&1 | tee)

echo "${output}"

# In case of problems, the searched substring will not be found.
echo "${output}" | grep --silent 'no issues found'
if echo "${output}" | grep --silent -e 'no issues found' -e 'Success!'; then
echo 'Documentation check passed!'
else
echo "${output}"
echo 'Documentation failed since some issues were found'
exit 1
fi
2 changes: 1 addition & 1 deletion tool/run_checks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ tool/gh_actions/analyze_source.sh

# Check project documentation
print_step 'Check project documentation'
tool/gh_actions/check_documentation.sh
tool/gh_actions/generate_documentation.sh

# Run project tests
print_step 'Run project tests'
Expand Down

0 comments on commit 1d96e0f

Please sign in to comment.