-
Notifications
You must be signed in to change notification settings - Fork 82
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3233 from eseiler/infra/check_markdown
[INFRA] Check markdown files for doxygen
- Loading branch information
Showing
6 changed files
with
86 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,41 @@ | ||
# SPDX-FileCopyrightText: 2006-2024 Knut Reinert & Freie Universität Berlin | ||
# SPDX-FileCopyrightText: 2016-2024 Knut Reinert & MPI für molekulare Genetik | ||
# SPDX-License-Identifier: CC0-1.0 | ||
name: REUSE Compliance Check | ||
|
||
name: License | ||
|
||
on: | ||
push: | ||
branches: | ||
- 'main' | ||
- 'main' | ||
pull_request: | ||
types: | ||
- unlabeled | ||
workflow_dispatch: | ||
|
||
concurrency: | ||
group: license-${{ github.event.pull_request.number || github.ref }} | ||
cancel-in-progress: ${{ github.event_name != 'push' }} | ||
|
||
env: | ||
TZ: Europe/Berlin | ||
|
||
defaults: | ||
run: | ||
shell: bash -Eexuo pipefail {0} | ||
|
||
jobs: | ||
license_check: | ||
runs-on: ubuntu-latest | ||
check: | ||
name: REUSE Compliance | ||
runs-on: ubuntu-22.04 | ||
timeout-minutes: 120 | ||
if: github.repository_owner == 'seqan' || github.event_name == 'workflow_dispatch' || github.event.label.name == 'lint' | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: REUSE Compliance Check | ||
uses: fsfe/reuse-action@v2 | ||
with: | ||
args: --suppress-deprecation lint | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: REUSE Compliance Check | ||
uses: fsfe/reuse-action@v2 | ||
|
||
- name: Check Markdown files for doxygen | ||
run: ${{ github.workspace }}/test/scripts/check_markdown_doxygen.sh ${{ github.workspace }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
#!/usr/bin/env bash | ||
# SPDX-FileCopyrightText: 2006-2024, Knut Reinert & Freie Universität Berlin | ||
# SPDX-FileCopyrightText: 2016-2024, Knut Reinert & MPI für molekulare Genetik | ||
# SPDX-License-Identifier: BSD-3-Clause | ||
# | ||
# Usage: check_markdown_doxygen.sh <SeqAn3 root directory> | ||
# | ||
# Checks that all markdown files start with a markdown header. | ||
# This is important for Doxygen to correctly parse the markdown files. | ||
|
||
ANY_FAIL=0 | ||
|
||
do_check () | ||
{ | ||
IS_CORRECT=$(head -n1 "$1" | grep -c "^#" || true) | ||
if [[ $IS_CORRECT -eq 0 ]]; then | ||
echo 'File does not start with a markdown header:' $1 | ||
ANY_FAIL=1 | ||
fi | ||
} | ||
|
||
if [[ $# -ne 1 ]]; then | ||
echo "Usage: check_markdown_doxygen.sh <SeqAn3 root directory>" | ||
exit 1 | ||
fi | ||
|
||
SEQAN3_ROOT=$(readlink -f "$1") | ||
|
||
if [[ ! -d ${SEQAN3_ROOT} ]]; then | ||
echo "The directory ${SEQAN3_ROOT} does not exist." | ||
exit 1 | ||
fi | ||
|
||
if [[ ! -f ${SEQAN3_ROOT}/include/seqan3/version.hpp ]]; then | ||
echo "The directory ${SEQAN3_ROOT} does not seem to be the SeqAn3 root directory." | ||
echo "Cannot find ${SEQAN3_ROOT}/include/seqan3/version.hpp." | ||
exit 1 | ||
fi | ||
|
||
for FILE in $(find "${SEQAN3_ROOT}/doc" -name "*.md" -and -not -path "${SEQAN3_ROOT}/doc/fragments/*") | ||
do | ||
do_check $FILE | ||
done | ||
|
||
for FILE in $(find "${SEQAN3_ROOT}" -maxdepth 1 -name "*.md") | ||
do | ||
do_check $FILE | ||
done | ||
|
||
exit $ANY_FAIL |