-
Notifications
You must be signed in to change notification settings - Fork 21
Add Doxygen functionality on Linux GitHub Workflow #16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
MichaelBCG
wants to merge
1
commit into
life-exe:master
Choose a base branch
from
MichaelBCG:feature/doxygen-linux
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| # This script is designed to replace back slashes ("\") with forward slashes ("/") in file paths in a Doxygen config file (Doxyfile). | ||
| # Back slashes are used in Windows paths, while forward slashes are used in Linux paths. | ||
| # Use this script if you are running Doxygen on a Linux system. | ||
|
|
||
| # Usage: python replace-backslashes.py <file_to_process> | ||
| # Example of usage: | ||
| # py replace-path-backslashes.py Doxyfile | ||
|
|
||
| # Example of usage in GitHub Workflow: | ||
| # - name: Replace back slashes | ||
| # run: | | ||
| # py devops_ue/docs/replace-path-backslashes.py devops_data/Doxyfile | ||
| # working-directory: ${{ github.workspace }} | ||
|
|
||
| import sys | ||
| import os | ||
| import re | ||
|
|
||
| def process_line(line): | ||
| # Check if the line is a comment | ||
| if line.startswith('#'): | ||
| return line | ||
|
|
||
| # Replace "\" with "/" except in specified cases | ||
| line = re.sub(r'(?<!\\)\\(?!["\s]|$)', '/', line) | ||
| line = re.sub(r'(?<=\S)\\(?=\s|$)', '/', line) | ||
| return line | ||
|
|
||
| def process_file(file_path): | ||
| with open(file_path, 'r') as file: | ||
| lines = file.readlines() | ||
|
|
||
| with open(file_path, 'w') as file: | ||
| for line in lines: | ||
| file.write(process_line(line)) | ||
|
|
||
| if __name__ == "__main__": | ||
| if len(sys.argv) != 2: | ||
| print("Expected usage: python replace-backslashes.py <file_to_process>") | ||
| sys.exit(1) | ||
|
|
||
| file_path = sys.argv[1] | ||
| # Construct the absolute path based on the current working directory | ||
| file_path = os.path.abspath(file_path) | ||
| process_file(file_path) | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,85 @@ | ||
| ## Uncomment/add the branches to run this Workflow on them | ||
| name: Game Documentation (Linux workflow) | ||
| on: | ||
| push: | ||
| branches: | ||
| #- main | ||
| - not-existing-branch | ||
| pull_request: | ||
| branches: | ||
| #- main | ||
| - not-existing-branch | ||
|
|
||
| ## This is for deploy-pages | ||
| permissions: | ||
| pages: write | ||
| deployments: write | ||
| id-token: write | ||
|
|
||
| jobs: | ||
| docs: | ||
| runs-on: ubuntu-latest | ||
|
|
||
| ## This is for deploy-pages | ||
| environment: | ||
| name: github-pages | ||
| url: ${{ steps.deployment.outputs.page_url }} | ||
|
|
||
| steps: | ||
| - name: Check Installed Software | ||
| run: | | ||
| python --version | ||
| pip --version | ||
| git --version | ||
|
|
||
| - name: Determine Python path | ||
| id: find_python_path | ||
| run: | | ||
| # Find the path to Python executable | ||
| PYTHON_EXEC=$(command -v python) | ||
| echo "PYTHON_EXEC=$PYTHON_EXEC" >> $GITHUB_ENV | ||
|
|
||
| ## py command is used in Doxyfile tags | ||
| - name: Create symbolic link for py command | ||
| run: | | ||
| # Create symbolic link named "py" pointing to Python executable | ||
| sudo ln -s $PYTHON_EXEC /usr/bin/py | ||
|
|
||
| - name: Verify py command | ||
| run: | | ||
| # Verify py command by checking its version | ||
| py --version | ||
|
|
||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| submodules: 'recursive' | ||
|
|
||
| - name: Install Doxygen | ||
| run: | | ||
| sudo apt-get update | ||
| sudo apt-get install -y doxygen | ||
|
|
||
| - name: Verify Doxygen installation | ||
| run: doxygen --version | ||
|
|
||
| ## Path tags in Doxyfile must have forward slashes on Linux | ||
| - name: Replace back slashes | ||
| run: | | ||
| py devops_ue/docs/replace-path-backslashes.py devops_data/Doxyfile | ||
| working-directory: ${{ github.workspace }} | ||
|
|
||
| - name: Run Doxygen | ||
| run: doxygen devops_data/Doxyfile | ||
|
|
||
| - name: Upload Docs to GitHub Pages | ||
| uses: actions/upload-pages-artifact@v3 | ||
| with: | ||
| path: Documentation/html | ||
|
|
||
| - name: Setup GitHub Pages | ||
| uses: actions/configure-pages@v4 | ||
|
|
||
| - name: Deploy To GitHub Pages | ||
| id: deployment | ||
| uses: actions/deploy-pages@v4 |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.