Repository navigation
137 lines (118 loc) · 3.64 KB
/
Copy pathrust-ci.yml
File metadata and controls
137 lines (118 loc) · 3.64 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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
name: Rust CI
on:
push:
branches:
- master
pull_request:
branches:
- master
workflow_dispatch:
env:
CARGO_TERM_COLOR: always
RUST_TOOLCHAIN: nightly-2025-05-09
jobs:
rust:
name: Rust ${{ matrix.name }}
runs-on: macos-14
strategy:
fail-fast: false
matrix:
include:
- name: fmt
command: cargo fmt --all -- --check
- name: clippy
command: cargo clippy --workspace --all-targets -- -D warnings
- name: check
command: cargo check --workspace --all-targets
- name: test
command: cargo test --workspace
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ env.RUST_TOOLCHAIN }}
components: clippy, rustfmt
- name: Cache cargo build artifacts
uses: Swatinem/rust-cache@v2
- name: Run ${{ matrix.name }}
run: ${{ matrix.command }}
bench:
name: search-cache bench (large corpus)
runs-on: macos-14
# Run only on master push, manual trigger, or PRs with "perf:" title
if: |
github.event_name == 'push' ||
github.event_name == 'workflow_dispatch' ||
(github.event_name == 'pull_request' && startsWith(github.event.pull_request.title, 'perf:'))
defaults:
run:
working-directory: search-cache
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ env.RUST_TOOLCHAIN }}
- name: Cache cargo build artifacts
uses: Swatinem/rust-cache@v2
with:
workspaces: search-cache
# Blobless shallow clone: downloads tree objects + commits only,
# so every file path exists on disk but no file content is fetched.
# Result: ~60 MB instead of ~4 GB for a full linux clone.
- name: Clone Linux kernel (blobless)
run: |
git clone \
--depth=1 \
--filter=blob:none \
--no-tags \
https://github.com/torvalds/linux \
linux-corpus
- name: Run benchmarks
env:
BENCH_CORPUS_DIR: ${{ github.workspace }}/search-cache/linux-corpus
run: cargo bench --quiet --bench walk_and_search -- --output-format bencher | tee bench-output.txt
- name: Upload benchmark results
uses: actions/upload-artifact@v4
with:
name: bench-results
path: |
search-cache/bench-output.txt
search-cache/target/criterion/
tauri:
name: Tauri ${{ matrix.name }}
runs-on: macos-14
strategy:
fail-fast: false
matrix:
include:
- name: fmt
command: cargo fmt -- --check
- name: clippy
command: cargo clippy --all-targets -- -D warnings
- name: check
command: cargo check --all-targets
- name: test
command: cargo test
defaults:
run:
working-directory: cardinal/src-tauri
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ env.RUST_TOOLCHAIN }}
components: clippy, rustfmt
- name: Cache cargo build artifacts
uses: Swatinem/rust-cache@v2
with:
workspaces: cardinal/src-tauri
- name: Run ${{ matrix.name }}
run: ${{ matrix.command }}