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
2 changes: 1 addition & 1 deletion .github/actions/setup-osal/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ runs:
using: 'composite'
steps:
- name: Checkout OSAL
uses: actions/checkout@v4
uses: actions/checkout@v5
with:
repository: ${{ inputs.upstream-repo }}
ref: ${{ inputs.upstream-ref }}
Expand Down
13 changes: 13 additions & 0 deletions .github/workflows/add-to-project.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Add Issue or PR to Project

on:
issues:
types: [opened]
pull_request_target:
types: [opened, ready_for_review, converted_to_draft]

jobs:
add-to-project:
name: Add issue or pull request to project
uses: nasa/cFS/.github/workflows/add-to-project-reusable.yml@dev
secrets: inherit
47 changes: 45 additions & 2 deletions .github/workflows/static-analysis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@

name: Static Analysis

# Run on all push and pull requests
# Run on pull requests and by dispatch
on:
push:
branches:
Expand All @@ -13,8 +14,50 @@ 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@v5
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\*\*$'
45 changes: 29 additions & 16 deletions .github/workflows/validation-test.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Internal Build And Run EdsLib Validation Tests
name: Build And Run EdsLib Validation Tests

on:
push:
Expand All @@ -19,30 +19,46 @@ 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
runs-on: ubuntu-latest
needs: checks-for-duplicates
if: ${{ needs.checks-for-duplicates.outputs.should_skip != 'true' || contains(github.ref, 'dev') }}
container: ghcr.io/core-flight-system/cfsbuildenv-linux:latest
steps:
- name: Cache EdsLib Source
uses: actions/cache@v3
uses: actions/cache@v5
id: cache-edslib
with:
path: ${{ github.workspace }}/source
key: edslib-source-${{ github.sha }}

- name: Cache OSAL Dependency
uses: actions/cache@v3
uses: actions/cache@v5
id: cache-osal
with:
path: ${{ github.workspace }}/osal-staging
key: edslib-dep-${{ env.UPSTREAM_OSAL_REPO }}@${{ env.UPSTREAM_OSAL_REF }}

- name: Checkout EdsLib
if: steps.cache-edslib.outputs.cache-hit != 'True'
uses: actions/checkout@v4
uses: actions/checkout@v5
with:
path: source

Expand All @@ -57,7 +73,8 @@ jobs:
build-and-test:
name: Build EdsLib and Execute Tests
needs: [prepare-dependencies]
runs-on: ubuntu-latest
runs-on: ubuntu-latest
container: ghcr.io/core-flight-system/cfsbuildenv-linux:latest

strategy:
fail-fast: false
Expand All @@ -69,20 +86,17 @@ 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
uses: actions/cache@v5
id: restore-source
with:
path: ${{ github.workspace }}/source
key: edslib-source-${{ github.sha }}

- name: Retrieve Cached OSAL Dependency
id: restore-osal
uses: actions/cache@v3
uses: actions/cache@v5
with:
path: ${{ github.workspace }}/osal-staging
key: edslib-dep-${{ env.UPSTREAM_OSAL_REPO }}@${{ env.UPSTREAM_OSAL_REF }}
Expand All @@ -91,11 +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 Expand Up @@ -135,4 +148,4 @@ jobs:
fi
if [ -s '${{ env.MATRIX_ID }}/lcov-summary.xml' ]; then
cat '${{ env.MATRIX_ID }}/lcov-summary.xml' >> $GITHUB_STEP_SUMMARY
fi
fi
Loading