Repository navigation
71 lines (67 loc) · 2.45 KB
/
Copy pathcodeql.yaml
File metadata and controls
71 lines (67 loc) · 2.45 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
# CodeQL for both languages in this repository.
#
# Requires CodeQL default setup to be OFF for this repository:
# Settings > Code security > Code scanning > CodeQL analysis > Advanced
# (or the "..." menu > Switch to advanced). GitHub refuses uploads from a
# workflow while default setup is enabled -
# "CodeQL analyses from advanced configurations cannot be processed when the
# default setup is enabled" - and default setup covers neither the C library
# nor a build this project controls, which is the reason for this file.
#
# Not part of CI: a CodeQL run takes much longer than the checks a pull request
# waits on, and its findings are advisory. It runs on merges to main, weekly,
# and on demand, and reports into the repository's Security tab.
name: CodeQL
on:
push:
branches:
- main
schedule:
# Mondays, early UTC: a fresh query pack finds things in unchanged code.
- cron: '30 3 * * 1'
workflow_dispatch:
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
analyze:
name: Analyze ${{ matrix.language }}
runs-on: ubuntu-24.04
timeout-minutes: 90
permissions:
contents: read
security-events: write
actions: read
strategy:
fail-fast: false
matrix:
include:
- language: go
build-mode: autobuild
- language: c-cpp
build-mode: manual
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
persist-credentials: false
- uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7
if: matrix.language == 'go'
with:
go-version-file: go.mod
- name: Initialize CodeQL
uses: github/codeql-action/init@2892aa5e19bbd11bc0cff5427e3b750a04d9e3c2 # v4
with:
languages: ${{ matrix.language }}
build-mode: ${{ matrix.build-mode }}
- name: Build the library
# CodeQL's C analysis needs to watch a real compile. Only the helper
# tools under library/tools need a CUDA toolkit, so the .so itself
# builds here without pulling a multi-gigabyte CUDA image.
if: matrix.language == 'c-cpp'
run: make -C library build WITH_CUDA_TOOLS=OFF
- name: Perform CodeQL analysis
uses: github/codeql-action/analyze@2892aa5e19bbd11bc0cff5427e3b750a04d9e3c2 # v4
with:
category: /language:${{ matrix.language }}