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

cFS Bundle Integration candidate: Caelum+dev1 #390

Merged
2 changes: 1 addition & 1 deletion .github/codeql/codeql-coding-standard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ disable-default-queries: true

queries:
- name: JPL and MISRA
uses: ./.github/codeql/jpl-misra.qls
uses: nasa/cFS/.github/codeql/jpl-misra.qls@main
10 changes: 10 additions & 0 deletions .github/workflows/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# Our Workflows

## Reusable Workflows

To reduce duplication, the workflows CodeQL Analysis, Static Analysis, and Format Checker are placed in cFS to be reused in the subrepositories.

CodeQL Analysis and Static Analysis require inputs, therefore, they are called in an additional workflow in cFS to be utilized. Format checker does not need to be reused in cFS because it does not require inputs.

Provided is a diagram of the architecture of the reusable workflows.

![Reusable Workflows Architecture](Reusable-Workflows-Architecture.PNG)

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

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions .github/workflows/build-cfs-deprecated.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ env:
SIMULATION: native
OMIT_DEPRECATED: false
ENABLE_UNIT_TESTS: true
CTEST_OUTPUT_ON_FAILURE: true
REPO_NAME: ${{ github.event.repository.name }}

jobs:
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/build-cfs-rtems4.11.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ on:

env:
OMIT_DEPRECATED: true
CTEST_OUTPUT_ON_FAILURE: true


jobs:
#Checks for duplicate actions. Skips push actions if there is a matching or duplicate pull-request action.
Expand All @@ -29,7 +31,7 @@ jobs:
if: ${{ needs.check-for-duplicates.outputs.should_skip != 'true' }}
name: Build
runs-on: ubuntu-18.04
container: nmullane/qemu_rtems:4.11
container: ghcr.io/core-flight-system/qemu-rtems-4-11:latest

strategy:
fail-fast: false
Expand Down Expand Up @@ -65,7 +67,7 @@ jobs:
test-cfs:
name: Test
runs-on: ubuntu-18.04
container: nmullane/qemu_rtems:4.11
container: ghcr.io/core-flight-system/qemu-rtems-4-11:latest

needs: build-cfs

Expand All @@ -83,7 +85,6 @@ jobs:
# Disable mcopy check otherwise disk image build fails
MTOOLS_SKIP_CHECK: 1


steps:
# Checks out a copy of your repository on the ubuntu-latest machine
- name: Checkout code
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/build-cfs-rtems5.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ on:

env:
OMIT_DEPRECATED: true
CTEST_OUTPUT_ON_FAILURE: true


jobs:
#Checks for duplicate actions. Skips push actions if there is a matching or duplicate pull-request action.
Expand All @@ -29,7 +31,7 @@ jobs:
if: ${{ needs.check-for-duplicates.outputs.should_skip != 'true' }}
name: Build
runs-on: ubuntu-18.04
container: nmullane/qemu_rtems:5
container: ghcr.io/core-flight-system/qemu-rtems-5:latest

strategy:
fail-fast: false
Expand Down Expand Up @@ -65,7 +67,7 @@ jobs:
test-cfs:
name: Test
runs-on: ubuntu-18.04
container: nmullane/qemu_rtems:5
container: ghcr.io/core-flight-system/qemu-rtems-5:latest

needs: build-cfs

Expand All @@ -83,7 +85,6 @@ jobs:
# Disable mcopy check otherwise disk image build fails
MTOOLS_SKIP_CHECK: 1


