-
Notifications
You must be signed in to change notification settings - Fork 0
106 lines (91 loc) · 2.83 KB
/
rust.yml
File metadata and controls
106 lines (91 loc) · 2.83 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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
name: Rust CI
on:
pull_request:
branches: [ "main" ]
push:
branches: [ "main" ]
env:
CARGO_TERM_COLOR: always
jobs:
check:
name: Rust Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Rust (latest stable)
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- name: Run checks
run: RUSTFLAGS="-D warnings" cargo check --verbose
lint:
name: Rust Formatter Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Rust (latest stable)
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- name: Install Formatter
run: rustup component add rustfmt
- name: Run Formatter
run: cargo fmt --all -- --check
test:
name: Rust Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Rust (latest stable)
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- name: Build
run: cargo build --verbose
- name: Run tests
run: cargo test --verbose
review:
name: AI Code Review
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
steps:
- uses: actions/checkout@v4
- name: AI Code Review (gemini-2.5-flash)
id: review_primary
continue-on-error: true
uses: Wandalen/wretry.action@v3.5.0
with:
action: AleksandrFurmenkovOfficial/ai-code-review@v0.9
with: |
token: ${{ secrets.GITHUB_TOKEN }}
owner: ${{ github.repository_owner }}
repo: ${{ github.event.repository.name }}
pr_number: ${{ github.event.number }}
ai_provider: google
google_api_key: ${{ secrets.GEMINI_API_KEY }}
google_model: gemini-2.5-flash
include_extensions: .rs,.toml
exclude_paths: target/
fail_action_if_review_failed: true
- name: AI Code Review Fallback (gemini-2.5-flash-lite)
if: steps.review_primary.outcome == 'failure'
uses: Wandalen/wretry.action@v3.5.0
with:
action: AleksandrFurmenkovOfficial/ai-code-review@v0.9
with: |
token: ${{ secrets.GITHUB_TOKEN }}
owner: ${{ github.repository_owner }}
repo: ${{ github.event.repository.name }}
pr_number: ${{ github.event.number }}
ai_provider: google
google_api_key: ${{ secrets.GEMINI_API_KEY }}
google_model: gemini-2.5-flash-lite
include_extensions: .rs,.toml
exclude_paths: target/
fail_action_if_review_failed: true