[CI] Move lint checks to a separate workflow

This commit is contained in:
Ray Speth 2023-08-03 10:29:31 -04:00 committed by Ray Speth
parent c86220ecfe
commit 2a0e4e95f3
2 changed files with 43 additions and 35 deletions

43
.github/workflows/linters.yml vendored Normal file
View File

@ -0,0 +1,43 @@
name: Linters
on:
pull_request:
# Build when a pull request targets main
branches:
- main
jobs:
linter:
name: Lint checks
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v3
name: Checkout the repository
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Check example keywords
run: python3 doc/example-keywords.py compare
- name: Get changed C++ files
id: changed-cxx-files
uses: tj-actions/changed-files@v37
with:
files: |
**.h
**.cpp
# Comment blocks starting with "/*!" do not support autobrief
- name: Check for problematic Doxygen comment blocks
if: steps.changed-cxx-files.outputs.any_changed == 'true'
run: |
RETCODE=0
for file in ${{ steps.changed-cxx-files.outputs.all_changed_files }}; do
RESULT=`perl -0777 -ne 'while(m/\n\n *\/\*!.*?\*\//gs){print "$&\n";}' $file`
if [ "$RESULT" ]; then
echo ------ ${file} ------
echo "$RESULT"
RETCODE=1
fi
done
exit $RETCODE

View File

@ -301,41 +301,6 @@ jobs:
files: ./coverage.xml,./build/pycov.xml,./interfaces/dotnet/coverage.cobertura.xml
fail_ci_if_error: true
linter:
name: Lint checks
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v3
name: Checkout the repository
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Check example keywords
run: python3 doc/example-keywords.py compare
- name: Get changed C++ files
id: changed-cxx-files
uses: tj-actions/changed-files@v37
with:
files: |
**.h
**.cpp
# Comment blocks starting with "/*!" do not support autobrief
- name: Check for problematic Doxygen comment blocks
if: steps.changed-cxx-files.outputs.any_changed == 'true'
run: |
RETCODE=0
for file in ${{ steps.changed-cxx-files.outputs.all_changed_files }}; do
RESULT=`perl -0777 -ne 'while(m/\n\n *\/\*!.*?\*\//gs){print "$&\n";}' $file`
if [ "$RESULT" ]; then
echo ------ ${file} ------
echo "$RESULT"
RETCODE=1
fi
done
exit $RETCODE
docs:
name: Build docs
runs-on: ubuntu-latest