-
Notifications
You must be signed in to change notification settings - Fork 19
85 lines (77 loc) · 2.33 KB
/
main.yml
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
# Trigger CI on PR updates and main branch pushes
# Uses caching and selective path triggers to optimize performance
name: Robrix Rust CI
# Only `main` branch
on:
push:
branches:
- main
paths:
- packaging/**
- resources/**
- src/**
- .github/**
- Cargo.toml
- rust-toolchain.toml
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
branches:
- main
paths:
- packaging/**
- resources/**
- src/**
- .github/**
- Cargo.toml
- rust-toolchain.toml
# Prevent concurrent CI runs and cancel in-progress runs on new pushes
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
# Global environment configuration
env:
CARGO_TERM_COLOR: always
CARGO_INCREMENTAL: "0" # Disable incremental compilation in CI
RUST_BACKTRACE: 1
# Enable warnings as errors for strict checks
RUSTFLAGS: "-D warnings"
jobs:
# Basic compilation check to ensure code builds
check:
if: github.event.pull_request.draft == false
name: Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
# Cache dependencies to speed up builds
- uses: Swatinem/rust-cache@v2
with:
cache-all-crates: "true"
cache-on-failure: "true"
# Check if the code compiles with all features
- run: cargo check --workspace --all-features --all-targets
clippy:
if: github.event.pull_request.draft == false
name: Clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- uses: Swatinem/rust-cache@v2
with:
cache-all-crates: "true"
cache-on-failure: "true"
# Run clippy with custom configuration for makepad DSL
# Allow pedantic / needless_lifetimes / too_many_arguments
- run: cargo clippy --workspace --examples --tests --all-features --all-targets
typos:
if: github.event.pull_request.draft == false
name: Check for typos
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Check for typos
uses: crate-ci/typos@master