-
Notifications
You must be signed in to change notification settings - Fork 89
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
Adding workflow to create Cordio platform docs. #403
Closed
Closed
Changes from all commits
Commits
Show all changes
66 commits
Select commit
Hold shift + click to select a range
49c16ab
Moving existing documents.
kevin-gillespie 12d3122
Fixing path for buildable projects.
kevin-gillespie d13c4ed
Adding new README shell.
kevin-gillespie 9a5084e
Adding outline for docs.
kevin-gillespie b22ebc1
Refining links.
kevin-gillespie 359ffcc
Adding additional applications.
kevin-gillespie 10b76ce
Adding content to BLUETOOTH_LE_BASICS
kevin-gillespie eca528e
Adding feature support.
kevin-gillespie da9e4d1
Adding OTA feature details.
kevin-gillespie d619936
Moving datc/dats documentation.
kevin-gillespie 2193526
Linking BLE_datc/dats README
kevin-gillespie bb9c3e5
Adding architecture docs.
kevin-gillespie 0612138
Adding information on the BLE states.
kevin-gillespie 0ab3d8e
Adding profiles and services.
kevin-gillespie dad8a39
Adding details on advertising.
kevin-gillespie 88e6e3f
Adding workflow to create Cordio platform docs.
AbbyWolf-ADI 463c252
Fixing indent.
AbbyWolf-ADI e1f65cc
Fixed indent.
AbbyWolf-ADI c5b5389
fixing indent
AbbyWolf-ADI e33336a
Add files via upload
AbbyWolf-ADI 86e4ea4
testing branch (removing edits after)
AbbyWolf-ADI 734f2c4
testing workflow
AbbyWolf-ADI 37b06d4
fixing paths
AbbyWolf-ADI ed7c8f5
fixing paths
AbbyWolf-ADI b975c8e
debugging
AbbyWolf-ADI e2f69c3
updating command permissions
AbbyWolf-ADI 906504c
update host software
AbbyWolf-ADI de1af34
adding latex support
AbbyWolf-ADI 85b6ed5
create filepath for documentation
AbbyWolf-ADI db5cb6b
removing unnecessary cleanup
AbbyWolf-ADI 02cf2bf
remove extra directory
AbbyWolf-ADI fa1ef84
update pdf save process
AbbyWolf-ADI 2f5fa48
add push for generated documentation
AbbyWolf-ADI f50d42c
fix push command
AbbyWolf-ADI a2a5b20
Update documentation.
AbbyWolf-ADI 39b1038
update doxyfile
AbbyWolf-ADI 0f46361
update to get branch info
AbbyWolf-ADI f325aa3
automate branch selection
AbbyWolf-ADI 8a8a6fd
Fix mkdir error
AbbyWolf-ADI df93989
Update documentation.
AbbyWolf-ADI 88f839e
Update doxyfile paths
AbbyWolf-ADI 19d5212
Update documentation.
AbbyWolf-ADI 9de0369
Remove run condition
AbbyWolf-ADI 3b071e9
Remove unused interfaces
AbbyWolf-ADI 001c921
Update for use with all platform interfaces
AbbyWolf-ADI 8a15065
Update paths to reflect doxyfile changes
AbbyWolf-ADI 90d139b
Add names to anonymous enums
AbbyWolf-ADI de1cba9
Update grouping
AbbyWolf-ADI e23acda
Add names to anonymous enums
AbbyWolf-ADI 6dca17d
Add names to anonymous enums
AbbyWolf-ADI a6ce51f
Remove unused enum from docs
AbbyWolf-ADI b6131eb
Update branch and fix merge conflicts
AbbyWolf-ADI 08d314b
Update files to work with modified workflow
AbbyWolf-ADI 4571101
Update workflow to accodate Cordio documentation
AbbyWolf-ADI ac70b71
Merge branch 'cordio-docs' into cordio-platform-docs
AbbyWolf-ADI a839525
Add functionality for automatic Cordio docs updates to USERGUIDE.md
AbbyWolf-ADI 9d1fa5c
Change output pdf name
AbbyWolf-ADI 635a4cb
Updated file name for current Cordio platform docs file
AbbyWolf-ADI 12b7b3e
Move updateUSERGUIDE-Cordio.py to workflow directory
AbbyWolf-ADI 9d122eb
Add full path to Cordio documentation in userguide links
AbbyWolf-ADI 501a0e5
Remove incorrect pathing to Cordio docs
AbbyWolf-ADI 1c45b98
Remove copy Cordio documentation files
AbbyWolf-ADI b5456a0
Move updateUSERGUIDE-Cordio.py to scripts
AbbyWolf-ADI 65fda10
Update Cordio documentation paths
AbbyWolf-ADI 1c8d339
Fix documentation paths
AbbyWolf-ADI 0b169d0
Relocate and update USERGUIDE.md relative links
AbbyWolf-ADI 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 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,60 @@ | ||
name: Build & Deploy Cordio Platform Docs | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/github-script@v3 | ||
id: get-pr | ||
with: | ||
script: | | ||
const request = { | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
pull_number: context.issue.number | ||
} | ||
core.info(`Getting PR #${request.pull_number} from ${request.owner}/${request.repo}`) | ||
try { | ||
const result = await github.pulls.get(request) | ||
return result.data | ||
} catch (err) { | ||
core.setFailed(`Request failed with error ${err}`) | ||
} | ||
- uses: actions/checkout@v3 | ||
with: | ||
repository: ${{ fromJSON(steps.get-pr.outputs.result).head.repo.full_name }} | ||
ref: ${{ fromJSON(steps.get-pr.outputs.result).head.ref }} | ||
fetch-depth: 0 | ||
|
||
- name: Generate Docs (MAX32655) | ||
uses: mattnotmitt/[email protected] | ||
with: | ||
working-directory: Libraries/Cordio/docs | ||
doxyfile-path: cordio_platform_doxyfile | ||
enable-latex: true | ||
|
||
- name: Build PDF | ||
run: | | ||
echo "Building PDF..." | ||
sudo apt-get install texlive-full | ||
sudo make -C Libraries/Cordio/docs/latex | ||
|
||
echo "Copying PDF to Cordio/platform/Documentation" | ||
sudo mv Libraries/Cordio/docs/latex/refman.pdf Libraries/Cordio/docs/latex/Cordio-Platform-Documentation.pdf | ||
sudo mkdir -p Libraries/Cordio/platform/Documentation && sudo cp -r Libraries/Cordio/docs/latex/Cordio-Platform-Documentation.pdf Libraries/Cordio/platform/Documentation/ | ||
|
||
|
||
- name: Push Documentation Files | ||
uses: EndBug/[email protected] | ||
with: | ||
add: 'Libraries/Cordio/platform/Documentation/Platform_ref.pdf' | ||
message: 'Update documentation.' | ||
push: true | ||
|
||
|
||
|
||
|
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
from pathlib import Path | ||
from os import listdir | ||
|
||
|
||
TEMPLATE = "- [%s](%s/%s)\n" | ||
repo = Path.cwd().parent.parent | ||
cordio_docs_dir = repo / "Libraries" / "Cordio" / "docs" | ||
platform_docs_dir = repo / "Libraries" / "Cordio" / "platform" / "Documentation" | ||
|
||
cordio_doc_files = [f for f in listdir(cordio_docs_dir) if f.endswith('.md')] | ||
platform_doc_files = [f for f in listdir(platform_docs_dir) if f.endswith('.pdf')] | ||
|
||
with open(repo / "USERGUIDE.md", 'r') as f: | ||
lines = f.readlines() | ||
|
||
idx = 0 | ||
foundStart = False | ||
|
||
for line in lines: | ||
if foundStart: | ||
if line[0] == '#': | ||
end_idx = idx | ||
break | ||
|
||
if '#### Cordio Documentation' in line: | ||
start_idx = idx | ||
foundStart = True | ||
|
||
idx += 1 | ||
|
||
comp_lines = lines[start_idx+1:end_idx] | ||
|
||
for cfile in cordio_doc_files: | ||
for line in lines: | ||
if cfile in line: | ||
cordio_doc_files.remove(cfile) | ||
|
||
for pfile in platform_doc_files: | ||
for line in lines: | ||
if pfile in line: | ||
platform_doc_files.remove(pfile) | ||
|
||
if len(cordio_doc_files) > 0: | ||
entries = [] | ||
for f in cordio_doc_files: | ||
if 'LICENSE' in f: | ||
continue | ||
nav_name = f.split('.')[0].replace("_", " ").title() | ||
entries.append(TEMPLATE % (nav_name, cordio_docs_dir, f)) | ||
|
||
if len(platform_doc_files) > 0: | ||
for f in platform_doc_files: | ||
if 'LICENSE' in f: | ||
continue | ||
nav_name = f.split('.')[0].replace("-", " ").title() | ||
entries.append(TEMPLATE % (nav_name, platform_docs_dir, f)) | ||
|
||
while True: | ||
if lines[end_idx][0] == '-': | ||
end_idx -= 1 | ||
break | ||
end_idx -= 1 | ||
|
||
idx = 0 | ||
for entry in entries: | ||
lines.insert(end_idx, entry) | ||
end_idx += 1 | ||
|
||
content = "".join(lines) | ||
|
||
with open(repo / "USERGUIDE.md", 'w') as f: | ||
f.write(content) |
Oops, something went wrong.
Oops, something went wrong.
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.
This filename looks okay, we just need to update what's currently in the PR.