Repository navigation
87 lines (77 loc) · 2.82 KB
/
Copy pathcodeql.yml
File metadata and controls
87 lines (77 loc) · 2.82 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
name: "CodeQL Advanced"
on:
workflow_dispatch:
schedule:
- cron: '39 18 * * 0'
jobs:
analyze:
name: Analyze (${{ matrix.language }})
# ubuntu-latest rolled to 26.04 (resolute), for which apt.llvm.org has no
# llvm-toolchain-<codename>-20 suite yet; the clang-20 install step 404s.
# Pin to 24.04 (noble), like every other workflow in this repo.
runs-on: ubuntu-24.04
permissions:
security-events: write
packages: read
actions: read
contents: read
strategy:
fail-fast: false
matrix:
include:
- language: javascript-typescript
build-mode: none
- language: python
build-mode: none
- language: c-cpp
build-mode: manual
- language: java-kotlin
build-mode: manual
- language: actions
build-mode: none
steps:
- name: Checkout repository
uses: actions/checkout@v5
- name: Set up JDK 21
if: matrix.language == 'java-kotlin'
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: '21'
- name: Install clang-20
if: matrix.language == 'c-cpp'
shell: bash
run: |
# Committed rather than downloaded; see bin/apt-install.sh.
sudo install -D -m 0644 bin/llvm-snapshot.gpg.key /etc/apt/keyrings/llvm.asc
UBUNTU_CODENAME=$(lsb_release -cs)
echo "deb [signed-by=/etc/apt/keyrings/llvm.asc] https://apt.llvm.org/${UBUNTU_CODENAME}/ llvm-toolchain-${UBUNTU_CODENAME}-20 main" \
| sudo tee /etc/apt/sources.list.d/llvm.list >/dev/null
sudo apt-get update -q
sudo apt-get install -q -y --no-install-recommends clang-20 lld-20
# Runtime Makefile invokes bare `clang` / `clang++`
sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-20 100
sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-20 100
- name: Init libbacktrace submodule
if: matrix.language == 'c-cpp'
run: git submodule update --init skiplang/prelude/libbacktrace
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
build-mode: ${{ matrix.build-mode }}
queries: security-extended
- name: Build C runtime (manual c-cpp)
if: matrix.language == 'c-cpp'
shell: bash
working-directory: skiplang/prelude/runtime
run: make CFLAGS="-O2 -g3 -I../libbacktrace" libskip_runtime64.a
- name: Build Kotlin sources (manual java-kotlin)
if: matrix.language == 'java-kotlin'
shell: bash
working-directory: sql/server
run: ./gradlew --no-daemon classes testClasses
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{matrix.language}}"