CodeQL Nightly Analysis #489
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |