Skip to content

Commit

Permalink
Fix documentation generation
Browse files Browse the repository at this point in the history
  • Loading branch information
mkorbel1 committed Feb 26, 2024
1 parent 302e9f9 commit 64e8d10
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 38 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/general.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,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
29 changes: 0 additions & 29 deletions tool/gh_actions/check_documentation.sh

This file was deleted.

23 changes: 16 additions & 7 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,12 +11,21 @@

set -euo pipefail

# See script "check_documentation.sh" for a note on processing "dart doc" output.
# 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

# The documentation will be placed in the "doc/api" folder.
output=$(dart doc --validate-links 2>&1 | tee)

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

# 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 64e8d10

Please sign in to comment.