Skip to content

Commit d149327

Browse files
authored
Update CodeQL to Ignore .gyp Files and Compile C++ (#67)
* Update codeql to ignore .gyp files. * Update the auto-build with codeql to build cpp instead of js. * Update ignored paths to agree with project naming. * Update codeql versions. * Update codeql-analysis.yml * Try basic manual compile step. * Attempt to use g++ to compile. * Try autobuilt v3. * Update codeql-analysis.yml * Try to fix autobuilder by setting a tracing directory path. * Have no cmake file so try manually compiling and linking. * Fix .cc file names. * Update codeql-analysis.yml * Include nan dependency. * Update codeql-analysis.yml * Configure node-gyp for dependencies. * Update codeql-analysis.yml * Update codeql-analysis.yml * Try using node-gyp instead. * Update codeql-analysis.yml * Update codeql-analysis.yml * Update codeql-analysis.yml * Update codeql-analysis.yml * Update codeql-analysis.yml * Update codeql-analysis.yml * Update codeql-analysis.yml * Update codeql-analysis.yml * Update codeql-analysis.yml * Update codeql-analysis.yml * Update codeql-analysis.yml * Update codeql-analysis.yml
1 parent f8e3e85 commit d149327

File tree

2 files changed

+41
-10
lines changed

2 files changed

+41
-10
lines changed

Diff for: .github/codeql/codeql-config.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,6 @@ queries:
44
- uses: security-and-quality
55

66
paths-ignore:
7-
- '**/tests/'
7+
- '**/test/'
88
- '**/out/'
9+
- '**/*.gyp'

Diff for: .github/workflows/codeql-analysis.yml

+39-9
Original file line numberDiff line numberDiff line change
@@ -32,18 +32,18 @@ jobs:
3232
strategy:
3333
fail-fast: false
3434
matrix:
35-
language: [ 'javascript' ]
35+
language: [ 'cpp' ]
3636
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
3737
# Learn more:
3838
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed
3939

4040
steps:
4141
- name: Checkout repository
42-
uses: actions/checkout@v2
42+
uses: actions/checkout@v3
4343

4444
# Initializes the CodeQL tools for scanning.
4545
- name: Initialize CodeQL
46-
uses: github/codeql-action/init@v1
46+
uses: github/codeql-action/init@v3
4747
with:
4848
languages: ${{ matrix.language }}
4949
config-file: ./.github/codeql/codeql-config.yml
@@ -54,8 +54,8 @@ jobs:
5454

5555
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
5656
# If this step fails, then you should remove it and run the build manually (see below)
57-
- name: Autobuild
58-
uses: github/codeql-action/autobuild@v1
57+
# - name: Autobuild
58+
# uses: github/codeql-action/autobuild@v3
5959

6060
# ℹ️ Command-line programs to run using the OS shell.
6161
# 📚 https://git.io/JvXDl
@@ -64,9 +64,39 @@ jobs:
6464
# and modify them (or add more) to build your code if your project
6565
# uses a compiled language
6666

67-
#- run: |
68-
# make bootstrap
69-
# make release
67+
- name: Install Node.js
68+
uses: actions/setup-node@v2
69+
with:
70+
node-version: '16'
71+
72+
- name: Install node-pre-gyp globally
73+
run: npm install -g @mapbox/node-pre-gyp
74+
75+
- name: Install Node gyp
76+
run: npm install -g node-gyp
77+
78+
- name: Install node-pre-gyp globally
79+
run: node-pre-gyp install --fallback-to-build
80+
81+
- name: Install nan globally
82+
run: npm install -g nan
83+
84+
- name: Install Python
85+
uses: actions/setup-python@v2
86+
with:
87+
python-version: '3.x'
88+
89+
- name: Install Make
90+
run: sudo apt-get update && sudo apt-get install -y make
91+
92+
- name: Install GCC
93+
run: sudo apt-get update && sudo apt-get install -y gcc
94+
95+
- name: Build
96+
run: |
97+
npm install --save nan
98+
node-gyp configure
99+
node-gyp rebuild
70100
71101
- name: Perform CodeQL Analysis
72-
uses: github/codeql-action/analyze@v1
102+
uses: github/codeql-action/analyze@v3

0 commit comments

Comments
 (0)