Auto-doc is formatting and documenting code #16
This file contains hidden or 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: Auto-doc (ascend-nasa-asu) | |
| run-name: Auto-doc is formatting and documenting code | |
| on: | |
| push: | |
| branches: | |
| - main | |
| jobs: | |
| format: | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| shell: bash | |
| working-directory: ./scripts | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| token: ${{ secrets.BOT_AUTH }} | |
| fetch-depth: 0 | |
| - name: Install clang-format | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install clang-format | |
| - name: Checkout branch | |
| run: | | |
| git checkout main | |
| git pull | |
| git status | |
| - name: Run formatting script | |
| run: | |
| bash standardizeFormat.sh | |
| - name: Push formatting changes to repo | |
| run: | | |
| git config user.name "autoformatter[bot]" | |
| git config user.email "autoformatter[bot]@users.noreply.github.com" | |
| git status | |
| if [ "$(git diff)" = "" ]; then | |
| echo "No formatting needed" | |
| else | |
| git add .. | |
| git commit -m "[bot] - autoformatted code" | |
| git push | |
| fi | |
| # - name: Checkout docs | |
| # uses: actions/checkout@v4 | |
| # with: | |
| # token: ${{ secrets.BOT_AUTH }} | |
| # ref: docs | |
| - name: Checkout docs branch | |
| run: | | |
| git checkout docs | |
| git pull | |
| git status | |
| - name: Merge main into docs with theirs strategy | |
| run: | | |
| git fetch origin main | |
| git branch -v | |
| git merge -X theirs main | |
| - name: Install Doxygen and Graphviz | |
| run: | | |
| sudo apt-get install doxygen | |
| sudo apt install graphviz | |
| - name: Clean old docs | |
| run: | | |
| mkdir -p ../docs | |
| rm -rf ../docs/* | |
| - name: Run doxygen on ascendfsw | |
| run: | |
| doxygen fswDoxyfile | |
| - name: Move docs_src to /docs/ | |
| run: | | |
| mkdir -p ../docs/images/ | |
| cp ../docs_src/images/* ../docs/images/ | |
| # - name: Pull everything out of html folder | |
| # run: | | |
| # mv ../docs/html/* ../docs/ | |
| # rmdir ../docs/html | |
| - name: Push documentation changes to repo | |
| run: | | |
| git config user.name "autodoc[bot]" | |
| git config user.email "autodoc[bot]@users.noreply.github.com" | |
| git status | |
| if [ "$(git diff)" = "" ]; then | |
| echo "No Documentation changes" | |
| else | |
| git add .. | |
| git commit -m "[bot] - generated doxygen docs" | |
| git push | |
| fi | |