| 1 |
name: Rust |
| 2 |
|
| 3 |
on: |
| 4 |
push: |
| 5 |
branches: [ master ] |
| 6 |
pull_request: |
| 7 |
branches: [ master ] |
| 8 |
|
| 9 |
env: |
| 10 |
CARGO_TERM_COLOR: always |
| 11 |
RUSTFLAGS: -D warnings |
| 12 |
RUST_BACKTRACE: 1 |
| 13 |
|
| 14 |
jobs: |
| 15 |
test: |
| 16 |
runs-on: ubuntu-latest |
| 17 |
strategy: |
| 18 |
matrix: |
| 19 |
rust: |
| 20 |
- stable |
| 21 |
- 1.56.0 |
| 22 |
- nightly |
| 23 |
|
| 24 |
steps: |
| 25 |
- uses: actions/checkout@v4 |
| 26 |
- uses: dtolnay/rust-toolchain@master |
| 27 |
with: |
| 28 |
toolchain: ${{ matrix.rust }} |
| 29 |
- name: Run tests |
| 30 |
run: cargo test --verbose --all-features |
| 31 |
- name: Run docs |
| 32 |
run: cargo doc --verbose |
| 33 |
format: |
| 34 |
runs-on: ubuntu-latest |
| 35 |
steps: |
| 36 |
- uses: actions/checkout@v4 |
| 37 |
- uses: dtolnay/rust-toolchain@stable |
| 38 |
- name: Run rustfmt |
| 39 |
run: cargo fmt --all -- --check |
| 40 |
|
| 41 |
|
| 42 |
crater: |
| 43 |
runs-on: ubuntu-latest |
| 44 |
steps: |
| 45 |
- uses: actions/checkout@v4 |
| 46 |
- uses: dtolnay/rust-toolchain@master |
| 47 |
with: |
| 48 |
toolchain: nightly |
| 49 |
- name: setup patch |
| 50 |
run: | |
| 51 |
echo "" >> ~/.cargo/config.toml |
| 52 |
echo [patch.crates-io] >> ~/.cargo/config.toml |
| 53 |
echo document-features = { path = \"$GITHUB_WORKSPACE\" } >> ~/.cargo/config.toml |
| 54 |
- name: create project and generate docs |
| 55 |
run: | |
| 56 |
cd ~ |
| 57 |
cargo new crater |
| 58 |
cd crater |
| 59 |
cargo add quick-xml -F document-features |
| 60 |
cargo add serde_with -F guide |
| 61 |
cargo add serial_test -F docsrs |
| 62 |
cargo add wgpu-core |
| 63 |
cargo add wgpu |
| 64 |
cargo add gix -F document-features |
| 65 |
cargo add kstring -F document-features |
| 66 |
cargo add ratatui -F document-features |
| 67 |
cargo add re_types |
| 68 |
cargo add slint -F document-features |
| 69 |
cargo add egui-winit -F document-features |
| 70 |
cargo add ehttp |
| 71 |
cargo add snapbox -F document-features |
| 72 |
cargo add fast-image-resize |
| 73 |
cargo add rhai -F document-features |
| 74 |
cargo add embassy-executor |
| 75 |
cargo add embassy-time |
| 76 |
|
| 77 |
cargo doc |
| 78 |
grep -r ">No documented features in Cargo.toml<" target/doc || exit 0 |
| 79 |
false |