diff --git a/.github/workflows/audit.yml b/.github/workflows/audit.yml deleted file mode 100644 index 17f20ac..0000000 --- a/.github/workflows/audit.yml +++ /dev/null @@ -1,28 +0,0 @@ -name: Audit - -on: - push: - paths: - # Run if workflow changes - - ".github/workflows/audit.yml" - # Run on changed dependencies - - "**/Cargo.toml" - - "**/Cargo.lock" - # Run if the configuration file changes - - "**/audit.toml" - # Rerun periodically to pick up new advisories - schedule: - - cron: "0 0 * * *" # Nightly - # Run manually - workflow_dispatch: - -jobs: - audit: - runs-on: ubuntu-latest - permissions: - contents: read - issues: write - steps: - - uses: actions/checkout@v4 - - uses: actions-rust-lang/audit@v1 - name: Audit Rust Dependencies diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..1b7aa06 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,61 @@ +on: + pull_request: + branches: + - main + +name: CI + +jobs: + build-test: + name: Build and test + runs-on: ubuntu-latest + strategy: + matrix: + rust: + - stable + - 1.73.0 # MSRV + features: + - all + - debug,default + - debug,esplora + - debug,snap + - debug,bitcoind + steps: + - name: checkout + uses: actions/checkout@v4 + - name: Install Rust toolchain + uses: dtolnay/rust-toolchain@4f647fc679bcd3b11499ccb42104547c83dabe96 + with: + toolchain: ${{ matrix.rust }} + - name: Install wasm-pack + run: curl https://raw.githubusercontent.com/rustwasm/wasm-pack/a3a48401795cd4b3afe1d74568c93675a04f3970/installer/init.sh -sSf | sh -s -- -f + - name: Rust Cache + uses: Swatinem/rust-cache@82a92a6e8fbeee089604da2575dc567ae9ddeaab + - name: Build + 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 }} + + lint: + name: Lint (fmt + clippy) + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Install Rust toolchain + uses: dtolnay/rust-toolchain@4f647fc679bcd3b11499ccb42104547c83dabe96 + with: + toolchain: stable + components: rustfmt, clippy + - name: Rust Cache + uses: Swatinem/rust-cache@82a92a6e8fbeee089604da2575dc567ae9ddeaab + - name: Check formatting + run: cargo fmt --all -- --config format_code_in_doc_comments=true --check + - name: Run Clippy + run: cargo clippy --all-features --all-targets -- -D warnings diff --git a/.github/workflows/code_coverage.yml b/.github/workflows/code_coverage.yml deleted file mode 100644 index c5dbec0..0000000 --- a/.github/workflows/code_coverage.yml +++ /dev/null @@ -1,46 +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: actions-rs/toolchain@v1 - with: - toolchain: stable - override: true - profile: minimal - 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 diff --git a/.github/workflows/cont_integration.yml b/.github/workflows/cont_integration.yml deleted file mode 100644 index 1837871..0000000 --- a/.github/workflows/cont_integration.yml +++ /dev/null @@ -1,94 +0,0 @@ -on: [push, pull_request] - -name: CI - -jobs: - prepare: - runs-on: ubuntu-latest - outputs: - rust_version: ${{ steps.read_toolchain.outputs.rust_version }} - steps: - - name: "Checkout repo" - uses: actions/checkout@v4 - - name: "Read rust version" - id: read_toolchain - run: echo "rust_version=$(cat rust-version)" >> $GITHUB_OUTPUT - - build-test: - name: Build and test - runs-on: ubuntu-latest - strategy: - matrix: - rust: - - version: stable - clippy: true - - version: 1.63.0 # MSRV - features: - - --no-default-features - - --all-features - steps: - - name: checkout - uses: actions/checkout@v4 - - name: Install Rust toolchain - uses: actions-rs/toolchain@v1 - with: - toolchain: ${{ matrix.rust.version }} - override: true - profile: minimal - - name: Install wasm-pack - 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 }} - - name: Test - run: wasm-pack test --chrome --firefox --safari --headless --features ${{ matrix.features }} - - fmt: - name: Rust fmt - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Install Rust toolchain - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - override: true - profile: minimal - components: rustfmt - - name: Check fmt - run: cargo fmt --all -- --config format_code_in_doc_comments=true --check - - clippy_check: - needs: prepare - runs-on: ubuntu-latest - permissions: - checks: write - steps: - - uses: actions/checkout@v4 - - uses: actions-rs/toolchain@v1 - with: - toolchain: ${{ needs.prepare.outputs.rust_version }} - components: clippy - override: true - - name: Rust Cache - uses: Swatinem/rust-cache@v2.7.5 - - uses: actions-rs/clippy-check@v1 - with: - token: ${{ secrets.GITHUB_TOKEN }} - name: Clippy Results - args: --all-features --all-targets -- -D warnings diff --git a/Cargo.toml b/Cargo.toml index 99e2508..3bc8be6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -16,7 +16,7 @@ readme = "README.md" license = "MIT OR Apache-2.0" authors = ["Bitcoin Developers"] edition = "2021" -rust-version = "1.63" +rust-version = "1.73" [lib] crate-type = ["cdylib", "rlib"] diff --git a/clippy.toml b/clippy.toml index b3c3a24..f09ac0f 100644 --- a/clippy.toml +++ b/clippy.toml @@ -1 +1 @@ -msrv = "1.63.0" +msrv = "1.73.0" diff --git a/rust-version b/rust-version deleted file mode 100644 index 8f03ba2..0000000 --- a/rust-version +++ /dev/null @@ -1 +0,0 @@ -1.82.0 \ No newline at end of file