-
Notifications
You must be signed in to change notification settings - Fork 1.9k
93 lines (87 loc) · 3.52 KB
/
codeql-analysis.yml
File metadata and controls
93 lines (87 loc) · 3.52 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
name: "CodeQL"
on:
push:
branches: [ master ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ master ]
schedule:
- cron: '26 11 * * 5'
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.sha }}
cancel-in-progress: true
jobs:
analyze:
name: Analyze
runs-on: ${{ matrix.config.os }}
permissions:
actions: read
contents: read
security-events: write
strategy:
fail-fast: false
matrix:
config:
- { language: "cpp", os: ubuntu-latest }
- { language: "java", os: ubuntu-latest }
- { language: "python", os: ubuntu-latest }
- { language: "csharp", os: ubuntu-latest }
- { language: "csharp", os: windows-latest }
steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
submodules: false
- name: Init submodules with retry
shell: bash
run: |
git config --global --add safe.directory "$(pwd)"
for attempt in 1 2 3 4 5; do
if git submodule update --init --recursive; then
echo "Submodule init succeeded on attempt $attempt"
exit 0
fi
echo "Attempt $attempt failed, retrying in 15s..."
sleep 15
done
echo "Submodule init failed after 5 attempts"
exit 1
- uses: ilammy/msvc-dev-cmd@v1
if: ${{ startsWith(matrix.config.os, 'windows') }}
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.config.language }}
config-file: ./.github/codeql/codeql-config.yml
- name: Autobuild Python
if: matrix.config.language == 'python'
uses: github/codeql-action/autobuild@v3
- name: Build C++
if: matrix.config.language == 'cpp'
run: |
sudo apt update
sudo apt install -y ninja-build
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTING=Off
cmake --build build -t vw_cli_bin
- name: Build Java
if: matrix.config.language == 'java'
run: |
sudo apt update
sudo apt install -y ninja-build
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Debug -DBUILD_JAVA=On -DBUILD_TESTING=Off
cmake --build build -t vw_jni
- name: Build CSharp .NET Core
if: ${{ matrix.config.language == 'csharp' && startsWith(matrix.config.os, 'ubuntu') }}
run: |
sudo apt update
sudo apt install -y ninja-build
dotnet tool install --global dotnet-t4
cmake -S . -B build -G Ninja -Dvw_BUILD_NET_CORE=On -Dvw_DOTNET_USE_MSPROJECT=Off -DVW_FEAT_FLATBUFFERS=Off -DRAPIDJSON_SYS_DEP=Off -DFMT_SYS_DEP=Off -DSPDLOG_SYS_DEP=Off -DVW_ZLIB_SYS_DEP=Off -DVW_BOOST_MATH_SYS_DEP=Off -DVW_BUILD_VW_C_WRAPPER=Off -DBUILD_TESTING=Off -DBUILD_SHARED_LIBS=Off -DCMAKE_POLICY_VERSION_MINIMUM=3.5
cmake --build build --config Debug
- name: Build CSharp .NET Framework
if: ${{ matrix.config.language == 'csharp' && startsWith(matrix.config.os, 'windows') }}
run: |
cmake -S . -B build -G "Visual Studio 17 2022" -A x64 -Dvw_BUILD_NET_FRAMEWORK=On -DVW_FEAT_FLATBUFFERS=Off -DRAPIDJSON_SYS_DEP=Off -DFMT_SYS_DEP=Off -DSPDLOG_SYS_DEP=Off -DVW_ZLIB_SYS_DEP=Off -DVW_BOOST_MATH_SYS_DEP=Off -DVW_BUILD_VW_C_WRAPPER=Off -DBUILD_TESTING=Off -DBUILD_SHARED_LIBS=Off -DCMAKE_POLICY_VERSION_MINIMUM=3.5
cmake --build build --config Debug -- /p:UseSharedCompilation=false
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3