2020-11-06 15:36:26 +01:00
|
|
|
name: Check header guards
|
|
|
|
|
|
|
|
on: [push, pull_request]
|
|
|
|
|
|
|
|
jobs:
|
2020-11-06 23:00:37 +01:00
|
|
|
build:
|
2020-11-06 15:36:26 +01:00
|
|
|
# Set the type of machine to run on
|
2020-11-28 21:36:47 +01:00
|
|
|
runs-on: ubuntu-20.04
|
2020-11-06 15:36:26 +01:00
|
|
|
steps:
|
2020-11-06 23:00:37 +01:00
|
|
|
|
|
|
|
- name: Checkout source code
|
2023-11-09 10:31:49 +01:00
|
|
|
uses: actions/checkout@v4
|
2020-11-06 15:36:26 +01:00
|
|
|
|
|
|
|
- name: Setup Dependencies
|
|
|
|
uses: actions/setup-python@v2
|
|
|
|
with:
|
|
|
|
python-version: '3.7'
|
|
|
|
- name: Install checkguard
|
|
|
|
run: pip install guardonce
|
|
|
|
|
2020-11-10 15:25:24 +01:00
|
|
|
- name: Check that include guards are properly named
|
2020-11-06 15:36:26 +01:00
|
|
|
run: |
|
|
|
|
wrong_files=$(checkguard -r src/catch2/ -p "name | append _INCLUDED | upper")
|
|
|
|
if [[ $wrong_files ]]; then
|
|
|
|
echo "Files with wrong header guard:"
|
|
|
|
echo $wrong_files
|
|
|
|
exit 1
|
|
|
|
fi
|
2020-11-06 23:00:37 +01:00
|
|
|
|
2020-11-10 15:25:24 +01:00
|
|
|
- name: Check that there are no duplicated filenames
|
2020-11-06 23:00:37 +01:00
|
|
|
run: |
|
2020-11-10 15:25:52 +01:00
|
|
|
./tools/scripts/checkDuplicateFilenames.py
|
2020-11-10 15:25:24 +01:00
|
|
|
|
|
|
|
- name: Check that all source files have the correct license header
|
2020-11-07 21:55:47 +01:00
|
|
|
run: |
|
2020-11-10 15:25:52 +01:00
|
|
|
./tools/scripts/checkLicense.py
|