Skip to content

Commit 2ad14a5

Browse files
committed
adding build steps
1 parent d2d8382 commit 2ad14a5

File tree

1 file changed

+129
-2
lines changed

1 file changed

+129
-2
lines changed

.github/workflows/codeql.yml

Lines changed: 129 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ on:
99

1010
jobs:
1111
analyze:
12-
name: Analyze (${{ matrix.language }})
12+
name: Analyze Java
1313
# Runner size impacts CodeQL analysis time. To learn more, please see:
1414
# - https://gh.io/recommended-hardware-resources-for-running-codeql
1515
# - https://gh.io/supported-runners-and-hardware-resources
@@ -34,7 +34,7 @@ jobs:
3434
- language: actions
3535
build-mode: none
3636
- language: java
37-
build-mode: autobuild # This mode only analyzes Java. Set this to 'autobuild' or 'manual' to analyze Kotlin too.
37+
build-mode: manual # This mode only analyzes Java. Set this to 'autobuild' or 'manual' to analyze Kotlin too.
3838
- language: javascript-typescript
3939
build-mode: autobuild
4040
# CodeQL supports the following values keywords for 'language': 'actions', 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'rust', 'swift'
@@ -56,6 +56,32 @@ jobs:
5656
# uses: actions/setup-example@v1
5757

5858
# Initializes the CodeQL tools for scanning.
59+
60+
- name: Checkout
61+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
62+
with:
63+
fetch-depth: 0 # Important for versioning extension to work correctly
64+
- name: Mustache Specs
65+
run: |
66+
git submodule update --init --recursive
67+
- name: Set up JDK ${{ matrix.java_version }}
68+
uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00
69+
with:
70+
java-version: ${{ matrix.java_version }}
71+
distribution: "temurin"
72+
cache: maven
73+
- name: Install
74+
run: mvn clean install -DskipTests --batch-mode --no-transfer-progress
75+
env:
76+
BUILD_PORT: 0
77+
BUILD_SECURE_PORT: 0
78+
- name: Build
79+
run: mvn clean package --batch-mode --no-transfer-progress
80+
env:
81+
BUILD_PORT: 0
82+
BUILD_SECURE_PORT: 0
83+
84+
5985
- name: Initialize CodeQL
6086
uses: github/codeql-action/init@v3
6187
with:
@@ -88,3 +114,104 @@ jobs:
88114
uses: github/codeql-action/analyze@v3
89115
with:
90116
category: "/language:${{matrix.language}}"
117+
118+
119+
analyze2:
120+
name: Analyze Javascript
121+
runs-on: ubuntu-latest
122+
permissions:
123+
# required for all workflows
124+
security-events: write
125+
126+
# required to fetch internal or private CodeQL packs
127+
packages: read
128+
129+
# only required for workflows in private repositories
130+
actions: read
131+
contents: read
132+
133+
strategy:
134+
fail-fast: false
135+
matrix:
136+
include:
137+
- language: actions
138+
build-mode: none
139+
- language: javascript-typescript
140+
build-mode: manual
141+
# CodeQL supports the following values keywords for 'language': 'actions', 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'rust', 'swift'
142+
# Use `c-cpp` to analyze code written in C, C++ or both
143+
# Use 'java-kotlin' to analyze code written in Java, Kotlin or both
144+
# Use 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
145+
# To learn more about changing the languages that are analyzed or customizing the build mode for your analysis,
146+
# see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning.
147+
# If you are analyzing a compiled language, you can modify the 'build-mode' for that language to customize how
148+
# your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages
149+
steps:
150+
- name: Checkout repository
151+
uses: actions/checkout@v4
152+
153+
# Add any setup steps before running the `github/codeql-action/init` action.
154+
# This includes steps like installing compilers or runtimes (`actions/setup-node`
155+
# or others). This is typically only required for manual builds.
156+
# - name: Setup runtime (example)
157+
# uses: actions/setup-example@v1
158+
159+
# Initializes the CodeQL tools for scanning.
160+
161+
- name: Checkout
162+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
163+
with:
164+
fetch-depth: 0 # Important for versioning extension to work correctly
165+
- name: Mustache Specs
166+
run: |
167+
git submodule update --init --recursive
168+
- name: Set up JDK ${{ matrix.javascript_version }}
169+
uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00
170+
with:
171+
java-version: ${{ matrix.javascript_version }}
172+
distribution: "temurin"
173+
cache: maven
174+
- name: Install
175+
run: mvn clean install -DskipTests --batch-mode --no-transfer-progress
176+
env:
177+
BUILD_PORT: 0
178+
BUILD_SECURE_PORT: 0
179+
- name: Build
180+
run: mvn clean package --batch-mode --no-transfer-progress
181+
env:
182+
BUILD_PORT: 0
183+
BUILD_SECURE_PORT: 0
184+
185+
186+
- name: Initialize CodeQL
187+
uses: github/codeql-action/init@v3
188+
with:
189+
languages: ${{ matrix.language }}
190+
build-mode: ${{ matrix.build-mode }}
191+
# If you wish to specify custom queries, you can do so here or in a config file.
192+
# By default, queries listed here will override any specified in a config file.
193+
# Prefix the list here with "+" to use these queries and those in the config file.
194+
195+
# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
196+
queries: security-extended,security-and-quality
197+
198+
# If the analyze step fails for one of the languages you are analyzing with
199+
# "We were unable to automatically build your code", modify the matrix above
200+
# to set the build mode to "manual" for that language. Then modify this step
201+
# to build your code.
202+
# ℹ️ Command-line programs to run using the OS shell.
203+
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
204+
- if: matrix.build-mode == 'manual'
205+
shell: bash
206+
run: |
207+
echo 'If you are using a "manual" build mode for one or more of the' \
208+
'languages you are analyzing, replace this with the commands to build' \
209+
'your code, for example:'
210+
echo ' make bootstrap'
211+
echo ' make release'
212+
exit 1
213+
214+
- name: Perform CodeQL Analysis
215+
uses: github/codeql-action/analyze@v3
216+
with:
217+
category: "/language:${{matrix.language}}"

0 commit comments

Comments
 (0)