Skip to content

Commit b8a06d2

Browse files
Only link dead code when necessary in CI.
1 parent d735085 commit b8a06d2

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

.github/workflows/build.yml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,17 +34,23 @@ jobs:
3434
override: true
3535
profile: minimal
3636
- name: Build on Rust ${{ matrix.toolchain }} with net-tokio
37-
if: matrix.build-net-tokio
37+
if: "matrix.build-net-tokio && !matrix.coverage"
38+
run: cargo build --verbose --color always
39+
- name: Build on Rust ${{ matrix.toolchain }} with net-tokio and full code-linking for coverage generation
40+
if: matrix.coverage
3841
run: RUSTFLAGS="-C link-dead-code" cargo build --verbose --color always
3942
- name: Build on Rust ${{ matrix.toolchain }}
4043
if: "! matrix.build-net-tokio"
41-
run: RUSTFLAGS="-C link-dead-code" cargo build --verbose --color always -p lightning
44+
run: cargo build --verbose --color always -p lightning
4245
- name: Test on Rust ${{ matrix.toolchain }} with net-tokio
43-
if: matrix.build-net-tokio
46+
if: "matrix.build-net-tokio && !matrix.coverage"
47+
run: cargo test --verbose --color always
48+
- name: Test on Rust ${{ matrix.toolchain }} with net-tokio and full code-linking for coverage generation
49+
if: matrix.coverage
4450
run: RUSTFLAGS="-C link-dead-code" cargo test --verbose --color always
4551
- name: Test on Rust ${{ matrix.toolchain }}
4652
if: "! matrix.build-net-tokio"
47-
run: RUSTFLAGS="-C link-dead-code" cargo test --verbose --color always -p lightning
53+
run: cargo test --verbose --color always -p lightning
4854
- name: Install deps for kcov
4955
if: matrix.coverage
5056
run: |

0 commit comments

Comments
 (0)