forked from nasa/cFE
-
Notifications
You must be signed in to change notification settings - Fork 0
84 lines (73 loc) · 2.38 KB
/
codeql-build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
name: "CodeQL Analysis Script"
on:
push:
pull_request:
workflow_dispatch:
schedule:
# 11:15 PM UTC every Sunday
- cron: '15 23 * * 0'
jobs:
#Checks for duplicate actions. Skips push actions if there is a matching or duplicate pull-request action.
check-for-duplicates:
runs-on: ubuntu-20.04
# 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:
name: Run CodeQL
runs-on: ${{ github.repository_owner == 'cFS' && 'linux' || 'ubuntu-latest' }}
needs: check-for-duplicates
strategy:
matrix:
target: ['coding-standard', 'security']
fail-fast: false
steps:
- name: Checkout bundle
uses: actions/checkout@v3
with:
repository: arielswalker/cFS
submodules: true
- name: Checkout ${{ github.repository }}
uses: actions/checkout@v4
with:
submodules: recursive
path: cfe
- name: Make the Script Executable
run: chmod +x ./.github/scripts/codeql.sh
- name: Run CodeQL Analysis Script
run: ./.github/scripts/codeql.sh
env:
TARGET: ${{ matrix.target }}
COMPONENT_PATH: 'cfe'
MAKE_COMMAND: 'make -j8'
TEST_FLAG: 'true'
- name: Move Sarif
run: |
mv cfe/Codeql-${{ matrix.target }}.sarif .
- name: Filter Sarif
uses: advanced-security/filter-sarif@v1
with:
patterns: |
-**/*.md
-**/*.txt
-**/*.dox
input: Codeql-${{ matrix.target }}.sarif
output: Codeql-${{ matrix.target }}.sarif
- name: Archive Sarif
uses: actions/upload-artifact@v4
with:
name: CodeQL-Sarif-${{ matrix.target }}
path: Codeql-${{ matrix.target }}.sarif
- name: Upload SARIF
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: Codeql-${{ matrix.target }}.sarif
token: ${{ secrets.GITHUB_TOKEN }}
checkout_path: cfe