This repository has been archived by the owner on Oct 27, 2024. It is now read-only.
Bump actions/checkout from 3 to 4 #14
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
name: 🧹 Format Code Base | |
on: | |
pull_request: | |
branches: | |
- main | |
permissions: read-all | |
jobs: | |
format-source: | |
name: Check syntax in source files | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 1 | |
- name: Install clang-format | |
run: sudo apt install --no-install-recommends clang-format | |
- name: Test syntax | |
run: | | |
if [[ $(clang-format --dry-run -style=file **/*.h **/*.c) ]]; | |
then | |
echo "Code isn't following the syntax convention of this project." | |
exit 1 | |
fi | |
format-python: | |
name: Check syntax in python files | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 1 | |
- name: Setup Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.x | |
architecture: x64 | |
- name: Install autopep8 | |
run: | | |
python -m pip install autopep8 | |
- name: Test syntax | |
run: | | |
if [[ $(python -m autopep8 -a --diff --experimental --max-line-length=99 **/*.py) ]]; | |
then | |
echo "Code isn't following the syntax convention of this project." | |
exit 1 | |
fi | |
format-cmake: | |
name: Check syntax in CMake files | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 1 | |
- name: Setup Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.x | |
architecture: x64 | |
- name: Install cmakelang | |
run: | | |
python -m pip install cmakelang | |
- name: Test syntax | |
run: | | |
if [[ $(python -m cmake-format --check **/CMakeLists.txt) ]]; | |
then | |
echo "Code isn't following the syntax convention of this project." | |
exit 1 | |
fi |