CI: add CodeQL workflow test
[project/ubox.git] / .github / workflows / codeql.yml
1 name: "CodeQL"
2
3 on:
4 push:
5 branches: [ "master" ]
6 pull_request:
7 branches: [ "master" ]
8 schedule:
9 - cron: '31 12 * * 1'
10
11 jobs:
12 analyze:
13 name: Analyze (c-cpp)
14 runs-on: ubuntu-latest
15 timeout-minutes: 360
16 permissions:
17 security-events: write
18
19 steps:
20 - name: Install Dependencies
21 run: |
22 sudo apt update && sudo apt install cmake make gcc pkg-config libjson-c-dev linux-headers-generic lua5.1 liblua5.1-0-dev
23
24 - name: Install libubox
25 run: |
26 git clone --depth=1 https://git.openwrt.org/project/libubox.git
27
28 cd libubox
29 cmake -DBUILD_EXAMPLES=OFF
30 make
31 sudo make install
32
33 - name: Install libubus
34 run: |
35 git clone --depth=1 https://git.openwrt.org/project/ubus.git
36
37 cd ubus
38 cmake -DBUILD_EXAMPLES=OFF
39 make
40 sudo make install
41
42 - name: Install libuci
43 run: |
44 git clone --depth=1 https://git.openwrt.org/project/uci.git
45
46 cd uci
47 cmake .
48 make
49 sudo make install
50
51 - name: Install libudebug
52 run: |
53 git clone --depth=1 https://github.com/jow-/ucode
54
55 cd ucode
56 cmake .
57 make
58 sudo make install
59
60 - name: Install libudebug
61 run: |
62 git clone --depth=1 https://git.openwrt.org/project/udebug.git
63
64 cd udebug
65 cmake .
66 make
67 sudo make install
68
69 - name: Checkout repository
70 uses: actions/checkout@v4
71
72 # Initializes the CodeQL tools for scanning.
73 - name: Initialize CodeQL
74 uses: github/codeql-action/init@v3
75 with:
76 languages: c-cpp
77 queries: security-and-quality
78
79 - name: Install ubox
80 run: |
81 cmake .
82 make
83 sudo make install
84
85 - name: Perform CodeQL Analysis
86 uses: github/codeql-action/analyze@v3
87 with:
88 category: "/language:c-cpp"