Debian Codegraph @

.github/workflows/rust.yml

raw
1 name: Rust
2
3 on: [push, pull_request]
4
5 env:
6 MSRV: "1.85"
7
8 jobs:
9 build_lib_test:
10 runs-on: ubuntu-latest
11 strategy:
12 matrix:
13 rust:
14 - nightly
15 - beta
16 - stable
17 - $MSRV
18 steps:
19 - uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
20 with:
21 submodules: true
22 - name: Obtain Rust
23 run: rustup override set ${{ matrix.rust }}
24 - name: Build library
25 run: cargo build --locked --verbose --lib
26 - name: Build examples
27 run: cargo build --locked --verbose --examples
28 - name: Run unit tests
29 run: cargo test --locked --verbose
30 - name: "Run README sample"
31 run: cargo run --locked --example sample
32 build_bin_spec:
33 runs-on: ubuntu-latest
34 strategy:
35 matrix:
36 rust:
37 - nightly
38 - beta
39 - stable
40 - $MSRV
41 steps:
42 - uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
43 with:
44 submodules: true
45 - name: Obtain Rust
46 run: rustup override set ${{ matrix.rust }}
47 - name: Build binary
48 run: cargo build --locked --verbose --bin comrak --release
49 - name: Run spec tests
50 run: script/cibuild
51 build_wasm:
52 runs-on: ubuntu-latest
53 strategy:
54 matrix:
55 rust:
56 - nightly
57 - beta
58 - stable
59 - $MSRV
60 steps:
61 - uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
62 with:
63 submodules: true
64 - name: Obtain Rust
65 run: rustup override set ${{ matrix.rust }}
66 - name: Setup for wasm
67 run: rustup target add wasm32-unknown-unknown
68 - name: Build
69 run: cargo build --locked --verbose --target wasm32-unknown-unknown --lib --no-default-features --features cli,syntect-fancy,bon
70 no_features_build_test:
71 runs-on: ubuntu-latest
72 strategy:
73 matrix:
74 rust:
75 - nightly
76 - beta
77 - stable
78 - $MSRV
79 steps:
80 - uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
81 with:
82 submodules: true
83 - name: Obtain Rust
84 run: rustup override set ${{ matrix.rust }}
85 - name: Build and test with no features
86 run: cargo test --locked --no-default-features
87 all_features_build_test:
88 runs-on: ubuntu-latest
89 strategy:
90 matrix:
91 rust:
92 - nightly
93 - beta
94 - stable
95 - $MSRV
96 steps:
97 - uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
98 with:
99 submodules: true
100 - name: Obtain Rust
101 run: rustup override set ${{ matrix.rust }}
102 - name: Build and test with all features
103 run: cargo test --locked --all-features
104 clippy_format:
105 runs-on: ubuntu-latest
106 steps:
107 - uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
108 with:
109 submodules: true
110 - name: Obtain Rust
111 run: rustup override set $MSRV
112 - name: Check clippy
113 run: rustup component add clippy && cargo clippy -- -Dwarnings
114 - name: Check formatting
115 run: rustup component add rustfmt && cargo fmt -- --check