-
Notifications
You must be signed in to change notification settings - Fork 5
93 lines (79 loc) · 2.35 KB
/
codeql.yaml
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
# SPDX-License-Identifier: Apache-2.0 OR MIT
#
# SPDX-FileCopyrightText: Copyright 2022 Micron Technology, Inc.
name: CodeQL
on:
push:
branches:
- master
- "v[0-9]+.[0-9]+"
pull_request:
branches:
- master
- "v[0-9]+.[0-9]+"
paths:
- "**.c"
- "**.h"
- "**.java"
- "**/meson.build"
- .github/workflows/codeql.yaml
schedule:
- cron: 0 0 * * SUN
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref }}
cancel-in-progress: true
permissions:
security-events: write
jobs:
determine-tag:
runs-on: ubuntu-latest
continue-on-error: false
outputs:
tag: ${{ steps.determine-tag.outputs.tag }}
steps:
- name: Determine tag
id: determine-tag
run: |
if [ "$GITHUB_EVENT_NAME" = "pull_request" ]; then
echo "tag=$GITHUB_BASE_REF" >> "$GITHUB_OUTPUT"
else
echo "tag=$GITHUB_REF_NAME" >> "$GITHUB_OUTPUT"
fi
codeql:
runs-on: ubuntu-latest
needs:
- determine-tag
container:
image: ghcr.io/hse-project/ci-images/fedora-37:${{ needs.determine-tag.outputs.tag }}
steps:
- name: Checkout hse-java
uses: actions/checkout@v3
- name: Checkout HSE
uses: actions/checkout@v3
with:
repository: hse-project/hse
path: subprojects/hse
- name: Cache Meson packagecache
uses: actions/cache@v3
with:
path: subprojects/packagecache
key: meson-packagecache-fedora-37-${{ hashFiles('subprojects/hse/subprojects/*.wrap') }}
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
config-file: .github/codeql/codeql-config.yaml
# Ideally we compile no code from subprojects other than built-in code.
# CodeQL will analyze any code that actually gets built. Fedora doesn't
# package all cJSON functionality we need, so build it and cross fingers!
#
# https://bugzilla.redhat.com/show_bug.cgi?id=2117773
- name: Setup
run: |
meson setup builddir --fatal-meson-warnings --werror \
-Dwrap_mode=nofallback -Dforce_fallback_for=hse,cjson \
-Ddocs=false
- name: Build
run: |
ninja -C builddir
- name: Perform CodeQL analysis
uses: github/codeql-action/analyze@v3