diff --git a/.github/workflows/code_coverage.yml b/.github/workflows/code_coverage.yml index 5e650459d..4cb979ee6 100644 --- a/.github/workflows/code_coverage.yml +++ b/.github/workflows/code_coverage.yml @@ -1,4 +1,4 @@ -on: [push] +on: [push, pull_request] name: Code Coverage @@ -10,7 +10,19 @@ jobs: RUSTFLAGS: "-Cinstrument-coverage" RUSTDOCFLAGS: "-Cinstrument-coverage" LLVM_PROFILE_FILE: "report-%p-%m.profraw" - + strategy: + matrix: + blockchain: + - name: electrum + features: test-electrum,verify + - name: rpc + features: test-rpc + - name: rpc-legacy + features: test-rpc-legacy + - name: esplora + features: test-esplora,use-esplora-reqwest,verify + - name: esplora + features: test-esplora,use-esplora-ureq,verify steps: - name: Checkout uses: actions/checkout@v2 @@ -37,19 +49,30 @@ jobs: key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} - name: Install grcov run: if [[ ! -e ~/.cargo/bin/grcov ]]; then cargo install grcov; fi - - name: Test - run: cargo test --features default,minimal,all-keys,compact_filters,key-value-db,compiler,sqlite,sqlite-bundled,test-electrum,verify,test-rpc + - name: Test ${{ matrix.blockchain.name }} + run: cargo test --features compiler,verify,sqlite,sqlite-bundled,compact_filters,key-value-db,all-keys,keys-bip39,rpc,${{ matrix.blockchain.features }} - name: Run grcov run: mkdir coverage; grcov . --binary-path ./target/debug/ -s . -t lcov --branch --ignore-not-existing --ignore '/*' -o ./coverage/lcov.info - name: Generate HTML coverage report run: genhtml -o coverage-report.html ./coverage/lcov.info - - name: Coveralls upload + - name: Coveralls Parallel upload uses: coverallsapp/github-action@master with: github-token: ${{ secrets.GITHUB_TOKEN }} + flag-name: run-${{ matrix.features }} + parallel: true - name: Upload artifact uses: actions/upload-artifact@v2 with: name: coverage-report path: coverage-report.html + finish: + needs: Codecov + runs-on: ubuntu-latest + steps: + - name: Coveralls Finished + uses: coverallsapp/github-action@master + with: + github-token: ${{ secrets.github_token }} + parallel-finished: true