-
-
Notifications
You must be signed in to change notification settings - Fork 37
89 lines (79 loc) · 2.99 KB
/
Copy pathcodeql.yml
File metadata and controls
89 lines (79 loc) · 2.99 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
name: "CodeQL"
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
schedule:
- cron: '16 10 * * 1'
jobs:
analyze:
name: Analyze (Go Multi-OS & Multi-Arch)
runs-on: ubuntu-latest
timeout-minutes: 20
permissions:
security-events: write
packages: read
actions: read
contents: read
steps:
- name: Checkout repository
uses: actions/checkout@v7
- name: Setup Go
uses: actions/setup-go@v6
with:
go-version: '1.26.8'
- name: Initialize CodeQL
uses: github/codeql-action/init@v4
with:
languages: go
- name: Manual Build (Clean Multi-OS Matrix)
shell: bash
run: |
platforms=("windows" "linux" "darwin")
architectures=("amd64" "arm64")
targets=(
"./server|server/server"
"./server-genCert|server/bin/genCert"
"./launcher|launcher/launcher"
"./launcher-agent|launcher/agent"
"./launcher-config|launcher/bin/config"
"./launcher-config-admin|launcher/bin/config-admin"
"./launcher-config-admin-agent|launcher/bin/config-admin-agent"
"./battle-server-manager|battle-server-manager/battle-server-manager"
"./tools/server-replay|tools/server-replay"
"./tools/scripts/cmd/copyBattleServerManagerResources.go|tools/scripts/copyBattleServerManagerResources"
"./tools/scripts/cmd/copyLauncherResources.go|tools/scripts/copyLauncherResources"
"./tools/scripts/cmd/copyServerResources.go|tools/scripts/copyServerResources"
"./tools/scripts/cmd/createServerResourcesFolder.go|tools/scripts/createServerResourcesFolder"
"./tools/scripts/cmd/generateGoreleaserConfig.go|tools/scripts/generateGoreleaserConfig"
)
windows_targets=(
"./tools/mock/battle-server/main_windows.go|tools/battle-server"
"./tools/mock/launcher/main.go|tools/launcher"
"./tools/mock/game/main_windows.go|tools/game"
)
for os in "${platforms[@]}"; do
for arch in "${architectures[@]}"; do
echo "::group::Compiling for $os-$arch"
export GOOS=$os
export GOARCH=$arch
ext=""
current_targets=("${targets[@]}")
if [ "$os" = "windows" ]; then
ext=".exe"
current_targets+=("${windows_targets[@]}")
fi
for target in "${current_targets[@]}"; do
IFS="|" read -r src dest <<< "$target"
out_path="build/$os/$arch/$dest$ext"
echo "-> GOOS=$os GOARCH=$arch go build -o $out_path $src"
go build -o "$out_path" "$src"
done
echo "::endgroup::"
done
done
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v4
with:
category: "/language:go"