-
Notifications
You must be signed in to change notification settings - Fork 155
85 lines (82 loc) · 2.45 KB
/
Copy pathcodeql.yml
File metadata and controls
85 lines (82 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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
name: "CodeQL"
on:
push:
branches: [ "main" ]
pull_request:
schedule:
- cron: '21 13 * * 6'
jobs:
changes:
runs-on: ubuntu-latest
outputs:
src: ${{ steps.filter.outputs.src }}
steps:
- uses: actions/checkout@v4
- uses: dorny/paths-filter@v4
id: filter
if: github.event_name == 'pull_request'
with:
predicate-quantifier: 'some-with-excludes'
filters: |
src:
- '**'
- '!docker/**'
- '!.github/Dockerfile'
- '!**/*.md'
- '!.github/workflows/**'
- '!packaging/**'
analyze:
needs: [changes]
name: Analyze (${{ matrix.language }})
runs-on: 'ubuntu-latest'
container: fanout/build-base:latest
timeout-minutes: 15
permissions:
# required for all workflows
security-events: write
# required to fetch internal or private CodeQL packs
packages: read
# only required for workflows in private repositories
actions: read
contents: read
strategy:
fail-fast: true
matrix:
include:
- language: c-cpp
build-mode: manual
- language: javascript-typescript
build-mode: none
- language: python
build-mode: none
steps:
- name: Checkout repository
if: needs.changes.outputs.src != 'false'
uses: actions/checkout@v4
- name: Cache
if: needs.changes.outputs.src != 'false'
uses: Swatinem/rust-cache@v2
with:
shared-key: "codeql"
- if: needs.changes.outputs.src != 'false' && matrix.build-mode == 'manual'
shell: bash
env:
CPP_BUILD_DIR: ${{ github.workspace }}/cppbuild
run: cargo check --no-default-features --features do-qmake
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
if: needs.changes.outputs.src != 'false'
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
build-mode: ${{ matrix.build-mode }}
- if: needs.changes.outputs.src != 'false' && matrix.build-mode == 'manual'
shell: bash
env:
CPP_BUILD_DIR: ${{ github.workspace }}/cppbuild
run: cargo build --no-default-features --features do-cpp-build
- name: Perform CodeQL Analysis
if: needs.changes.outputs.src != 'false'
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{matrix.language}}"