Skip to content

Commit

Permalink
Fix nasa#264, CodeQL Dependent on Successful Build
Browse files Browse the repository at this point in the history
  • Loading branch information
arielswalker committed Jul 20, 2021
1 parent fb2968d commit 2649a44
Showing 1 changed file with 16 additions and 9 deletions.
25 changes: 16 additions & 9 deletions .github/workflows/codeql-build.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,28 @@
name: "CodeQL Analysis"

# Only trigger, when the build workflow succeeded
on:
push:
pull_request:
branches:
- main

workflow_run:
workflows: ["Build, Test, and Run \\[OMIT_DEPRECATED=true\\]"]
types:
- completed
branches:
- '**'
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
Expand Down Expand Up @@ -49,7 +53,6 @@ jobs:
run: |
git log -1 --pretty=oneline
git submodule
- name: Initialize CodeQL
if: ${{ !steps.skip-workflow.outputs.skip }}
uses: github/codeql-action/init@v1
Expand All @@ -63,7 +66,6 @@ jobs:
run: |
cp ./cfe/cmake/Makefile.sample Makefile
cp -r ./cfe/cmake/sample_defs sample_defs
# Setup the build system
- name: Make Install
if: ${{ !steps.skip-workflow.outputs.skip }}
Expand Down Expand Up @@ -95,7 +97,6 @@ jobs:
run: |
git log -1 --pretty=oneline
git submodule
- name: Checkout codeql code
if: ${{ !steps.skip-workflow.outputs.skip }}
uses: actions/checkout@v2
Expand All @@ -117,7 +118,6 @@ jobs:
run: |
cp ./cfe/cmake/Makefile.sample Makefile
cp -r ./cfe/cmake/sample_defs sample_defs
# Setup the build system
- name: Make Install
if: ${{ !steps.skip-workflow.outputs.skip }}
Expand All @@ -127,3 +127,10 @@ jobs:
- 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

0 comments on commit 2649a44

Please sign in to comment.