Update codeql-build.yml #24
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "CodeQL Analysis Script" | |
on: | |
push: | |
pull_request: | |
workflow_dispatch: | |
schedule: | |
# 11:15 PM UTC every Sunday | |
- cron: '15 23 * * 0' | |
jobs: | |
codeql: | |
name: Run CodeQL | |
runs-on: ${{ github.repository_owner == 'cFS' && 'linux' || 'ubuntu-latest' }} | |
strategy: | |
matrix: | |
target: ['coding-standard', 'security'] | |
steps: | |
- name: Checkout bundle | |
uses: actions/checkout@v3 | |
with: | |
repository: arielswalker/cFS | |
submodules: true | |
- name: Set Unique Variables | |
id: set-target | |
run: | | |
if [ "${{ matrix.target }}" == "coding-standard" ]; then | |
echo "TARGET=coding-standard" >> $GITHUB_ENV | |
elif [ "${{ matrix.target }}" == "security" ]; then | |
echo "TARGET=security" >> $GITHUB_ENV | |
fi | |
- name: Make the Script Executable | |
run: chmod +x ./.github/scripts/codeql.sh | |
- name: Run CodeQL Analysis Script | |
run: ./.github/scripts/codeql.sh | |
env: | |
TARGET: ${{ env.TARGET }} | |
COMPONENT_PATH: 'cfe' | |
MAKE_COMMAND: 'make -j8' | |
TEST_FLAG: 'true' | |
- name: Archive Sarif | |
uses: actions/upload-artifact@v4 | |
with: | |
name: CodeQL-Sarif | |
path: CodeQL-Sarif | |
- name: Upload SARIF | |
uses: github/codeql-action/upload-sarif@v3 | |
with: | |
sarif_file: CodeQL-Sarif-${{ matrix.scan-type }}/Codeql-${{ matrix.scan-type }}.sarif | |