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 27, 2021
2 parents e608106 + 81227d5 commit 739f894
Show file tree
Hide file tree
Showing 6 changed files with 130 additions and 121 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.
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
75 changes: 36 additions & 39 deletions .github/workflows/codeql-build.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,10 @@
name: CodeQL Analysis
name: "CodeQL Analysis"

on:
workflow_call:
inputs:
sample-defs:
description: 'Build Prep'
type: string
default: 'cp ./cfe/cmake/Makefile.sample Makefile && cp -r ./cfe/cmake/sample_defs sample_defs'
make-prep:
description: 'Make Prep'
type: string
default: ''
make:
description: 'Make Code'
type: string
default: 'make'
tests:
description: 'Tests'
type: string
default: ''
push:
pull_request:
branches:
- main

env:
SIMULATION: native
Expand All @@ -40,7 +26,8 @@ jobs:
concurrent_skipping: 'same_content'
skip_after_successful_duplicate: 'true'
do_not_skip: '["pull_request", "workflow_dispatch", "schedule"]'



CodeQL-Security-Build:
#Continue if check-for-duplicates found no duplicates. Always runs for pull-requests.
needs: check-for-duplicates
Expand All @@ -51,37 +38,42 @@ jobs:
steps:
# Checks out a copy of your repository
- name: Checkout code
if: ${{ !steps.skip-workflow.outputs.skip }}
uses: actions/checkout@v2
with:
repository: nasa/cFS
submodules: true

- name: Check versions
if: ${{ !steps.skip-workflow.outputs.skip }}
run: |
git log -1 --pretty=oneline
git submodule
- name: Initialize CodeQL
if: ${{ !steps.skip-workflow.outputs.skip }}
uses: github/codeql-action/init@v1
with:
languages: c
config-file: nasa/cFS/.github/codeql/codeql-security.yml@main
config-file: ./.github/codeql/codeql-security.yml

# Setup the build system
- name: Copy sample_defs
run: ${{ inputs.sample-defs }}

- name: Make prep
run: ${{ inputs.make-prep }}
if: ${{ !steps.skip-workflow.outputs.skip }}
run: |
cp ./cfe/cmake/Makefile.sample Makefile
cp -r ./cfe/cmake/sample_defs sample_defs
# Setup the build system
- name: Make Install
run: ${{ inputs.make }}

- name: Run tests
run: ${{ inputs.tests }}
if: ${{ !steps.skip-workflow.outputs.skip }}
run: make

# Run CodeQL
- name: Perform CodeQL Analysis
if: ${{ !steps.skip-workflow.outputs.skip }}
uses: github/codeql-action/analyze@v1

CodeQL-Coding-Standard-Build:
#Continue if check-for-duplicates found no duplicates. Always runs for pull-requests.
needs: check-for-duplicates
Expand All @@ -92,40 +84,45 @@ jobs:
steps:
# Checks out a copy of your repository
- name: Checkout code
if: ${{ !steps.skip-workflow.outputs.skip }}
uses: actions/checkout@v2
with:
repository: nasa/cFS
submodules: true

- name: Check versions
if: ${{ !steps.skip-workflow.outputs.skip }}
run: |
git log -1 --pretty=oneline
git submodule
- name: Checkout codeql code
if: ${{ !steps.skip-workflow.outputs.skip }}
uses: actions/checkout@v2
with:
repository: github/codeql
submodules: true
path: codeql

- name: Initialize CodeQL
if: ${{ !steps.skip-workflow.outputs.skip }}
uses: github/codeql-action/init@v1
with:
languages: c
config-file: nasa/cFS/.github/codeql/codeql-coding-standard.yml@main
config-file: ./.github/codeql/codeql-coding-standard.yml

# Setup the build system
- name: Copy sample_defs
run: ${{ inputs.sample-defs }}

- name: Make prep
run: ${{ inputs.make-prep }}
if: ${{ !steps.skip-workflow.outputs.skip }}
run: |
cp ./cfe/cmake/Makefile.sample Makefile
cp -r ./cfe/cmake/sample_defs sample_defs
# Setup the build system
- name: Make Install
run: ${{ inputs.make }}

- name: Run tests
run: ${{ inputs.tests }}
if: ${{ !steps.skip-workflow.outputs.skip }}
run: make

# Run CodeQL
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
Loading

0 comments on commit 739f894

Please sign in to comment.