-
Notifications
You must be signed in to change notification settings - Fork 0
109 lines (93 loc) · 3.42 KB
/
ci.yaml
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
name: CI
on:
# Trigger the workflow on push and pull requests to the main branch
push:
branches:
- main
pull_request:
branches:
- main
env:
CARGO_TERM_COLOR: always
RUSTFLAGS: --deny warnings
RUSTDOCFLAGS: --deny warnings
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
toolchain: [stable, nightly]
feature-set: [default, missing_auto_plugin_is_compile_error]
steps:
# Checkout the repository
- name: Checkout code
uses: actions/checkout@v3
# Install Rust for the selected toolchain
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.toolchain }}
override: true
# Run tests with the specified feature set
- name: Run tests
if: ${{ matrix.toolchain == 'nightly' || matrix.feature-set == 'default' }}
run: |
echo "Testing with ${{ matrix.toolchain }} and features: ${{ matrix.toolchain }},${{ matrix.feature-set }}"
cargo test --features "${{ matrix.toolchain }},${{ matrix.feature-set }}"
doc-test:
runs-on: ubuntu-latest
steps:
# Checkout the repository
- name: Checkout code
uses: actions/checkout@v3
# Install Rust with nightly toolchain
- name: Install Rust (nightly)
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
override: true
# Compile documentation with nightly
- name: Compile Rust documentation
run: |
echo "Compiling Rust documentation"
cargo +nightly doc --features=nightly --no-deps
rustfmt:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Install Rust (nightly)
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
override: true
- name: Install rustfmt
run: |
echo "Installing rustfmt for nightly"
rustup component add rustfmt --toolchain nightly
- name: Run rustfmt
run: |
echo "Checking code formatting with rustfmt (nightly)"
cargo +nightly fmt --all -- --check
clippy:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Install Rust (nightly)
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
override: true
- name: Install clippy
run: |
echo "Installing clippy for nightly"
rustup component add clippy --toolchain nightly
- name: Run clippy
run: |
echo "Running clippy for lint checks (nightly)"
cargo +nightly clippy --all-targets --all-features -- -D warnings