Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #301, Add Github workflows to bootes.x #324

Merged
merged 1 commit into from
Aug 24, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions .github/codeql/codeql-coding-standard.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: "CodeQL Coding Standard Configuration File"

disable-default-queries: true

queries:
- 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
7 changes: 7 additions & 0 deletions .github/codeql/codeql-security.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
name: "CodeQL Security Configuration File"

queries:
- name: Security and Quality
uses: security-and-quality
- name: Security Extended
uses: security-extended
63 changes: 63 additions & 0 deletions .github/workflows/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# Our Workflows

## Deprecated Build, Test, and Run
[![Deprecated Build, Test, and Run](https://github.com/nasa/cfs/actions/workflows/build-cfs-deprecated.yml/badge.svg?branch=bootes.x)](https://github.com/nasa/cfs/actions/workflows/build-cfs-deprecated.yml)

This action builds, tests, and runs the cFS bundle using deprecated code. The flag OMIT_DEPRECATED is set to false. For more information on the OMIT_DEPRECATED flag, see [global_build_options.cmake](https://github.com/nasa/cFE/blob/063b4d8a9c4a7e822af5f3e4017599159b985bb0/cmake/sample_defs/global_build_options.cmake).

Build, Test, and Run runs for every push and every pull request on all branches of cFS in Github Actions.

## Build, Test, and Run [OMIT_DEPRECATED=true]
[![Build, Test, and Run %5B OMIT_DEPRECATED=true %5B](https://github.com/nasa/cFS/actions/workflows/build-cfs.yml/badge.svg?branch=bootes.x)](https://github.com/nasa/cFS/actions/workflows/build-cfs.yml)

This action builds, tests, and runs the cFS bundle omitting deprecated code.

Build, Test, and Run [OMIT_DEPRECATED=true] runs for every push and every pull request on all branches of cFS in Github Actions. For more information on the OMIT_DEPRECATED flag, see [global_build_options.cmake](https://github.com/nasa/cFE/blob/063b4d8a9c4a7e822af5f3e4017599159b985bb0/cmake/sample_defs/global_build_options.cmake).

## CodeQL Analysis
[![CodeQL Analaysis](https://github.com/nasa/cfs/actions/workflows/codeql-build.yml/badge.svg?branch=bootes.x)](https://github.com/nasa/cfs/actions/workflows/codeql-build.yml)

This action runs GitHub's static analysis engine, CodeQL, against our repository's source code to find security vulnerabilities. It then automatically uploads the results to GitHub so they can be displayed in the repository's code scanning alerts found under the security tab. CodeQL runs an extensible set of [queries](https://github.com/github/codeql), which have been developed by the community and the [GitHub Security Lab](https://securitylab.github.com/) to find common vulnerabilities in your code.

CodeQL runs for every push and pull-request on all branches of cFS in GitHub Actions.

For the CodeQL GitHub Actions setup, visit https://github.com/github/codeql-action.

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 Analaysis
[![Static Analaysis](https://github.com/nasa/cfs/actions/workflows/static-analysis.yml/badge.svg?branch=bootes.x)](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.

The cFS Cppcheck GitHub Actions workflow and results are available to the public. To view the results, select a workflow and download the artifacts.

Cppcheck runs for every push on the main branch and every pull request on all branches of cFS in Github Actions.

For more information about Cppcheck, visit http://cppcheck.sourceforge.net/.

## Local Unit Test
[![Local Unit Test](https://github.com/nasa/osal/actions/workflows/local_unit_test.yml/badge.svg?branch=bootes.x)](https://github.com/nasa/osal/actions/workflows/local_unit_test.yml)

This action tests our code using GCC's coverage testing tool gcov.

Local Unit Test runs for every push and every pull request on all branches of cFS in Github Actions.

## Documentation and Guides
[![Documentation and Guides](https://github.com/nasa/cfs/actions/workflows/build-documentation.yml/badge.svg?branch=bootes.x)](https://github.com/nasa/cfs/actions/workflows/build-documentation.yml)

This action creates doxygen documents for cFE, cFS users guide, and osal guide.

Documentation and Guides runs for every push and every pull request on all branches of cFS in Github Actions. The workflow pushes the PDFs for every push on the main branch. The PDFs can be found at https://github.com/nasa/cfs/tree/gh-pages.

## Changelog
[![Changelog](https://github.com/nasa/cfs/actions/workflows/changelog.yml/badge.svg?branch=bootes.x)](https://github.com/nasa/cfs/actions/workflows/changelog.yml)

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/osal/actions/workflows/format-check.yml/badge.svg?branch=bootes.x)](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.
166 changes: 166 additions & 0 deletions .github/workflows/build-cfs-deprecated.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,166 @@
name: "Deprecated Build, Test, and Run"

# Run every time a new commit pushed or for pull requests
on:
push:
pull_request:
astrogeco marked this conversation as resolved.
Show resolved Hide resolved

env:
SIMULATION: native
OMIT_DEPRECATED: false

jobs:
#Checks for duplicate actions. Skips push actions if there is a matching or duplicate pull-request action.
check-for-duplicates:
runs-on: ubuntu-latest
# Map a step output to a job output
outputs:
should_skip: ${{ steps.skip_check.outputs.should_skip }}
steps:
- id: skip_check
uses: fkirc/skip-duplicate-actions@master
with:
concurrent_skipping: 'same_content'
skip_after_successful_duplicate: 'true'
do_not_skip: '["pull_request", "workflow_dispatch", "schedule"]'

# Set the job key. The key is displayed as the job name
# when a job name is not provided

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

strategy:
fail-fast: false
matrix:
buildtype: [debug, release]

# Set the type of machine to run on
env:
BUILDTYPE: ${{ matrix.buildtype }}

steps:
# Checks out a copy of your repository on the ubuntu-latest machine
- name: Checkout code
uses: actions/checkout@v2
with:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should checkout the bootes branch instead of main

submodules: true
ref: bootes.x

# 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

- name: Make
run: make

test-cfs:
name: Test
needs: build-cfs
runs-on: ubuntu-18.04

strategy:
fail-fast: false
matrix:
buildtype: [debug, release]

# Set the type of machine to run on
env:
BUILDTYPE: ${{ matrix.buildtype }}
ENABLE_UNIT_TESTS: true


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

# Checks out a copy of your repository on the ubuntu-latest machine
- name: Checkout code
uses: actions/checkout@v2
with:
submodules: true
ref: bootes.x

# 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
run: make

- name: Run Tests
run: make test

- name: Check Coverage
run: make lcov

run-cfs:
name: Run
needs: build-cfs
runs-on: ubuntu-18.04

strategy:
fail-fast: false
matrix:
buildtype: [debug, release]

# Set the type of machine to run on
env:
BUILDTYPE: ${{ matrix.buildtype }}

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

# Setup the build system
- name: Copy sample_defs
run: |
cp ./cfe/cmake/Makefile.sample Makefile
cp -r ./cfe/cmake/sample_defs sample_defs

# Setup the build system
- name: Make Install
run: make install

- name: List cpu1
run: ls build/exe/cpu1/

- name: Run cFS
run: |
./core-cpu1 > cFS_startup_cpu1.txt &
sleep 30
../host/cmdUtil --endian=LE --pktid=0x1806 --cmdcode=2 --half=0x0002
working-directory: ./build/exe/cpu1/

- name: Archive cFS Startup Artifacts
uses: actions/upload-artifact@v2
with:
name: cFS-startup-log-deprecated-false-${{ matrix.buildtype }}
path: ./build/exe/cpu1/cFS_startup_cpu1.txt

- name: Check for cFS Warnings
run: |
if [[ -n $(grep -i "warn\|err\|fail" cFS_startup_cpu1.txt) ]]; then
echo "Must resolve warn|err|fail in cFS startup before submitting a pull request"
echo ""
grep -i 'warn\|err\|fail' cFS_startup_cpu1.txt
exit -1
fi
working-directory: ./build/exe/cpu1/
Loading