Debian Codegraph @

.github/workflows/ci.yml

raw symbols SCIP
1 name: ci
2 on:
3 pull_request:
4 push:
5 branches:
6 - main
7 env:
8 CARGO_TERM_COLOR: always
9 jobs:
10 rustfmt:
11 name: rustfmt
12 runs-on: ubuntu-latest
13 steps:
14 - name: Checkout repository
15 uses: actions/checkout@v3
16 - name: Check formatting
17 run: cargo fmt --all -- --check
18
19 build:
20 name: build
21 env:
22 RUST_BACKTRACE: 1
23 runs-on: ubuntu-latest
24 steps:
25 - name: Checkout repository
26 uses: actions/checkout@v3
27 - name: Build crate (Static Output)
28 run: cargo build --verbose --features=static_output,search
29 - name: Build crate (Tokio)
30 run: cargo build --verbose --features=dynamic_output,search
31
32 test:
33 name: test
34 env:
35 # Emit backtraces on panics.
36 RUST_BACKTRACE: 1
37 runs-on: ubuntu-latest
38 steps:
39 - name: Checkout repository
40 uses: actions/checkout@v3
41 # This step helps separate buildtime and runtime errors in tests.
42 # Do not build or run doc tests
43 - name: Build tests (Static Output)
44 run: cargo test --verbose --features=static_output,search --no-run --lib
45 - name: Run Tests (Static Output)
46 run: cargo test --verbose --features=static_output,search --lib
47 - name: Build tests (Tokio)
48 run: cargo test --verbose --features=dynamic_output,search --no-run --lib
49 - name: Run Tests (Tokio)
50 run: cargo test --verbose --features=dynamic_output,search --lib
51 - name: Build tests (Search-only)
52 run: cargo test --verbose --features=search --no-run --lib
53 - name: Run Tests (Search-only)
54 run: cargo test --verbose --features=search --lib
55
56 examples:
57 name: examples
58 env:
59 # Emit backtraces on panics.
60 RUST_BACKTRACE: 1
61 runs-on: ubuntu-latest
62 steps:
63 - name: Checkout repository
64 uses: actions/checkout@v3
65 # No terminal available in CI, only check the examples.
66 - name: Tokio
67 run: cargo check --example=dyn_tokio --features=dynamic_output
68 - name: Tokio Messages
69 run: cargo check --example=msg-tokio --features=dynamic_output
70 - name: Static
71 run: cargo check --example=static --features=static_output
72 - name: Less-rs
73 run: cargo check --example=less-rs --features=dynamic_output
74 - name: Color output
75 run: cargo check --example=color-output --features=static_output
76 - name: Large Lines
77 run: cargo check --example=large_lines --features=static_output
78
79 doctests:
80 name: doctests
81 env:
82 RUST_BACKTRACE: 1
83 runs-on: ubuntu-latest
84 steps:
85 - name: Checkout repository
86 uses: actions/checkout@v3
87 - name: Run documentation tests
88 run: cargo test --doc --all-features
89
90 lint:
91 name: lint
92 runs-on: ubuntu-latest
93 steps:
94 - uses: actions/checkout@v3
95 - uses: actions-rs/toolchain@v1
96 with:
97 toolchain: stable
98 override: true
99 profile: minimal
100 components: clippy
101 - uses: actions-rs/cargo@v1
102 with:
103 command: clippy
104 args: --features=dynamic_output,search --tests --examples
105 - uses: actions-rs/cargo@v1
106 with:
107 command: clippy
108 args: --features=dynamic_output,search --tests --examples
109 - uses: actions-rs/cargo@v1
110 with:
111 command: clippy
112 args: --features=static_output,search --tests --examples