diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 256576ad..7ebc0f7e 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -4,11 +4,8 @@ on: [push, pull_request] jobs: - test-lib: + test: runs-on: ubuntu-latest - defaults: - run: - working-directory: payjoin strategy: fail-fast: false matrix: @@ -17,31 +14,6 @@ jobs: - stable - nightly - steps: - - uses: actions/checkout@v2 - - uses: Swatinem/rust-cache@v1.2.0 - - uses: actions-rs/toolchain@v1 - with: - toolchain: ${{ matrix.rust }} - override: true - - name: Fixes for MSRV - if: matrix.rust == '1.63.0' - run: | - cargo update - cargo update -p regex --precise 1.9.6 - - name: test - run: cargo test --verbose --all-features --lib - - test-payjoin-cli: - runs-on: ubuntu-latest - defaults: - run: - working-directory: payjoin-cli - strategy: - fail-fast: false - matrix: - rust: [1.63.0, stable, nightly] - steps: - uses: actions/checkout@v2 - uses: Swatinem/rust-cache@v1.2.0 @@ -55,9 +27,10 @@ jobs: cargo update cargo update -p regex --precise 1.9.6 cargo update -p time@0.3.30 --precise 0.3.20 - - name: build payjoin cli example - run: | - cargo test --verbose --features=danger-local-https + - name: test payjoin lib + run: cargo test --package payjoin --verbose --all-features --lib + - name: test payjoin-cli bin + run: cargo test --package payjoin-cli --verbose --features=danger-local-https fmt: runs-on: ubuntu-latest diff --git a/payjoin-cli/Cargo.lock b/Cargo.lock similarity index 99% rename from payjoin-cli/Cargo.lock rename to Cargo.lock index 3b55af44..e7ccf844 100644 --- a/payjoin-cli/Cargo.lock +++ b/Cargo.lock @@ -957,6 +957,8 @@ version = "0.10.0" dependencies = [ "bip21", "bitcoin", + "bitcoind", + "env_logger", "log", "rand", "url", diff --git a/Cargo.toml b/Cargo.toml new file mode 100644 index 00000000..26b9af84 --- /dev/null +++ b/Cargo.toml @@ -0,0 +1,3 @@ +[workspace] +members = ["payjoin", "payjoin-cli"] +resolver = "2" \ No newline at end of file diff --git a/payjoin-cli/tests/e2e.rs b/payjoin-cli/tests/e2e.rs index 6ba2906f..4b8faa9b 100644 --- a/payjoin-cli/tests/e2e.rs +++ b/payjoin-cli/tests/e2e.rs @@ -50,7 +50,7 @@ mod e2e { let pj_host = find_free_port(); let pj_endpoint = format!("https://localhost:{}", pj_host); - let payjoin_cli = "target/debug/payjoin-cli"; + let payjoin_cli = env!("CARGO_BIN_EXE_payjoin-cli"); let mut cli_receiver = Command::new(payjoin_cli) .arg("--rpchost")