Skip to content

Add sphinx docs

Add sphinx docs #80

Workflow file for this run

name: Run all linters
on:
pull_request:
branches: [ master, develop ]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
linter:
runs-on: ubuntu-latest
env:
LocalCommit: ${{ github.event.pull_request.head.repo.full_name == github.repository && github.actor != 'dependabot[bot]' }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.head_ref }}
token: ${{ secrets.LINTER_PAT }}
if: env.LocalCommit == 'true'
- uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.head_ref }}
if: env.LocalCommit != 'true'
- run: git fetch origin $GITHUB_BASE_REF
- name: Set Branch name
id: branch-name
run:
echo "branchName=$GITHUB_BASE_REF" >> $GITHUB_OUTPUT
- name: Format CMake files
id: cmake-format
uses: PuneetMatharu/[email protected]
with:
args: --config-files .cmake-format.py --in-place
- name: Define base git diff args
id: git-diff-args
run: |
echo "args=origin/${{steps.branch-name.outputs.branchName}}..HEAD" >> $GITHUB_OUTPUT
- name: Apply clang-format on changed files
run: |
changedFileList=`git diff ${{steps.git-diff-args.outputs.args}} --name-only --diff-filter=d -- '***.hpp' '***.cpp' '***.h' '***.c'`
for file in $changedFileList; do echo "Checking file " $file; clang-format --style=file -i $file; done
- name: Check if we have local changes
id: check-changes
shell: bash
run: |
if [[ -z $(git status --porcelain --untracked-files=no) ]]; then echo "ChangesFound=False" >> $GITHUB_OUTPUT; else echo "ChangesFound=True" >> $GITHUB_OUTPUT; fi
- name: setup git config
run: |
# setup the username and email. I tend to use 'GitHub Actions Bot' with no email by default
git config user.name "GitHub Actions Bot"
git config user.email "<>"
- name: Commit changes
if: steps.check-changes.outputs.ChangesFound == 'True' && env.LocalCommit == 'true'
run: |
git commit -am "Automatically applied linter"
git push
- name: Notify that changes are required
if: ${{ steps.check-changes.outputs.ChangesFound == 'True' && env.LocalCommit != 'true' }}
run: |
echo "Linter changes are required" >> $GITHUB_STEP_SUMMARY
exit 1