Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #264, CodeQL Dependent on a Successful Build #304

Merged
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
23 changes: 17 additions & 6 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 @@ -117,7 +121,7 @@ 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 +131,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