diff --git a/.github/workflows/format-check.yml b/.github/workflows/format-check.yml index 441199a..243ad40 100644 --- a/.github/workflows/format-check.yml +++ b/.github/workflows/format-check.yml @@ -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 \ No newline at end of file diff --git a/.github/workflows/static-analysis.yml b/.github/workflows/static-analysis.yml index 40c4cd9..5bd0380 100644 --- a/.github/workflows/static-analysis.yml +++ b/.github/workflows/static-analysis.yml @@ -1,6 +1,6 @@ name: Static Analysis -# Run on all push and pull requests +# Run on pull requests and by dispatch on: push: branches: @@ -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\*\*$' \ No newline at end of file diff --git a/.github/workflows/validation-test.yml b/.github/workflows/validation-test.yml index f900172..372f8b6 100644 --- a/.github/workflows/validation-test.yml +++ b/.github/workflows/validation-test.yml @@ -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 @@ -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 @@ -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 @@ -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