-
Notifications
You must be signed in to change notification settings - Fork 31
85 lines (70 loc) · 2.17 KB
/
Copy pathci.yml
File metadata and controls
85 lines (70 loc) · 2.17 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
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
rust-sdk:
name: Rust SDK
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
with:
# This job executes repo code (cargo build/test); don't persist the
# token in git config.
persist-credentials: false
submodules: true
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- uses: Swatinem/rust-cache@v2
with:
workspaces: .
- name: Check formatting
run: cargo fmt --all -- --check
- name: Clippy
run: cargo clippy --all-targets -- -D warnings
- name: Build
run: cargo build --all-targets --all-features
- name: Test
run: cargo test --all-features
- name: Documentation
run: RUSTDOCFLAGS="-D warnings" cargo doc --all-features --no-deps
features:
name: Features (${{ matrix.features.name }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
# Curated subset of the feature power set: the dependency-light core,
# each feature in isolation, and the fully-enabled build. Each combo
# must type-check so heavyweight deps stay genuinely opt-in.
features:
- name: core (no features)
flags: --no-default-features
- name: tokio
flags: --no-default-features --features tokio
- name: git-diff
flags: --no-default-features --features git-diff
- name: sync
flags: --no-default-features --features sync
- name: all features
flags: --all-features
steps:
- uses: actions/checkout@v7
with:
persist-credentials: false
submodules: true
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
with:
workspaces: .
key: features-${{ matrix.features.name }}
- name: Test
run: cargo test --all-targets ${{ matrix.features.flags }}