Skip to content
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
7 changes: 6 additions & 1 deletion .github/workflows/format-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,18 @@ name: Format Check

# Run on all push and pull requests
on:
push:
branches:
- dev
- main
pull_request:
types:
- opened
- reopened
- synchronize
workflow_dispatch:

jobs:
format-check:
name: Run format check
uses: nasa/cFS/.github/workflows/format-check.yml@main
uses: nasa/cFS/.github/workflows/format-check.yml@dev
47 changes: 45 additions & 2 deletions .github/workflows/static-analysis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Static Analysis

# Run on all push and pull requests
# Run on pull requests and by dispatch
on:
push:
branches:
Expand All @@ -13,8 +13,51 @@ on:
- synchronize
workflow_dispatch:

# Force bash to apply pipefail option so pipeline failures aren't masked
defaults:
run:
shell: bash

jobs:
#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
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"]'

static-analysis:
name: Run cppcheck
uses: nasa/cFS/.github/workflows/static-analysis.yml@main
needs: checks-for-duplicates
if: ${{ needs.checks-for-duplicates.outputs.should_skip != 'true' || contains(github.ref, 'dev') }}
runs-on: ubuntu-latest
container: ghcr.io/core-flight-system/cfsbuildenv-linux:latest

strategy:
fail-fast: false

steps:
- name: Checkout
uses: actions/checkout@v4
with:
path: source

- name: CMake Setup
run: |
cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=TRUE -DENABLE_UNIT_TESTS=FALSE -B build -S source

- name: Run general cppcheck
run: cppcheck --force --inline-suppr --xml --project=build/compile_commands.json 2> cppcheck_err.xml

- name: Convert cppcheck results to Markdown
run: xsltproc source/.github/scripts/cppcheck-output.xslt cppcheck_err.xml | tee $GITHUB_STEP_SUMMARY cppcheck_err.txt

- name: Check for reported errors
run: tail -n 1 cppcheck_err.txt | grep -q '^\*\*0 error(s) reported\*\*$'
28 changes: 21 additions & 7 deletions .github/workflows/validation-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,28 @@ defaults:

env:
UPSTREAM_OSAL_REPO: nasa/osal
UPSTREAM_OSAL_REF: main
UPSTREAM_OSAL_REF: dev

jobs:
checks-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"]'

prepare-dependencies:
name: Prepare Dependencies
needs: checks-for-duplicates
if: ${{ needs.checks-for-duplicates.outputs.should_skip != 'true' || contains(github.ref, 'dev') }}
runs-on: ubuntu-latest
container: ghcr.io/core-flight-system/cfsbuildenv-linux:latest
steps:
- name: Cache EdsLib Source
uses: actions/cache@v3
Expand Down Expand Up @@ -58,6 +74,7 @@ jobs:
name: Build EdsLib and Execute Tests
needs: [prepare-dependencies]
runs-on: ubuntu-latest
container: ghcr.io/core-flight-system/cfsbuildenv-linux:latest

strategy:
fail-fast: false
Expand All @@ -69,9 +86,6 @@ jobs:

steps:

- name: Install Build Dependencies
run: sudo apt-get install liblua5.4-dev libpython3-dev libjson-c-dev pkg-config lcov xsltproc -y

# Note - caches were updated in "prepare-dependencies" job so all three of these should be a hit
- name: Retrieve Cached EdsLib Source
uses: actions/cache@v3
Expand All @@ -91,10 +105,10 @@ jobs:
# so in order to make this work it needs to adjust this.
- name: Import OSAL
run: |
sudo find ${GITHUB_WORKSPACE}/osal-staging -type d -print0 | xargs -0 chmod go+rx
sudo find ${GITHUB_WORKSPACE}/osal-staging -type f -print0 | xargs -0 chmod go+r
sudo find ${GITHUB_WORKSPACE}/osal-staging -type f -path '*/bin/*' -print0 | xargs -0 chmod go+x
sudo cp -rv -t / ${GITHUB_WORKSPACE}/osal-staging/*
sudo find /usr/local -type d -exec chmod go+rx {} \;
sudo find /usr/local -type f -exec chmod go+r {} \;
sudo find /usr/local -type f -path '*/bin/*' -exec chmod go+x {} \;

- name: Refresh Dynamic Linker Cache
run: sudo ldconfig
Expand Down
Loading