Skip to content

Commit

Permalink
Merge pull request #316 from ArielSAdamsNASA/fix-312-generate-documen…
Browse files Browse the repository at this point in the history
…tation-in-all-scenarios

Fix #312, Generate Documentation In All Scenarios
  • Loading branch information
astrogeco committed Jul 29, 2021
2 parents 1a59db7 + 1cb05f2 commit ccc754f
Showing 1 changed file with 58 additions and 31 deletions.
89 changes: 58 additions & 31 deletions .github/workflows/build-documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@ on:

env:
SIMULATION: native
REPO_NAME: ${{ github.event.repository.name }}

jobs:
#Checks for duplicate actions. Skips push actions if there is a matching or duplicate pull-request action.
# Checks for duplicate actions. Skips push actions if there is a matching or
# duplicate pull-request action.
checks-for-duplicates:
runs-on: ubuntu-latest
# Map a step output to a job output
Expand All @@ -24,7 +26,8 @@ jobs:
do_not_skip: '["push", "workflow_dispatch", "schedule"]'

build-docs:
#Continue if checks-for-duplicates found no duplicates. Always runs for pull-requests.
# 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
Expand Down Expand Up @@ -92,7 +95,7 @@ jobs:
cp ./cfe/cmake/Makefile.sample Makefile
cp -r ./cfe/cmake/sample_defs sample_defs
# Setup the build system
# Setup the build system
- name: Make Prep
run: make prep

Expand Down Expand Up @@ -126,21 +129,12 @@ jobs:
exit -1
fi
pdf-usersguide:
needs: build-usersguide
# Name the Job
name: PDF Users Guide
# Set the type of machine to run on
runs-on: ubuntu-18.04

steps:

- name: PDF generation installs
- 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: PDF generation
- name: Generate PDF
if: ${{ github.event_name == 'push' && contains(github.ref, 'main')}}
run: |
set -x
Expand All @@ -151,7 +145,29 @@ jobs:
# Could add pandoc and convert to github markdown
# pandoc CFE_Users_Guide.pdf -t gfm
- name: Deploy
- 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:
needs: build-usersguide
# Name the Job
name: Deploy Users Guide
# Set the type of machine to run on
runs-on: ubuntu-18.04

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/[email protected]
with:
Expand All @@ -164,9 +180,7 @@ jobs:
build-osalguide:
needs: checks-for-duplicates
if: ${{ needs.checks-for-duplicates.outputs.should_skip != 'true' }}
# Name the Job
name: Osal Guide
# Set the type of machine to run on
runs-on: ubuntu-18.04

steps:
Expand All @@ -183,7 +197,7 @@ jobs:
cp ./cfe/cmake/Makefile.sample Makefile
cp -r ./cfe/cmake/sample_defs sample_defs
# Setup the build system
# Setup the build system
- name: Make Prep
run: make prep

Expand All @@ -204,33 +218,26 @@ jobs:
make_osalguide_stderr.txt
osal-apiguide-warnings.log
- name: Error Check
- name: Check for Errors
run: |
if [[ -s make_osalguide_stderr.txt ]]; then
cat make_osalguide_stderr.txt
exit -1
fi
- name: Warning Check
- name: Check for Warnings
run: |
if [[ -s osal-apiguide-warnings.log ]]; then
cat osal-apiguide-warnings.log
exit -1
fi
pdf-osalguide:
needs: build-osalguide
# Name the Job
name: PDF Osal Guide
# Set the type of machine to run on
runs-on: ubuntu-18.04
steps:
- name: PDF generation installs
- 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: PDF generation
- name: Generate PDF
if: ${{ github.event_name == 'push' && contains(github.ref, 'main')}}
run: |
mkdir deploy
Expand All @@ -240,12 +247,32 @@ jobs:
# Could add pandoc and convert to github markdown
# pandoc CFE_Users_Guide.pdf -t gfm
- name: Deploy
- name: Cache cFS Build Environment for osalguide
id: cache-osalguide
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
runs-on: ubuntu-18.04

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

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

0 comments on commit ccc754f

Please sign in to comment.