Skip to content

Commit 8051efc

Browse files
authored
Turn to manual build for Go for CodeQL (#38907)
* Turn to manual build for Go * update build sequence commands
1 parent 081c61e commit 8051efc

1 file changed

Lines changed: 23 additions & 7 deletions

File tree

.github/workflows/codeql.yml

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ jobs:
5555
# - language: c-cpp
5656
# build-mode: autobuild
5757
- language: go
58-
build-mode: autobuild
58+
build-mode: manual
5959
- language: java-kotlin
6060
build-mode: autobuild
6161
- language: javascript-typescript
@@ -76,6 +76,12 @@ jobs:
7676
- name: Checkout repository
7777
uses: actions/checkout@v6
7878

79+
- name: Set up Go
80+
if: matrix.language == 'go'
81+
uses: actions/setup-go@v6
82+
with:
83+
go-version-file: 'sdks/go.mod'
84+
7985
# Add any setup steps before running the `github/codeql-action/init` action.
8086
# This includes steps like installing compilers or runtimes (`actions/setup-node`
8187
# or others). This is typically only required for manual builds.
@@ -105,12 +111,22 @@ jobs:
105111
if: matrix.build-mode == 'manual'
106112
shell: bash
107113
run: |
108-
echo 'If you are using a "manual" build mode for one or more of the' \
109-
'languages you are analyzing, replace this with the commands to build' \
110-
'your code, for example:'
111-
echo ' make bootstrap'
112-
echo ' make release'
113-
exit 1
114+
if [ "${{ matrix.language }}" = "go" ]; then
115+
echo "Building sdks module..."
116+
(cd sdks && go build ./...)
117+
118+
echo "Building playground/backend module..."
119+
(cd playground/backend && go build ./...)
120+
121+
echo "Building learning/katas/go module..."
122+
(cd learning/katas/go && go mod tidy && go build ./...)
123+
124+
echo "Building learning/tour-of-beam/backend module..."
125+
(cd learning/tour-of-beam/backend && go build ./cmd/... ./internal/... ./playground_api/...)
126+
else
127+
echo "No manual build steps defined for ${{ matrix.language }}"
128+
exit 1
129+
fi
114130
115131
- name: Perform CodeQL Analysis
116132
uses: github/codeql-action/analyze@v4

0 commit comments

Comments
 (0)