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
name: CodeQL
on:
push:
branches:
pull_request:
branches:
schedule:
- cron: '0 6 * * 1'
permissions:
actions: read
contents: read
security-events: write
jobs:
analyze:
name: Analyze Rust
# Same routing as ci.yml: pushes, the weekly schedule and
# same-repository pull requests run on the CodeBuild-hosted runner (the
# CodeBuild project github-actions-runner, 60-minute build limit; the
# label must match the project name). Fork and Dependabot pull requests
# run on ubuntu-latest, so a dependency update's build scripts and
# procedural macros do not run in the CodeBuild account before a
# maintainer reviews them. This is routing, not a trust boundary: for
# forks, the boundary is the repository's approval setting for fork
# pull request workflows.
runs-on: ${{ github.event_name == 'pull_request' && (github.event.pull_request.head.repo.full_name != github.repository || github.actor == 'dependabot[bot]') && 'ubuntu-latest' || format('codebuild-github-actions-runner-{0}-{1}', github.run_id, github.run_attempt) }}
# Below the 60-minute build limit, so GitHub ends a stuck job and
# reports it, rather than CodeBuild stopping the runner.
timeout-minutes: 50
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/ensure-rustup
- name: Install Rust toolchain
run: rustup toolchain install stable --profile minimal && rustup default stable
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: rust
- name: Build
run: cargo build --all-features
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: /language:rust