Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/nasa/cFS into fix-382-reuse…
Browse files Browse the repository at this point in the history
…-workflows
  • Loading branch information
arielswalker committed Oct 28, 2021
2 parents a7ecfc6 + 81227d5 commit 387df8d
Show file tree
Hide file tree
Showing 7 changed files with 88 additions and 89 deletions.
16 changes: 14 additions & 2 deletions .github/codeql/codeql-coding-standard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,17 @@ name: "CodeQL Coding Standard Configuration File"
disable-default-queries: true

queries:
- name: JPL and MISRA
uses: ./.github/codeql/jpl-misra.qls
- name: JPL Rules
uses: github/codeql/cpp/ql/src/JPL_C@main
- name: MISRA Rule 9-5-1
uses: github/codeql/cpp/ql/src/jsf/4.20 Unions and Bit Fields/AV Rule 153.ql@main
- name: MISRA Rule 5-18-1
uses: github/codeql/cpp/ql/src/jsf/4.21 Operators/AV Rule 168.ql@main
- name: MISRA 6-2-2
uses: github/codeql/cpp/ql/src/jsf/4.25 Expressions/AV Rule 202.ql@main
- name: MISRA Rule 5-14-1
uses: github/codeql/cpp/ql/src/jsf/4.21 Operators/AV Rule 165.ql@main
- name: MISRA Rule 5-3-2
uses: github/codeql/cpp/ql/src/jsf/4.21 Operators/AV Rule 165.ql@main
- name: MISRA Rule 7-5-2
uses: github/codeql/cpp/ql/src/jsf/4.22 Pointers and References/AV Rule 173.ql@main
21 changes: 0 additions & 21 deletions .github/codeql/jpl-misra.qls

This file was deleted.

6 changes: 3 additions & 3 deletions .github/workflows/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ For the CodeQL GitHub Actions setup, visit https://github.com/github/codeql-acti

Our CodeQL action uses a configuration file to use specific queries, which can be found at [.github/codeql](https://github.com/nasa/cFS/tree/main/.github/codeql).

## Static Analysis
[![Static Analysis](https://github.com/nasa/cfs/actions/workflows/static-analysis.yml/badge.svg)](https://github.com/nasa/cfs/actions/workflows/static-analysis.yml)
## Static Analaysis
[![Static Analaysis](https://github.com/nasa/cfs/actions/workflows/static-analysis.yml/badge.svg)](https://github.com/nasa/cfs/actions/workflows/static-analysis.yml)

This action runs a static analysis tool for C/C++ code known as cppcheck. Cppcheck is designed to be able to analyze C/C++ code even if it has non-standard syntax, which is common in embedded projects.

Expand Down Expand Up @@ -68,6 +68,6 @@ This action creates a changelog file which documents all the issues in cFS.
The Changelog action runs manually.

## Format Check
[![Format Check](https://github.com/nasa/cfs/actions/workflows/format-check.yml/badge.svg)](https://github.com/nasa/cfs/actions/workflows/format-check.yml)
[![Format Check](https://github.com/nasa/osal/actions/workflows/format-check.yml/badge.svg)](https://github.com/nasa/osal/actions/workflows/format-check.yml)

This action uses [clang-format-10](https://github.com/nasa/cFS/blob/main/.clang-format) to check for format errors.
Binary file modified .github/workflows/Reusable-Workflows-Architecture.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
71 changes: 49 additions & 22 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,34 @@ jobs:
exit -1
fi
pdf-usersguide:
- name: Cache cFS Build Environment for usersguide
id: cache-bundle
uses: actions/cache@v2
with:
path: /home/runner/work/${{ env.REPO_NAME }}/${{ env.REPO_NAME }}/build/*
key: usersguide-buildnum-${{ github.run_number }}

deploy-usersguide:
needs: build-usersguide
# Name the Job
name: PDF Users Guide
name: Deploy 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: Cache cFS Build Environment for usersguide
id: cache-bundle
uses: actions/cache@v2
with:
path: /home/runner/work/${{ env.REPO_NAME }}/${{ env.REPO_NAME }}/build/*
key: usersguide-buildnum-${{ github.run_number }}

- name: Generate PDF
if: ${{ github.event_name == 'push' && contains(github.ref, 'main')}}
run: |
set -x
Expand All @@ -151,7 +167,7 @@ jobs:
# Could add pandoc and convert to github markdown
# pandoc CFE_Users_Guide.pdf -t gfm
- name: Deploy
- name: Deploy to GitHub
if: ${{ github.event_name == 'push' && contains(github.ref, 'main')}}
uses: JamesIves/github-pages-deploy-action@3.7.1
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,46 @@ 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:
- name: Cache cFS Build Environment for osalguide
id: cache-bundle
uses: actions/cache@v2
with:
path: /home/runner/work/${{ env.REPO_NAME }}/${{ env.REPO_NAME }}/build/*
key: osalguide-buildnum-${{ github.run_number }}

deploy-osalguide:
needs: build-osalguide
# Name the Job
name: PDF Osal Guide
# Set the type of machine to run on
name: Deploy Osal Guide
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: Cache cFS Build Environment for osalguide
id: cache-bundle
uses: actions/cache@v2
with:
path: /home/runner/work/${{ env.REPO_NAME }}/${{ env.REPO_NAME }}/build/*
key: osalguide-buildnum-${{ github.run_number }}

- name: Generate PDF
if: ${{ github.event_name == 'push' && contains(github.ref, 'main')}}
run: |
mkdir deploy
Expand All @@ -240,12 +267,12 @@ jobs:
# Could add pandoc and convert to github markdown
# pandoc CFE_Users_Guide.pdf -t gfm
- name: Deploy
- 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
SINGLE_COMMIT: true
16 changes: 8 additions & 8 deletions .github/workflows/codeql-build.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name: CodeQL Analysis
name: "CodeQL Analysis"

on:
workflow_call:
inputs:
sample-defs:
setup:
description: 'Build Prep'
type: string
default: 'cp ./cfe/cmake/Makefile.sample Makefile && cp -r ./cfe/cmake/sample_defs sample_defs'
Expand All @@ -12,7 +12,7 @@ on:
type: string
default: ''
make:
description: 'Make Code'
description: 'Make Copy'
type: string
default: 'make'
tests:
Expand Down Expand Up @@ -60,19 +60,19 @@ jobs:
run: |
git log -1 --pretty=oneline
git submodule
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: c
config-file: nasa/cFS/.github/codeql/codeql-security.yml@main

- name: Copy sample_defs
run: ${{ inputs.sample-defs }}
run: ${{ inputs.setup }}

- name: Make prep
run: ${{ inputs.make-prep }}

- name: Make Install
run: ${{ inputs.make }}

Expand Down Expand Up @@ -115,7 +115,7 @@ jobs:
config-file: nasa/cFS/.github/codeql/codeql-coding-standard.yml@main

- name: Copy sample_defs
run: ${{ inputs.sample-defs }}
run: ${{ inputs.setup }}

- name: Make prep
run: ${{ inputs.make-prep }}
Expand Down
47 changes: 14 additions & 33 deletions .github/workflows/static-analysis.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,10 @@
name: Static Analysis

# Run on all push and pull requests
on:
push:
pull_request:
workflow_call:
inputs:
module:
description: 'GitHub Module'
type: string
default: 'bundle'
cppcheck-code:
description: 'Cppcheck Code'
strict-dir-list:
description: 'Directory List'
type: string
default: ''

Expand Down Expand Up @@ -39,6 +32,8 @@ jobs:

strategy:
fail-fast: false
matrix:
cppcheck: [non-strict, strict]

steps:
- name: Install cppcheck
Expand All @@ -51,39 +46,25 @@ jobs:
submodules: true

- name: Run bundle cppcheck
run: cppcheck --force --inline-suppr --quiet . 2> ${{ inputs.module }}_cppcheck_err.txt

- name: Archive static analysis artifacts for bundle
uses: actions/upload-artifact@v2
with:
name: bundle-cppcheck-err
path: ./*cppcheck_err.txt

- name: Check for errors for bundle
run: |
if [[ -s bundle_cppcheck_err.txt ]];
then
cat $bundle_cppcheck_err.txt
exit -1
fi
run: cppcheck --force --inline-suppr . 2> ${{matrix.cppcheck}}_cppcheck_err.txt

# Run strict static analysis for embedded portions of cfe, osal, and psp
- name: Strict cppcheck
if: ${{ inputs.module !='bundle' }}
run: |
${{ inputs.cppcheck-code }}
- name: Archive static analysis artifacts
if: ${{ inputs.module !='bundle' }}
if: ${{ inputs.strict-dir-list !='' }}
run: cppcheck --force --inline-suppr --std=c99 --language=c --enable=warning,performance,portability,style --suppress=variableScope --inconclusive .${{ inputs.strict-dir-list }} 2> ../${{matrix.cppcheck}}_cppcheck_err.txt

- name: Archive Static Analysis Artifacts
if: ${{ inputs.strict-dir-list !='' || matrix.cppcheck == 'non-strict' }}
uses: actions/upload-artifact@v2
with:
name: ${{ inputs.module }}-cppcheck-err
name: ${{matrix.cppcheck}}-cppcheck-err
path: ./*cppcheck_err.txt

- name: Check for errors
if: ${{ inputs.module !='bundle' }}
if: ${{ inputs.strict-dir-list !='' || matrix.cppcheck == 'non-strict' }}
run: |
if [[ -s ${{ inputs.module }}_cppcheck_err.txt ]];
if [[ -s ${{matrix.cppcheck}}_cppcheck_err.txt ]];
then
cat ${{ inputs.module }}_cppcheck_err.txt
cat ${{matrix.cppcheck}}_cppcheck_err.txt
exit -1
fi

0 comments on commit 387df8d

Please sign in to comment.