-
Notifications
You must be signed in to change notification settings - Fork 2
221 lines (199 loc) · 7.14 KB
/
Copy pathnative-build.yml
File metadata and controls
221 lines (199 loc) · 7.14 KB
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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
name: Build javascript-templates Component in Native Environment
on:
push:
branches: [ main, 'sprint/**', 'release/**', develop ]
pull_request:
branches: [ main, 'sprint/**', 'release/**', topic/RDK*, develop ]
permissions:
actions: read
contents: read
pull-requests: read
jobs:
build-jst-on-push:
name: Build javascript-templates component on push
if: github.event_name == 'push'
runs-on: ubuntu-latest
container:
image: ghcr.io/rdkcentral/docker-rdk-ci:latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: native build
run: |
# Trust the workspace
git config --global --add safe.directory '*'
# Pull the latest changes for the native build system
git submodule update --init --recursive --remote
# Build and install dependencies
chmod +x build_tools_workflows/cov_docker_script/setup_dependencies.sh
./build_tools_workflows/cov_docker_script/setup_dependencies.sh ./cov_docker_script/component_config.json
# Build component
chmod +x build_tools_workflows/cov_docker_script/build_native.sh
./build_tools_workflows/cov_docker_script/build_native.sh ./cov_docker_script/component_config.json "$(pwd)"
env:
GITHUB_TOKEN: ${{ secrets.RDKCM_RDKE }}
build-jst-on-pr:
name: Build javascript-templates component on PR
needs: detect-source-changes
if: github.event_name == 'pull_request' && needs.detect-source-changes.outputs.has_component == 'true'
runs-on: ubuntu-latest
container:
image: ghcr.io/rdkcentral/docker-rdk-ci:latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: native build
run: |
# Trust the workspace
git config --global --add safe.directory '*'
# Pull the latest changes for the native build system
git submodule update --init --recursive --remote
# Build and install dependencies
chmod +x build_tools_workflows/cov_docker_script/setup_dependencies.sh
./build_tools_workflows/cov_docker_script/setup_dependencies.sh ./cov_docker_script/component_config.json
# Build component
chmod +x build_tools_workflows/cov_docker_script/build_native.sh
./build_tools_workflows/cov_docker_script/build_native.sh ./cov_docker_script/component_config.json "$(pwd)"
env:
GITHUB_TOKEN: ${{ secrets.RDKCM_RDKE }}
detect-source-changes:
name: Detect source path changes for CodeQL
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
outputs:
has_component: ${{ steps.filter.outputs.component }}
has_cpp: ${{ steps.filter.outputs.cpp }}
has_python: ${{ steps.filter.outputs.python }}
has_js: ${{ steps.filter.outputs.javascript }}
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Detect changed source paths
id: filter
uses: dorny/paths-filter@v4
with:
predicate-quantifier: some-with-excludes
filters: |
component:
- 'source/**/*'
cpp:
- 'source/**/*.c'
- 'source/**/*.h'
- 'source/**/*.cpp'
- 'tools/**/*.c'
- 'tools/**/*.h'
- 'tools/**/*.cpp'
- 'tests/**/*.c'
- 'tests/**/*.h'
- 'tests/**/*.cpp'
python:
- 'build_tools_workflows/**/*.py'
- 'cov_docker_script/**/*.py'
- 'tools/**/*.py'
- 'tests/**/*.py'
javascript:
- 'source/**/*.js'
- 'source/**/*.ts'
- 'jsts/**/*.js'
- 'jsts/**/*.ts'
- 'tests/**/*.js'
- 'tests/**/*.ts'
- '!jsts/jst_prefix.js'
- '!jsts/jst_suffix.js'
- '!tests/parser/jst_prefix.js'
- '!tests/parser/jst_suffix.js'
- '!tests/parser/**/*.jst.parsed'
codeql-c-cpp:
name: CodeQL (C/C++)
needs: detect-source-changes
if: github.event_name == 'pull_request' && needs.detect-source-changes.outputs.has_cpp == 'true'
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write
container:
image: ghcr.io/rdkcentral/docker-rdk-ci:latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Initialize CodeQL (C/C++)
uses: github/codeql-action/init@v4
with:
languages: c-cpp
build-mode: manual
- name: Build component for CodeQL
run: |
git config --global --add safe.directory '*'
git submodule update --init --recursive
chmod +x build_tools_workflows/cov_docker_script/setup_dependencies.sh
./build_tools_workflows/cov_docker_script/setup_dependencies.sh ./cov_docker_script/component_config.json
chmod +x build_tools_workflows/cov_docker_script/build_native.sh
./build_tools_workflows/cov_docker_script/build_native.sh ./cov_docker_script/component_config.json "$(pwd)"
env:
GITHUB_TOKEN: ${{ secrets.RDKCM_RDKE }}
- name: Analyze C/C++
uses: github/codeql-action/analyze@v4
with:
category: '/language:c-cpp'
codeql-python:
name: CodeQL (Python)
needs: detect-source-changes
if: github.event_name == 'pull_request' && needs.detect-source-changes.outputs.has_python == 'true'
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Initialize CodeQL (Python)
uses: github/codeql-action/init@v4
with:
languages: python
build-mode: none
config: |
paths:
- build_tools_workflows
- cov_docker_script
- tools
- tests
- name: Analyze Python
uses: github/codeql-action/analyze@v4
with:
category: '/language:python'
codeql-javascript:
name: CodeQL (JavaScript)
needs: detect-source-changes
if: github.event_name == 'pull_request' && needs.detect-source-changes.outputs.has_js == 'true'
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Initialize CodeQL (JavaScript)
uses: github/codeql-action/init@v4
with:
languages: javascript-typescript
build-mode: none
config: |
paths:
- source
- jsts
- tests
paths-ignore:
- jsts/jst_prefix.js
- jsts/jst_suffix.js
- tests/parser/jst_prefix.js
- tests/parser/jst_suffix.js
- tests/parser/**/*.jst.parsed
- name: Analyze JavaScript
uses: github/codeql-action/analyze@v4
with:
category: '/language:javascript-typescript'