|
17 | 17 | required: false
|
18 | 18 | default: x86_64-unknown-linux-gnu
|
19 | 19 | description: Rust target for the build step. Clippy and tests are still executed with the default target.
|
| 20 | + features: |
| 21 | + type: string |
| 22 | + required: false |
| 23 | + # Make sure we always an empty string to "--features <FEATURES>" |
| 24 | + default: '""' |
| 25 | + description: Comma-separated String with additional Rust features relevant for a certain job. |
20 | 26 | do-style-check:
|
21 | 27 | type: boolean
|
22 | 28 | required: false
|
23 | 29 | default: true
|
24 |
| - description: Whether style checks should be done. |
| 30 | + description: Perform code and doc style checks. |
25 | 31 | do-test:
|
26 | 32 | type: boolean
|
27 | 33 | required: false
|
28 | 34 | default: true
|
29 |
| - description: Whether tests should be executed. |
| 35 | + description: Execute tests. |
30 | 36 |
|
31 | 37 | jobs:
|
32 | 38 | check_rust:
|
@@ -57,20 +63,20 @@ jobs:
|
57 | 63 | restore-keys: ${{ runner.os }}-cargo-${{ inputs.rust-version }}
|
58 | 64 | - run: cargo version
|
59 | 65 | - name: Build (library)
|
60 |
| - run: cargo build --target ${{ inputs.rust-target }} |
| 66 | + run: cargo build --target ${{ inputs.rust-target }} --features ${{ inputs.features }} |
61 | 67 | - name: Build (all targets)
|
62 |
| - run: cargo build --all-targets |
| 68 | + run: cargo build --all-targets --features ${{ inputs.features }} |
63 | 69 | - name: Code Formatting
|
64 | 70 | if: ${{ inputs.do-style-check }}
|
65 | 71 | run: cargo fmt --all -- --check
|
66 | 72 | - name: Code Style and Doc Style
|
67 | 73 | if: ${{ inputs.do-style-check }}
|
68 | 74 | run: |
|
69 |
| - cargo doc --document-private-items |
70 |
| - cargo clippy --all-targets |
| 75 | + cargo doc --document-private-items --features ${{ inputs.features }} |
| 76 | + cargo clippy --all-targets --features ${{ inputs.features }} |
71 | 77 | - name: Unit Test
|
72 | 78 | if: ${{ inputs.do-test }}
|
73 | 79 | run: |
|
74 | 80 | curl -LsSf https://get.nexte.st/latest/linux | tar zxf -
|
75 | 81 | chmod u+x cargo-nextest
|
76 |
| - ./cargo-nextest nextest run |
| 82 | + ./cargo-nextest nextest run --features ${{ inputs.features }} |
0 commit comments