Skip to content

Commit

Permalink
Merge pull request nasa#404 from ArielSAdamsNASA/fix-249-combine-depl…
Browse files Browse the repository at this point in the history
…oy-documentation-jobs

Fix nasa#249, Combine Deploy Documentation Jobs
  • Loading branch information
astrogeco authored Jan 21, 2022
2 parents 80cafc8 + 83070a2 commit 5e77eb3
Showing 1 changed file with 55 additions and 124 deletions.
179 changes: 55 additions & 124 deletions .github/workflows/build-documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,13 @@ jobs:
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
# Upload documentation logs as artifacts
- name: Archive Documentation Build Logs
uses: actions/upload-artifact@v2
Expand All @@ -65,20 +63,17 @@ jobs:
path: |
make_doc_stdout.txt
make_doc_stderr.txt
- name: Error Check
run: |
if [[ -s make_doc_stderr.txt ]]; then
cat make_doc_stderr.txt
exit -1
fi
build-usersguide:
build:
needs: checks-for-duplicates
if: ${{ needs.checks-for-duplicates.outputs.should_skip != 'true' }}
# Name the Job
name: Users Guide
# Set the type of machine to run on
name: Build OSAL & Users Guide
runs-on: ubuntu-18.04

steps:
Expand All @@ -94,108 +89,7 @@ jobs:
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: Install Dependencies
run: sudo apt-get install doxygen graphviz -y

- name: Build Usersguide
run: |
make usersguide > make_usersguide_stdout.txt 2> make_usersguide_stderr.txt
- name: Archive Users Guide Build Logs
uses: actions/upload-artifact@v2
with:
name: Users Guide Artifacts
path: |
make_usersguide_stdout.txt
make_usersguide_stderr.txt
cfe-usersguide-warnings.log
- name: Error Check
run: |
if [[ -s make_usersguide_stderr.txt ]]; then
cat make_usersguide_stderr.txt
exit -1
fi
- name: Warning Check
run: |
if [[ -s cfe-usersguide-warnings.log ]]; then
cat cfe-usersguide-warnings.log
exit -1
fi
- name: Install Dependencies
if: ${{ github.event_name == 'push' && contains(github.ref, 'main')}}
run: |
sudo apt-get install texlive-latex-base texlive-fonts-recommended texlive-fonts-extra texlive-latex-extra
- name: Generate PDF
if: ${{ github.event_name == 'push' && contains(github.ref, 'main')}}
run: |
set -x
mkdir deploy
cd ./build/docs/users_guide/latex
make > build.txt
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: Cache cFS Build Environment for osalguide
id: cache-usersguide
uses: actions/cache@v2
with:
path: /home/runner/work/${{ env.REPO_NAME }}/${{ env.REPO_NAME }}/deploy/*
key: usersguide-buildnum-${{ github.run_number }}
deploy-usersguide:
name: Deploy Users Guide
runs-on: ubuntu-18.04
needs: build-usersguide
if: ${{ github.event_name == 'push' && contains(github.ref, 'main')}}

steps:
- name: Cache cFS Build Environment for usersguide
id: cache-usersguide
uses: actions/cache@v2
with:
path: /home/runner/work/${{ env.REPO_NAME }}/${{ env.REPO_NAME }}/deploy/*
key: usersguide-buildnum-${{ github.run_number }}

- name: Deploy to GitHub
if: ${{ github.event_name == 'push' && contains(github.ref, 'main')}}
uses: JamesIves/github-pages-deploy-action@3.7.1
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: gh-pages
FOLDER: deploy
CLEAN: false
SINGLE_COMMIT: true

build-osalguide:
needs: checks-for-duplicates
if: ${{ needs.checks-for-duplicates.outputs.should_skip != 'true' }}
name: Osal Guide
runs-on: ubuntu-18.04

steps:
# Checks out a copy of your repository on the ubuntu-latest machine
- name: Checkout code
uses: actions/checkout@v2
with:
submodules: true
persist-credentials: false

# Setup the build system
- 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
Expand All @@ -207,7 +101,7 @@ jobs:
run: |
make osalguide > make_osalguide_stdout.txt 2> make_osalguide_stderr.txt
mv build/docs/osalguide/osal-apiguide-warnings.log osal-apiguide-warnings.log
- name: Archive Osal Guide Build Logs
uses: actions/upload-artifact@v2
with:
Expand All @@ -216,26 +110,26 @@ jobs:
make_osalguide_stdout.txt
make_osalguide_stderr.txt
osal-apiguide-warnings.log
- name: Check for Errors
run: |
if [[ -s make_osalguide_stderr.txt ]]; then
cat make_osalguide_stderr.txt
exit -1
fi
- name: Check for Warnings
run: |
if [[ -s osal-apiguide-warnings.log ]]; then
cat osal-apiguide-warnings.log
exit -1
fi
- name: Install Dependencies
if: ${{ github.event_name == 'push' && contains(github.ref, 'main')}}
run: |
sudo apt-get install texlive-latex-base texlive-fonts-recommended texlive-fonts-extra texlive-latex-extra
- name: Generate PDF
if: ${{ github.event_name == 'push' && contains(github.ref, 'main')}}
run: |
Expand All @@ -245,27 +139,64 @@ jobs:
mv refman.pdf $GITHUB_WORKSPACE/deploy/OSAL_Users_Guide.pdf
# Could add pandoc and convert to github markdown
# pandoc CFE_Users_Guide.pdf -t gfm
- name: Cache cFS Build Environment for osalguide
id: cache-osalguide
- name: Build Usersguide
run: |
make usersguide > make_usersguide_stdout.txt 2> make_usersguide_stderr.txt
- name: Archive Users Guide Build Logs
uses: actions/upload-artifact@v2
with:
name: Users Guide Artifacts
path: |
make_usersguide_stdout.txt
make_usersguide_stderr.txt
cfe-usersguide-warnings.log
- name: Error Check
run: |
if [[ -s make_usersguide_stderr.txt ]]; then
cat make_usersguide_stderr.txt
exit -1
fi
- name: Warning Check
run: |
if [[ -s cfe-usersguide-warnings.log ]]; then
cat cfe-usersguide-warnings.log
exit -1
fi
- name: Generate PDF
if: ${{ github.event_name == 'push' && contains(github.ref, 'main')}}
run: |
set -x
cd ./build/docs/users_guide/latex
make > build.txt
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: Cache cFS Build Environment for usersguide
id: cache-guide
uses: actions/cache@v2
with:
path: /home/runner/work/${{ env.REPO_NAME }}/${{ env.REPO_NAME }}/deploy/*
key: osalguide-buildnum-${{ github.run_number }}

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

steps:
- name: Cache cFS Build Environment for osalguide
id: cache-osalguide
id: cache-guide
uses: actions/cache@v2
with:
path: /home/runner/work/${{ env.REPO_NAME }}/${{ env.REPO_NAME }}/deploy/*
key: osalguide-buildnum-${{ github.run_number }}
key: guide-buildnum-${{ github.run_number }}

- name: Deploy to GitHub
uses: JamesIves/github-pages-deploy-action@3.7.1
Expand All @@ -275,4 +206,4 @@ jobs:
FOLDER: deploy
CLEAN: false
SINGLE_COMMIT: true


0 comments on commit 5e77eb3

Please sign in to comment.