|
22 | 22 | include:
|
23 | 23 | - toolchain: stable
|
24 | 24 | platform: ubuntu-latest
|
25 |
| - coverage: true |
26 | 25 | # 1.48.0 is the MSRV for all crates except lightning-transaction-sync and Win/Mac
|
27 | 26 | - toolchain: 1.48.0
|
28 | 27 | platform: ubuntu-latest
|
@@ -50,46 +49,30 @@ jobs:
|
50 | 49 | run: |
|
51 | 50 | sudo apt-get -y install shellcheck
|
52 | 51 | shellcheck ci/ci-tests.sh
|
53 |
| - - name: Run CI script with coverage generation |
54 |
| - if: matrix.coverage |
55 |
| - shell: bash # Default on Winblows is powershell |
56 |
| - run: LDK_COVERAGE_BUILD=true ./ci/ci-tests.sh |
57 | 52 | - name: Run CI script
|
58 |
| - if: "!matrix.coverage" |
59 | 53 | shell: bash # Default on Winblows is powershell
|
60 | 54 | run: ./ci/ci-tests.sh
|
61 |
| - - name: Install deps for kcov |
62 |
| - if: matrix.coverage |
| 55 | + |
| 56 | + coverage: |
| 57 | + strategy: |
| 58 | + fail-fast: false |
| 59 | + runs-on: ubuntu-latest |
| 60 | + steps: |
| 61 | + - name: Checkout source code |
| 62 | + uses: actions/checkout@v3 |
| 63 | + - name: Install Rust stable toolchain |
63 | 64 | run: |
|
64 |
| - sudo apt-get update |
65 |
| - sudo apt-get -y install binutils-dev libcurl4-openssl-dev zlib1g-dev libdw-dev libiberty-dev |
66 |
| - - name: Install kcov |
67 |
| - if: matrix.coverage |
68 |
| - run: | |
69 |
| - wget https://github.com/SimonKagstrom/kcov/archive/master.tar.gz |
70 |
| - tar xzf master.tar.gz |
71 |
| - cd kcov-master && mkdir build && cd build |
72 |
| - cmake .. |
73 |
| - make |
74 |
| - make install DESTDIR=../../kcov-build |
75 |
| - cd ../.. && rm -rf kcov-master master.tar.gz |
76 |
| - - name: Generate coverage report |
77 |
| - if: matrix.coverage |
78 |
| - run: | |
79 |
| - for file in target/debug/deps/lightning*; do |
80 |
| - [ -x "${file}" ] || continue; |
81 |
| - mkdir -p "target/cov/$(basename $file)"; |
82 |
| - ./kcov-build/usr/local/bin/kcov --exclude-pattern=/.cargo,/usr/lib --verify "target/cov/$(basename $file)" "$file"; |
83 |
| - done |
84 |
| - - name: Upload coverage |
85 |
| - if: matrix.coverage |
86 |
| - uses: codecov/codecov-action@v3 |
87 |
| - with: |
| 65 | + curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile=minimal |
| 66 | + - name: Run tests with coverage generation |
| 67 | + run: | |
| 68 | + cargo install cargo-llvm-cov |
| 69 | + export RUSTFLAGS="-Clink-dead-code -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests" |
| 70 | + export RUSTC_BOOTSTRAP=1 |
| 71 | + cargo llvm-cov --features rest-client,rpc-client,tokio,futures,serde --codecov --hide-instantiations --output-path=target/codecov.json |
88 | 72 | # Could you use this to fake the coverage report for your PR? Sure.
|
89 | 73 | # Will anyone be impressed by your amazing coverage? No
|
90 | 74 | # Maybe if codecov wasn't broken we wouldn't need to do this...
|
91 |
| - token: f421b687-4dc2-4387-ac3d-dc3b2528af57 |
92 |
| - fail_ci_if_error: true |
| 75 | + bash <(curl -s https://codecov.io/bash) -f target/codecov.json -t "f421b687-4dc2-4387-ac3d-dc3b2528af57" |
93 | 76 |
|
94 | 77 | benchmark:
|
95 | 78 | runs-on: ubuntu-latest
|
|
0 commit comments