-
Notifications
You must be signed in to change notification settings - Fork 0
67 lines (56 loc) · 1.55 KB
/
Copy pathcodeql.yml
File metadata and controls
67 lines (56 loc) · 1.55 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
# CodeQL Security Analysis
# CodeQL 安全分析
#
# This workflow performs security analysis using GitHub CodeQL.
# 此工作流使用 GitHub CodeQL 执行安全分析。
name: CodeQL
permissions:
contents: read
security-events: write
on:
push:
branches: [main, develop]
paths:
- '**/*.rs'
- '**/Cargo.toml'
pull_request:
branches: [main, develop]
paths:
- '**/*.rs'
- '**/Cargo.toml'
schedule:
# Run security analysis weekly on Mondays at 00:00 UTC
# 每周一 00:00 UTC 运行安全分析
- cron: '0 0 * * 1'
env:
CARGO_TERM_COLOR: always
jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: rust
queries: security-extended,security-and-quality
config-file: .github/codeql-config.yml
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Cache cargo build
uses: Swatinem/rust-cache@v2
- name: Install system dependencies / 安装系统依赖
run: |
sudo apt-get update && sudo apt-get install -y \
libcurl4-openssl-dev \
libsasl2-dev \
protobuf-compiler
- name: Build project
run: cargo build --all --all-features
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: "/language:rust"