-
-
Notifications
You must be signed in to change notification settings - Fork 5
152 lines (128 loc) · 4.58 KB
/
codeql-analysis.yml
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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
name: "CodeQL"
on:
push:
branches: [master]
pull_request:
# The branches below must be a subset of the branches above
branches: [master]
schedule:
- cron: '0 21 * * 0'
workflow_dispatch:
jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
# Override automatic language detection by changing the below list
# Supported options are ['csharp', 'cpp', 'go', 'java', 'javascript', 'python']
language: ['cpp', 'java']
# Learn more...
# https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#overriding-automatic-language-detection
steps:
- name: Checkout repository
uses: actions/checkout@main
with:
# We must fetch at least the immediate parents so that if this is
# a pull request then we can checkout the head.
fetch-depth: 2
- if: matrix.language == 'java'
name: Checkout GIT submodules (java)
run: |
git submodule init
git submodule update client/radioGUI/lib/jsimconnect
- if: matrix.language == 'java'
name: Setup Java
uses: actions/setup-java@main
with:
java-version: '11' # The JDK version to make available on the path.
distribution: adopt
- if: matrix.language == 'cpp'
name: Setup C++
run: sudo apt-get install libssl-dev mingw-w64 mingw-w64-common build-essential
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main
- if: matrix.language == 'java'
name: Build Java
run: |
make build-radioGUI
- if: matrix.language == 'cpp'
name: Build C++ Tests (Linux x64)
run: |
make clean test
- if: matrix.language == 'cpp'
name: Build C++ (Linux x64)
run: |
make clean tools plugin
- if: matrix.language == 'cpp'
name: Build C++ (Windows x64 mingw-crosscompile)
# skip openssl build, it takes long and will trigger false-positives
run: |
make SSLFLAGS= clean tools-win64 plugin-win64
- if: matrix.language == 'cpp'
name: Build C++ (Windows x32 mingw-crosscompile)
# skip openssl build, it takes long and will trigger false-positives
run: |
make SSLFLAGS= clean plugin-win32
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
#
# Syntax checking
#
analyze-php:
name: Analyze (php)
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@main
with:
# We must fetch at least the immediate parents so that if this is
# a pull request then we can checkout the head.
fetch-depth: 2
- name: Check PHP syntax errors
uses: overtrue/phplint@main
with:
path: server/statuspage/
options: --exclude=vendor
analyze-lua:
name: Analyze (lua)
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@main
with:
# We must fetch at least the immediate parents so that if this is
# a pull request then we can checkout the head.
fetch-depth: 2
- name: Setup programs
run: |
sudo apt-get -y install lua-check
#- name: Check LUA syntax errors
# run: |
# find . -name '*.lua' -print > luacheck.list
# while read file; do echo "LuaLintCheck: $file"; luac -p "$file"; done <luacheck.list
# invoke luacheck, but make the run-action return only with errors, not with warnings (i.e. RC>1)
- name: Check LUA syntax errors
continue-on-error: true
run: |
luacheck . && lrc=$? || lrc=$?
echo "LUACHECK_RC=$lrc" >> $GITHUB_ENV
- name: Evaluate luacheck return code
run: |
r=0
if [[ "${{env.LUACHECK_RC}}" -gt 1 ]]; then r=1; fi
echo "LUACHECK returned ${{env.LUACHECK_RC}}, translated to step_rc=$r"
exit $r