-
Notifications
You must be signed in to change notification settings - Fork 188
64 lines (56 loc) · 1.72 KB
/
codeql.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
# Kick off a daily battery of extended tests.
# Only runs if latest commit was made within today.
name: Make Daily
on:
schedule:
- cron: '0 0 * * *'
workflow_dispatch:
jobs:
# Ensures that cron job is skipped if no commit was made on that day.
check-date:
runs-on: ubuntu-latest
name: Check date of last commit
steps:
- uses: actions/checkout@v4
- id: should_run
continue-on-error: true
name: check latest commit is less than a day
if: ${{ github.event_name == 'schedule' }}
run: test -z $(git rev-list --after="24 hours" ${{ github.sha }}) && (echo "::set-output name=should_run::false" >> $GITHUB_OUTPUT)
outputs:
should_run: ${{ github.event_name != 'schedule' || steps.should_run.outputs.should_run }}
# Build and analyze with CodeQL
codeql:
needs: check-date
if: needs.check-date.outputs.should_run == 'true'
name: Analyze
runs-on:
group: github-v1
env:
CC: clang
permissions:
actions: read
contents: read
security-events: write
strategy:
fail-fast: false
matrix:
language: [cpp, python] # https://aka.ms/codeql-docs/language-support
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: dtolnay/[email protected]
- uses: ./.github/actions/deps
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
- name: Build
run: make -j -Otarget all rust
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
with:
category: "/language:${{matrix.language}}"
threads: 0