|
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,31 @@ 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 |
63 | | - 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 |
| 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 |
87 | 63 | with: |
| 64 | + fetch-depth: 0 |
| 65 | + - name: Install Rust stable toolchain |
| 66 | + run: | |
| 67 | + curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile=minimal |
| 68 | + - name: Run tests with coverage generation |
| 69 | + run: | |
| 70 | + cargo install cargo-llvm-cov |
| 71 | + export RUSTFLAGS="-Clink-dead-code -Coverflow-checks=off" |
| 72 | + cargo llvm-cov --features rest-client,rpc-client,tokio,futures,serde --codecov --hide-instantiations --output-path=target/codecov.json |
88 | 73 | # Could you use this to fake the coverage report for your PR? Sure. |
89 | 74 | # Will anyone be impressed by your amazing coverage? No |
90 | 75 | # 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 |
| 76 | + bash <(curl -s https://codecov.io/bash) -f target/codecov.json -t "f421b687-4dc2-4387-ac3d-dc3b2528af57" |
93 | 77 |
|
94 | 78 | benchmark: |
95 | 79 | runs-on: ubuntu-latest |
|
0 commit comments