diff --git a/.github/workflows/codeql-build.yml b/.github/workflows/codeql-build.yml index 1f9571b3b..3eb1cd3b6 100644 --- a/.github/workflows/codeql-build.yml +++ b/.github/workflows/codeql-build.yml @@ -11,8 +11,23 @@ env: 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 }} + 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-Build: + CodeQL-Security-Build: + needs: check-for-duplicates + if: ${{ needs.check-for-duplicates.outputs.should_skip != 'true' }} runs-on: ubuntu-18.04 timeout-minutes: 15 @@ -35,8 +50,8 @@ jobs: - name: Initialize CodeQL uses: github/codeql-action/init@v1 with: - languages: c - queries: +security-extended, security-and-quality + languages: c + config-file: nasa/cFS/.github/codeql/codeql-security.yml@main # Setup the build system - name: Set up for build @@ -44,11 +59,59 @@ jobs: cp ./cfe/cmake/Makefile.sample Makefile cp -r ./cfe/cmake/sample_defs sample_defs make prep - + # Build the code - name: Build run: | make -C build/native/default_cpu1 core_api core_private es evs fs msg resourceid sb sbr tbl time - - name: Perform CodeQL Analysis uses: github/codeql-action/analyze@v1 + + CodeQL-Coding-Standard-Build: + needs: check-for-duplicates + if: ${{ needs.check-for-duplicates.outputs.should_skip != 'true' }} + runs-on: ubuntu-18.04 + timeout-minutes: 15 + + steps: + # Checks out a copy of your repository on the ubuntu-latest machine + - name: Checkout bundle + uses: actions/checkout@v2 + with: + repository: nasa/cFS + submodules: true + + - name: Checkout submodule + uses: actions/checkout@v2 + with: + path: cfe + + - name: Check versions + run: git submodule + + - name: Checkout codeql code + uses: actions/checkout@v2 + with: + repository: github/codeql + submodules: true + path: codeql + + - name: Initialize CodeQL + uses: github/codeql-action/init@v1 + with: + languages: c + config-file: nasa/cFS/.github/codeql/codeql-coding-standard.yml@main + + # Setup the build system + - name: Set up for build + run: | + cp ./cfe/cmake/Makefile.sample Makefile + cp -r ./cfe/cmake/sample_defs sample_defs + make prep + + # Build the code + - name: Build + run: | + make -C build/native/default_cpu1 core_api core_private es evs fs msg resourceid sb sbr tbl time + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v1 \ No newline at end of file