steps:
# Checks out a copy of your repository on the ubuntu-latest machine
- name: Checkout code
Expand Down Expand Up @@ -122,4 +123,4 @@ jobs:
if: always()
with:
name: cFS-rtems-log-summary-${{ matrix.buildtype }}
path: ./build/exe/cpu1/*.log
path: ./build/exe/cpu1/*.log
1 change: 1 addition & 0 deletions .github/workflows/build-cfs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ env:
SIMULATION: native
OMIT_DEPRECATED: true
ENABLE_UNIT_TESTS: true
CTEST_OUTPUT_ON_FAILURE: true
REPO_NAME: ${{ github.event.repository.name }}

jobs:
Expand Down
10 changes: 10 additions & 0 deletions .github/workflows/codeql-build-reuse.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: Reuse CodeQl Analysis

on:
push:
pull_request:

jobs:
codeql:
name: CodeQL Analysis
uses: nasa/cFS/.github/workflows/codeql-build.yml@main
100 changes: 49 additions & 51 deletions .github/workflows/codeql-build.yml
Original file line number Diff line number Diff line change
@@ -1,37 +1,46 @@
name: "CodeQL Analysis"

# Only trigger, when the build workflow succeeded
on:
workflow_run:
workflows: ["Build, Test, and Run \\[OMIT_DEPRECATED = true\\]"]
types:
- completed
branches:
- '**'
workflow_call:
inputs:
setup:
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 Copy'
type: string
default: 'make'
tests:
description: 'Tests'
type: string
default: ''

env:
SIMULATION: native
ENABLE_UNIT_TESTS: true
OMIT_DEPRECATED: true
BUILDTYPE: release


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 }}
if: ${{ github.event.workflow_run.conclusion == 'success' }}
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"]'



CodeQL-Security-Build:
#Continue if check-for-duplicates found no duplicates. Always runs for pull-requests.
needs: check-for-duplicates
Expand All @@ -42,42 +51,37 @@ 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: ./.github/codeql/codeql-security.yml

# Setup the build system
config-file: nasa/cFS/.github/codeql/codeql-security.yml@main

- name: Copy sample_defs
if: ${{ !steps.skip-workflow.outputs.skip }}
run: |
cp ./cfe/cmake/Makefile.sample Makefile
cp -r ./cfe/cmake/sample_defs sample_defs
run: ${{ inputs.setup }}

# Setup the build system
- name: Make prep
run: ${{ inputs.make-prep }}

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

- name: Run tests
run: ${{ inputs.tests }}

# 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 @@ -88,45 +92,39 @@ 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
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: ./.github/codeql/codeql-coding-standard.yml
config-file: nasa/cFS/.github/codeql/codeql-coding-standard.yml@main

# Setup the build system
- name: Copy sample_defs
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
run: ${{ inputs.setup }}

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

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

- name: Run tests
run: ${{ inputs.tests }}

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

on-failure:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'failure' }}
steps:
- name: Fail workflow
run: exit 1
uses: github/codeql-action/analyze@v1
67 changes: 67 additions & 0 deletions .github/workflows/format-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: Format Check

# Run on all push and pull requests
on:
push:
pull_request:
workflow_call:

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"]'

format-checker:
name: Run format check
#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' }}
runs-on: ubuntu-18.04
timeout-minutes: 15

steps:
- name: Install format checker
run: |
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
sudo add-apt-repository 'deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic-10 main'
sudo apt-get update && sudo apt-get install clang-format-10

- name: Checkout bundle
uses: actions/checkout@v2
with:
repository: nasa/cFS

- name: Checkout
uses: actions/checkout@v2
with:
path: repo

- name: Generate format differences
run: |
cd repo
find . -name "*.[ch]" -exec clang-format-10 -i -style=file {} +
git diff > $GITHUB_WORKSPACE/style_differences.txt

- name: Archive Static Analysis Artifacts
uses: actions/upload-artifact@v2
with:
name: style_differences
path: style_differences.txt

- name: Error on differences
run: |
if [[ -s style_differences.txt ]];
then
cat style_differences.txt
exit -1
fi
10 changes: 10 additions & 0 deletions .github/workflows/static-analysis-reuse.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: Reuse Static Analysis

on:
push:
pull_request:

jobs:
static-analysis:
name: Static Analysis
uses: nasa/cFS/.github/workflows/static-analysis.yml@main
Loading