Repository navigation
84 lines (81 loc) · 2.72 KB
/
Copy pathcodeql.yml
File metadata and controls
84 lines (81 loc) · 2.72 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
name: CodeQL
on:
push:
branches: [master]
pull_request:
branches: [master]
types: [opened, synchronize, reopened, labeled]
schedule:
- cron: '23 4 * * 2'
workflow_dispatch:
permissions:
contents: read
jobs:
analyze:
name: CodeQL (${{ matrix.platform }})
if: >-
github.event_name != 'pull_request' ||
(contains(github.event.pull_request.labels.*.name, 'ci-codeql') &&
(github.event.action != 'labeled' || github.event.label.name == 'ci-codeql'))
runs-on: ${{ matrix.os }}
concurrency:
group: codeql-${{ matrix.platform }}-${{ github.event.pull_request.number || github.run_id }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
timeout-minutes: 20
permissions:
contents: read
security-events: write
env:
# Manual C/C++ builds require a full database rather than an overlay.
CODEQL_OVERLAY_DATABASE_MODE: none
# CodeQL's Windows path resolver loads a JNI native library.
JDK_JAVA_OPTIONS: --enable-native-access=ALL-UNNAMED
strategy:
fail-fast: false
matrix:
include:
- platform: linux
os: ubuntu-24.04
generator: Unix Makefiles
- platform: windows
os: windows-latest
generator: NMake Makefiles
- platform: macos
# CodeQL tracing requires macOS and Xcode earlier than version 27.
os: macos-15
generator: Unix Makefiles
steps:
- uses: actions/checkout@v7
- name: Install Linux dependencies
if: runner.os == 'Linux'
timeout-minutes: 5
run: |
sudo apt-get update
sudo apt-get install -y libudev-dev libusb-1.0-0-dev
- name: Set up MSVC
if: runner.os == 'Windows'
uses: TheMrMilchmann/setup-msvc-dev@v4
with:
arch: x64
- name: Select macOS toolchain
if: runner.os == 'macOS'
run: |
echo "DEVELOPER_DIR=/Applications/Xcode_16.4.app/Contents/Developer" >> "$GITHUB_ENV"
echo "CMAKE_APPLE_SILICON_PROCESSOR=arm64" >> "$GITHUB_ENV"
- name: Configure
timeout-minutes: 5
run: cmake -S . -B build -G "${{ matrix.generator }}" -DCMAKE_BUILD_TYPE=Release -DHIDAPI_WITH_TESTS=OFF -DHIDAPI_BUILD_HIDTEST=OFF
- name: Initialize CodeQL
uses: github/codeql-action/init@v4
timeout-minutes: 5
with:
languages: c-cpp
build-mode: manual
- name: Build
timeout-minutes: 5
run: cmake --build build --config Release
- name: Analyze CodeQL
uses: github/codeql-action/analyze@v4
timeout-minutes: 10
with:
category: /language:c-cpp/os:${{ matrix.platform }}