Debian Codegraph @

.github/workflows/test.yml

raw symbols SCIP
1 name: Tests
2
3 on:
4 push:
5 branches: [main]
6 paths:
7 - ".github/workflows/test.yml"
8 - "**.rs"
9 - "Cargo.toml"
10 - "Cargo.lock"
11 pull_request:
12 branches: [main]
13 paths:
14 - ".github/workflows/test.yml"
15 - "**.rs"
16 - "Cargo.toml"
17 - "Cargo.lock"
18
19 jobs:
20 test:
21 name: Test target ${{ matrix.target }} on ${{ matrix.os }} for ${{ matrix.toolchain }}
22 runs-on: ${{ matrix.os }}
23 strategy:
24 fail-fast: false
25 matrix:
26 target:
27 - x86_64-unknown-linux-gnu
28 - x86_64-pc-windows-msvc
29 - x86_64-apple-darwin
30 toolchain: [stable]
31 include:
32 - target: x86_64-unknown-linux-gnu
33 os: ubuntu-latest
34 minimal_setup: false
35 - target: wasm32-wasip1
36 os: ubuntu-latest
37 minimal_setup: true
38 toolchain: "stable"
39 - target: x86_64-pc-windows-msvc
40 os: windows-latest
41 minimal_setup: false
42 - target: x86_64-apple-darwin
43 os: macos-latest
44 minimal_setup: false
45
46 # minimal_setup: This is needed for targets that don't support our dev dependencies.
47 # It also excludes the default features, i.e. [tty].
48 # For instance, "wasm32-wasi" is such a target.
49 steps:
50 - name: Checkout code
51 uses: actions/checkout@v4
52
53 - name: Setup Rust toolchain
54 uses: dtolnay/rust-toolchain@master
55 with:
56 targets: ${{ matrix.target }}
57 toolchain: ${{ matrix.toolchain }}
58 components: rustfmt, clippy
59
60 - name: cargo build
61 run: cargo build --target=${{ matrix.target }}
62 if: ${{ !matrix.minimal_setup }}
63
64 - name: cargo test
65 run: cargo test --target=${{ matrix.target }} --features=_integration_test
66 if: ${{ !matrix.minimal_setup }}
67
68 - name: cargo test without default features
69 run: cargo test --target=${{ matrix.target }} --tests --no-default-features
70 if: ${{ !matrix.minimal_setup }}
71
72 - name: cargo test with crossterm re-export
73 run: cargo test --target=${{ matrix.target }} --features=_integration_test,reexport_crossterm
74 if: ${{ !matrix.minimal_setup }}
75
76 - name: cargo test with custom_styling
77 run: cargo test --target=${{ matrix.target }} --features=_integration_test,custom_styling
78 if: ${{ !matrix.minimal_setup }}
79
80 - name: cargo build without default features and without dev dependencies
81 run: cargo build --release --target=${{ matrix.target }} --no-default-features
82 if: ${{ matrix.minimal_setup }}