2020-07-13 11:11:21 -04:00
|
|
|
# This workflow does some quick checks.
|
|
|
|
name: Code Checks
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
2022-07-03 19:32:51 -04:00
|
|
|
- 3.2
|
2020-07-13 11:11:21 -04:00
|
|
|
pull_request:
|
|
|
|
branches:
|
2022-07-03 19:32:51 -04:00
|
|
|
- 3.2
|
2020-07-13 11:11:21 -04:00
|
|
|
|
2022-06-26 20:33:51 -04:00
|
|
|
permissions:
|
|
|
|
contents: read
|
|
|
|
|
2020-07-13 11:11:21 -04:00
|
|
|
jobs:
|
|
|
|
check-unix:
|
|
|
|
runs-on: ubuntu-20.04
|
|
|
|
name: Check Spelling
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
2022-12-17 21:22:54 -05:00
|
|
|
uses: actions/checkout@v3
|
2020-07-13 11:11:21 -04:00
|
|
|
|
|
|
|
- name: Install codespell
|
|
|
|
run: |
|
2020-07-13 11:38:01 -04:00
|
|
|
pip3 install --no-warn-script-location codespell==1.17.1
|
2020-07-13 11:11:21 -04:00
|
|
|
|
|
|
|
- name: Run codespell
|
|
|
|
run: |
|
2020-07-18 13:49:21 -04:00
|
|
|
CODESPELL=$HOME/.local/bin/codespell ./misc/scripts/spellcheck
|
2020-09-27 20:43:26 -04:00
|
|
|
|
|
|
|
|
|
|
|
check-whitespace:
|
|
|
|
runs-on: ubuntu-20.04
|
|
|
|
name: Check Whitespace
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
2022-12-17 21:22:54 -05:00
|
|
|
uses: actions/checkout@v3
|
2020-09-27 20:43:26 -04:00
|
|
|
|
|
|
|
- name: Check for trailing whitespace and TABs
|
|
|
|
run: |
|
2022-08-18 17:31:58 -04:00
|
|
|
git fetch --depth=1 origin 3.2
|
2020-09-27 20:43:26 -04:00
|
|
|
git -c core.whitespace=blank-at-eol,blank-at-eof,space-before-tab,cr-at-eol,tab-in-indent \
|
2022-08-18 17:31:58 -04:00
|
|
|
diff --check origin/3.2 \
|
2021-07-17 14:41:18 -04:00
|
|
|
':!.gitmodules' \
|
2020-10-05 20:14:46 -04:00
|
|
|
':!Makefile.in' \
|
|
|
|
':!config.guess' \
|
|
|
|
':!config.sub' \
|
|
|
|
':!configure' \
|
|
|
|
':!descrip.mms' \
|
|
|
|
':!install-sh' \
|
2022-07-02 10:49:25 -04:00
|
|
|
':!docs/doxygen/doxygen-awesome-css/*' \
|
2023-07-25 16:10:39 -04:00
|
|
|
':!samples/widgets/widgets.bkl' \
|
2020-10-05 20:14:46 -04:00
|
|
|
':!**/*akefile*' \
|
2021-03-15 06:35:50 -04:00
|
|
|
':!**/*.pbxproj' \
|
2021-08-15 11:08:31 -04:00
|
|
|
':!**/Info*.plist*' \
|
2020-10-05 20:14:46 -04:00
|
|
|
':!**/*.sln' \
|
|
|
|
':!**/*.vcproj' \
|
|
|
|
':!**/*.xpm'
|
2021-02-09 15:03:54 -05:00
|
|
|
|
|
|
|
|
|
|
|
check-mixed-eol:
|
|
|
|
runs-on: ubuntu-20.04
|
|
|
|
name: Check Mixed EOL
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
2022-12-17 21:22:54 -05:00
|
|
|
uses: actions/checkout@v3
|
2021-02-09 15:03:54 -05:00
|
|
|
|
|
|
|
- name: Install dos2unix
|
|
|
|
run: |
|
|
|
|
sudo apt-get install -y dos2unix
|
|
|
|
|
|
|
|
- name: Check for mixed EOL
|
|
|
|
run: |
|
|
|
|
./misc/scripts/check_mixed_eol.sh
|
2023-01-31 09:06:47 -05:00
|
|
|
|
|
|
|
check-cxx-style:
|
|
|
|
runs-on: ubuntu-20.04
|
|
|
|
name: Check C++ Style
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
|
|
|
|
- name: Check for C++11 keywords
|
|
|
|
run: |
|
2023-01-31 09:12:02 -05:00
|
|
|
git fetch --depth=1 origin 3.2
|
|
|
|
if git diff origin/3.2 \
|
2023-01-31 09:06:47 -05:00
|
|
|
':!.github/workflows/code_checks.yml' \
|
|
|
|
':!src/stc/scintilla/' \
|
2023-02-08 14:42:11 -05:00
|
|
|
| sed 's@//.*@@' \
|
2023-01-31 09:06:47 -05:00
|
|
|
| grep -E '(override|noexcept|nullptr[^_])'; then
|
|
|
|
echo "::error ::Please use C++98 equivalents of the C++11 keywords in this branch."
|
|
|
|
exit 1
|
|
|
|
fi
|