Skip to content

Commit

Permalink
Fix nasa#447, Deploy mission document from workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
skliper committed Apr 6, 2022
1 parent 963b3ab commit 2e02021
Showing 1 changed file with 50 additions and 67 deletions.
117 changes: 50 additions & 67 deletions .github/workflows/build-documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,66 +25,10 @@ jobs:
skip_after_successful_duplicate: 'true'
do_not_skip: '["push", "workflow_dispatch", "schedule"]'

build-docs:
# Continue if checks-for-duplicates found no duplicates. Always runs for
# pull-requests.
needs: checks-for-duplicates
if: ${{ needs.checks-for-duplicates.outputs.should_skip != 'true' }}
name: cFE Documentation
runs-on: ubuntu-18.04

steps:
- name: Install Dependencies
run: sudo apt-get install doxygen graphviz -y

# Check out the cfs bundle
- name: Checkout code
uses: actions/checkout@v2
with:
submodules: true

# Prepare build "recipes"
- name: Copy Files
run: |
cp ./cfe/cmake/Makefile.sample Makefile
cp -r ./cfe/cmake/sample_defs sample_defs
# Setup the build system
- name: Make Prep
run: make prep

- name: Build Docs
run: |
make doc > make_doc_stdout.txt 2> make_doc_stderr.txt
mv build/docs/detaildesign-warnings.log detaildesign-warnings.log
# Upload documentation logs as artifacts
- name: Archive Documentation Build Logs
uses: actions/upload-artifact@v2
with:
name: cFS Docs Artifacts
path: |
make_doc_stdout.txt
make_doc_stderr.txt
detaildesign-warnings.log
- name: Error Check
run: |
if [[ -s make_doc_stderr.txt ]]; then
cat make_doc_stderr.txt
exit -1
fi
- name: Warning Check
run: |
if [[ -s detaildesign-warnings.log ]]; then
cat detaildesign-warnings.log
exit -1
fi
build:
needs: checks-for-duplicates
if: ${{ needs.checks-for-duplicates.outputs.should_skip != 'true' }}
name: Build OSAL & Users Guide
name: Build OSAL, cFE Users Guide, Mission Doc
runs-on: ubuntu-18.04

steps:
Expand Down Expand Up @@ -122,14 +66,14 @@ jobs:
make_osalguide_stderr.txt
osal-apiguide-warnings.log
- name: Check for Errors
- name: Check for OSAL Guide Errors
run: |
if [[ -s make_osalguide_stderr.txt ]]; then
cat make_osalguide_stderr.txt
exit -1
fi
- name: Check for Warnings
- name: Check for OSAL Guide Warnings
run: |
if [[ -s osal-apiguide-warnings.log ]]; then
cat osal-apiguide-warnings.log
Expand All @@ -141,7 +85,7 @@ jobs:
run: |
sudo apt-get install texlive-latex-base texlive-fonts-recommended texlive-fonts-extra texlive-latex-extra
- name: Generate PDF
- name: Generate OSAL Guide PDF
if: ${{ github.event_name == 'push' && contains(github.ref, 'main')}}
run: |
mkdir deploy
Expand All @@ -156,7 +100,7 @@ jobs:
make usersguide > make_usersguide_stdout.txt 2> make_usersguide_stderr.txt
mv build/docs/users_guide/cfe-usersguide-warnings.log cfe-usersguide-warnings.log
- name: Archive Users Guide Build Logs
- name: Archive Usersguide Build Logs
uses: actions/upload-artifact@v2
with:
name: Users Guide Artifacts
Expand All @@ -165,21 +109,21 @@ jobs:
make_usersguide_stderr.txt
cfe-usersguide-warnings.log
- name: Error Check
- name: Check for Usersguide Errors
run: |
if [[ -s make_usersguide_stderr.txt ]]; then
cat make_usersguide_stderr.txt
exit -1
fi
- name: Warning Check
- name: Check for Usersguide Warnings
run: |
if [[ -s cfe-usersguide-warnings.log ]]; then
cat cfe-usersguide-warnings.log
exit -1
fi
- name: Generate PDF
- name: Generate Usersguide PDF
if: ${{ github.event_name == 'push' && contains(github.ref, 'main')}}
run: |
set -x
Expand All @@ -188,8 +132,47 @@ jobs:
mv refman.pdf $GITHUB_WORKSPACE/deploy/cFE_Users_Guide.pdf
# Could add pandoc and convert to github markdown
# pandoc CFE_Users_Guide.pdf -t gfm
- name: Build Mission Doc
run: |
make doc > make_doc_stdout.txt 2> make_doc_stderr.txt
mv build/docs/detaildesign-warnings.log detaildesign-warnings.log
# Upload documentation logs as artifacts
- name: Archive Mission Doc Build Logs
uses: actions/upload-artifact@v2
with:
name: cFS Docs Artifacts
path: |
make_doc_stdout.txt
make_doc_stderr.txt
detaildesign-warnings.log
- name: Check for Mission Doc Errors
run: |
if [[ -s make_doc_stderr.txt ]]; then
cat make_doc_stderr.txt
exit -1
fi
- name: Check for Mission Doc Warnings
run: |
if [[ -s detaildesign-warnings.log ]]; then
cat detaildesign-warnings.log
exit -1
fi
- name: Generate Mission Doc PDF
if: ${{ github.event_name == 'push' && contains(github.ref, 'main')}}
run: |
set -x
cd ./build/docs/detaildesign/latex
make > build.txt
mv refman.pdf $GITHUB_WORKSPACE/deploy/Mission_Doc.pdf
# Could add pandoc and convert to github markdown
# pandoc CFE_Users_Guide.pdf -t gfm
- name: Cache cFS Build Environment for usersguide
- name: Cache deployment directory
id: cache-guide
uses: actions/cache@v2
with:
Expand All @@ -198,12 +181,12 @@ jobs:

deploy:
needs: build
name: Deploy OSAL & Users Guide
name: Deploy documents
runs-on: ubuntu-18.04
if: ${{ github.event_name == 'push' && contains(github.ref, 'main')}}

steps:
- name: Cache cFS Build Environment for osalguide
- name: Get cached deployment directory
id: cache-guide
uses: actions/cache@v2
with:
Expand Down

0 comments on commit 2e02021

Please sign in to comment.