From 4f4a8d745551eb732165426a677c895831f5a817 Mon Sep 17 00:00:00 2001 From: Dario Anongba Varela Date: Mon, 9 Dec 2024 15:37:03 +0100 Subject: [PATCH] ci --- .../{cont_integration.yml => ci.yml} | 30 ++++++------- .github/workflows/code_coverage.yml | 44 ------------------- 2 files changed, 13 insertions(+), 61 deletions(-) rename .github/workflows/{cont_integration.yml => ci.yml} (71%) delete mode 100644 .github/workflows/code_coverage.yml diff --git a/.github/workflows/cont_integration.yml b/.github/workflows/ci.yml similarity index 71% rename from .github/workflows/cont_integration.yml rename to .github/workflows/ci.yml index 9b18297..39bf30e 100644 --- a/.github/workflows/cont_integration.yml +++ b/.github/workflows/ci.yml @@ -21,11 +21,14 @@ jobs: matrix: rust: - version: stable - clippy: true + components: clippy - version: 1.63.0 # MSRV features: - - --no-default-features - - --all-features + - all + - debug,default + - debug,esplora + - debug,snap + - debug,bitcoind steps: - name: checkout uses: actions/checkout@v4 @@ -37,22 +40,15 @@ jobs: run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh -s -- -f - name: Rust Cache uses: Swatinem/rust-cache@v2.7.5 - - name: Pin dependencies for MSRV - if: matrix.rust.version == '1.63.0' - run: | - cargo update -p zstd-sys --precise "2.0.8+zstd.1.5.5" - cargo update -p time --precise "0.3.20" - cargo update -p home --precise "0.5.5" - cargo update -p proptest --precise "1.2.0" - cargo update -p url --precise "2.5.0" - cargo update -p cc --precise "1.0.105" - cargo update -p tokio --precise "1.38.1" - cargo update -p tokio-util --precise "0.7.11" - cargo update -p indexmap --precise "2.5.0" - cargo update -p security-framework-sys --precise "2.11.1" - name: Build - run: wasm-pack build --features ${{ matrix.features }} + run: | + if [ "${{ matrix.features }}" = "all" ]; then + wasm-pack build --all-features + else + wasm-pack build --features ${{ matrix.features }} + fi - name: Test + if: ${{ matrix.features != 'all' }} run: wasm-pack test --chrome --firefox --safari --headless --features ${{ matrix.features }} fmt: diff --git a/.github/workflows/code_coverage.yml b/.github/workflows/code_coverage.yml deleted file mode 100644 index 6da6dc3..0000000 --- a/.github/workflows/code_coverage.yml +++ /dev/null @@ -1,44 +0,0 @@ -on: [push, pull_request] - -name: Code Coverage - -jobs: - Codecov: - name: Code Coverage - runs-on: ubuntu-latest - env: - RUSTFLAGS: "-Cinstrument-coverage" - RUSTDOCFLAGS: "-Cinstrument-coverage" - LLVM_PROFILE_FILE: "./target/coverage/%p-%m.profraw" - - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Install lcov tools - run: sudo apt-get install lcov -y - - name: Install Rust toolchain - uses: dtolnay/rust-toolchain@stable - with: - toolchain: stable - components: llvm-tools-preview - - name: Rust Cache - uses: Swatinem/rust-cache@v2.7.5 - - name: Install grcov - run: if [[ ! -e ~/.cargo/bin/grcov ]]; then cargo install grcov; fi - - name: Test - run: cargo test --all-features - - name: Make coverage directory - run: mkdir coverage - - name: Run grcov - run: grcov . --binary-path ./target/debug/ -s . -t lcov --branch --ignore-not-existing --keep-only '**/crates/**' --ignore '**/tests/**' --ignore '**/examples/**' -o ./coverage/lcov.info - - name: Generate HTML coverage report - run: genhtml -o coverage-report.html --ignore-errors source ./coverage/lcov.info - - name: Coveralls upload - uses: coverallsapp/github-action@master - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - - name: Upload artifact - uses: actions/upload-artifact@v4 - with: - name: coverage-report - path: coverage-report.html