Skip to content

Commit

Permalink
Import CLI (#1888)
Browse files Browse the repository at this point in the history
* Wallet folder

* Fix docs

* Fix CI

* Add back bindings locks

* Bindings workspaces

* Add CLI

* Add cli to workspace

* Fix covector config

* Update .github/workflows/publish-cli.yml

Co-authored-by: Thoralf-M <[email protected]>

* Update .github/workflows/publish-cli.yml

Co-authored-by: Thoralf-M <[email protected]>

* Update cli/README.md

Co-authored-by: Thoralf-M <[email protected]>

* Update cli/documentation/docs/00_welcome.md

Co-authored-by: Thoralf-M <[email protected]>

* Update cli/documentation/docs/01_installation.md

Co-authored-by: Thoralf-M <[email protected]>

* Address review comments

* Fix coverage

* Nit

---------

Co-authored-by: Thoralf-M <[email protected]>
  • Loading branch information
thibault-martinez and Thoralf-M authored Feb 24, 2023
1 parent 697e19e commit fd3758e
Show file tree
Hide file tree
Showing 669 changed files with 15,840 additions and 381 deletions.
4 changes: 2 additions & 2 deletions .changes/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
},
"packages": {
"nodejs-binding": {
"path": "./bindings/nodejs",
"path": "./wallet/bindings/nodejs",
"manager": "javascript",
"getPublishedVersion": "npm view ${ pkgFile.pkg.name } version",
"prepublish": [
Expand Down Expand Up @@ -41,4 +41,4 @@
]
}
}
}
}
22 changes: 11 additions & 11 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ jobs:
uses: actions-rs/cargo@v1
with:
command: test
args: --all-features --release
args: --all-features --release --manifest-path wallet/Cargo.toml

nodejs-bindings:
runs-on: ${{ matrix.os }}
Expand Down Expand Up @@ -181,8 +181,8 @@ jobs:
# https://github.com/iotaledger/wallet.rs/pull/467/checks?check_run_id=2214108362#step:11:41
with:
path: |
bindings/nodejs/target
bindings/nodejs/artifacts.json
wallet/bindings/nodejs/target
wallet/bindings/nodejs/artifacts.json
# Add date to the cache to keep it up to date
key: ${{ matrix.os }}-stable-cargo-build-node-target-${{ hashFiles('**/Cargo.lock') }}-${{ env.CURRENT_DATE }}
# Restore from outdated cache for speed
Expand All @@ -192,11 +192,11 @@ jobs:
- name: Build nodejs binding
run: npm ci --build-from-source
working-directory: bindings/nodejs
working-directory: wallet/bindings/nodejs

- name: Run npm test
run: npm test
working-directory: bindings/nodejs
working-directory: wallet/bindings/nodejs

swift-bindings:
runs-on: ${{ matrix.os }}
Expand Down Expand Up @@ -250,10 +250,10 @@ jobs:
uses: actions-rs/cargo@v1
with:
command: build
args: --all-features --release --manifest-path bindings/swift/Cargo.toml
args: --all-features --release --manifest-path wallet/bindings/swift/Cargo.toml

- name: Move built library to xcode folder
run: mv "$GITHUB_WORKSPACE/bindings/swift/target/release/libiota_wallet.dylib" "$GITHUB_WORKSPACE/bindings/swift/xcode/IotaWallet/iota_wallet"
run: mv "$GITHUB_WORKSPACE/wallet/bindings/swift/target/release/libiota_wallet.dylib" "$GITHUB_WORKSPACE/wallet/bindings/swift/xcode/IotaWallet/iota_wallet"

- name: Select Xcode
uses: maxim-lobanov/setup-xcode@v1
Expand All @@ -264,7 +264,7 @@ jobs:
run: |
set -o pipefail
xcodebuild build -scheme IotaWallet -project IotaWallet.xcodeproj -destination 'platform=macOS' | xcpretty
working-directory: bindings/swift/xcode/IotaWallet
working-directory: wallet/bindings/swift/xcode/IotaWallet

python-bindings:
runs-on: ${{ matrix.os }}
Expand Down Expand Up @@ -348,7 +348,7 @@ jobs:
- name: Cache python binding cargo target
uses: actions/cache@v3
with:
path: bindings/python/target
path: wallet/bindings/python/target
# Add date to the cache to keep it up to date
key: ${{ matrix.os }}-stable-cargo-build-python-target-${{ hashFiles('**/Cargo.lock') }}-${{ env.CURRENT_DATE }}
# Restore from outdated cache for speed
Expand All @@ -358,7 +358,7 @@ jobs:
- name: Build and test python binding
run: tox
working-directory: bindings/python
working-directory: wallet/bindings/python

test-java:
name: Test Java binding
Expand Down Expand Up @@ -433,7 +433,7 @@ jobs:

- name: Test
shell: bash
working-directory: bindings/java/
working-directory: wallet/bindings/java/
run: |
chmod +x gradlew
./gradlew test -i
4 changes: 2 additions & 2 deletions .github/workflows/clippy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,11 @@ jobs:
uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --manifest-path ./bindings/nodejs/Cargo.toml --all-features --all-targets -- -D warnings
args: --manifest-path ./wallet/bindings/nodejs/Cargo.toml --all-features --all-targets -- -D warnings
name: nodejs-binding
- name: python binding clippy check
uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --manifest-path ./bindings/python/Cargo.toml --all-features --all-targets -- -D warnings
args: --manifest-path ./wallet/bindings/python/Cargo.toml --all-features --all-targets -- -D warnings
name: python-binding
6 changes: 3 additions & 3 deletions .github/workflows/covector-version-or-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -141,13 +141,13 @@ jobs:
- name: Install dependencies
run: npm install typescript && npm ci
working-directory: bindings/nodejs
working-directory: wallet/bindings/nodejs

- name: Build Node.js prebuild
run: npm run prebuild
working-directory: bindings/nodejs
working-directory: wallet/bindings/nodejs

- name: Upload prebuild to GitHub release
run: npx prebuild --upload-all ${{ secrets.GITHUB_TOKEN }} --tag-prefix nodejs-binding-v
working-directory: bindings/nodejs
working-directory: wallet/bindings/nodejs

38 changes: 19 additions & 19 deletions .github/workflows/examine-wasm-bindings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
paths:
- ".github/workflows/examine-wasm-bindings.yml"
- ".github/actions/**"
- "bindings/wasm/**"
- "wallet/bindings/wasm/**"
# Watch the Rust core too
- "src/**"
- "Cargo.toml"
Expand All @@ -19,7 +19,7 @@ on:
paths:
- ".github/workflows/examine-wasm-bindings.yml"
- ".github/actions/**"
- "bindings/wasm/**"
- "wallet/bindings/wasm/**"
# Watch the Rust core too
- "src/**"
- "Cargo.toml"
Expand Down Expand Up @@ -52,7 +52,7 @@ jobs:
with:
toolchain: nightly
target: wasm32-unknown-unknown
cache-root: bindings/wasm/
cache-root: wallet/bindings/wasm/
cache-job-id: ${{ github.workflow }}-${{ github.job }}-${{ matrix.os }}-${{ matrix.node }}
cache-hash: ${{ hashFiles('.github/workflows/examine-wasm-bindings.yml') }}

Expand All @@ -67,18 +67,18 @@ jobs:
with:
node-version: ${{ matrix.node }}
cache: yarn
cache-dependency-path: bindings/wasm/yarn.lock
cache-dependency-path: wallet/bindings/wasm/yarn.lock

- name: Run Yarn Install
working-directory: bindings/wasm/
working-directory: wallet/bindings/wasm/
run: yarn install

- name: Run Yarn Build
working-directory: bindings/wasm/
working-directory: wallet/bindings/wasm/
run: yarn build

- name: Run Yarn Test
working-directory: bindings/wasm/
working-directory: wallet/bindings/wasm/
run: yarn test

lint:
Expand All @@ -96,30 +96,30 @@ jobs:
toolchain: beta
target: wasm32-unknown-unknown
components: clippy
cache-root: bindings/wasm/
cache-root: wallet/bindings/wasm/
cache-job-id: ${{ github.workflow }}-${{ github.job }}
cache-hash: ${{ hashFiles('.github/workflows/examine-wasm-bindings.yml') }}

- name: Run Clippy
uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --manifest-path bindings/wasm/Cargo.toml --all-features --target=wasm32-unknown-unknown -- --deny warnings
args: --manifest-path wallet/bindings/wasm/Cargo.toml --all-features --target=wasm32-unknown-unknown -- --deny warnings
name: Clippy Results for the Wasm Bindings

- name: Setup Node.js
uses: actions/setup-node@v2
with:
cache: yarn
cache-dependency-path: bindings/wasm/yarn.lock
cache-dependency-path: wallet/bindings/wasm/yarn.lock
node-version: 16.x

- name: Install Dependencies
working-directory: bindings/wasm/
working-directory: wallet/bindings/wasm/
run: yarn

- name: Lint
working-directory: bindings/wasm/
working-directory: wallet/bindings/wasm/
run: yarn lint

check-unused-deps:
Expand All @@ -137,15 +137,15 @@ jobs:
toolchain: nightly
target: wasm32-unknown-unknown
install: cargo-udeps
cache-root: bindings/wasm/
cache-root: wallet/bindings/wasm/
cache-job-id: ${{ github.workflow }}-${{ github.job }}
cache-hash: ${{ hashFiles('.github/workflows/examine-wasm-bindings.yml') }}

- name: Run Cargo Udeps
uses: actions-rs/cargo@v1
with:
command: udeps
args: --manifest-path bindings/wasm/Cargo.toml --all-features --target=wasm32-unknown-unknown
args: --manifest-path wallet/bindings/wasm/Cargo.toml --all-features --target=wasm32-unknown-unknown

# TODO: Check yarn too

Expand Down Expand Up @@ -176,7 +176,7 @@ jobs:
uses: actions-rs/cargo@v1
with:
command: fmt
args: --manifest-path bindings/wasm/Cargo.toml --all -- --check
args: --manifest-path wallet/bindings/wasm/Cargo.toml --all -- --check

- name: Run cargo-license-template
uses: actions-rs/cargo@v1
Expand All @@ -188,15 +188,15 @@ jobs:
uses: actions/setup-node@v2
with:
cache: yarn
cache-dependency-path: bindings/wasm/yarn.lock
cache-dependency-path: wallet/bindings/wasm/yarn.lock
node-version: 16.x

- name: Install Dependencies
working-directory: bindings/wasm/
working-directory: wallet/bindings/wasm/
run: yarn

- name: Format
working-directory: bindings/wasm/
working-directory: wallet/bindings/wasm/
run: yarn format-check

audit:
Expand Down Expand Up @@ -224,6 +224,6 @@ jobs:
#
# - RUSTSEC-2021-0145: `atty` potential unaligned read.
# - Waiting for https://github.com/mackwic/colored/pull/122 to be merged.
args: --file bindings/wasm/Cargo.lock --deny warnings --ignore RUSTSEC-2021-0145
args: --file wallet/bindings/wasm/Cargo.lock --deny warnings --ignore RUSTSEC-2021-0145

# TODO: Check the JavaScript code too
2 changes: 1 addition & 1 deletion .github/workflows/examine-wasm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,4 @@ jobs:
uses: actions-rs/cargo@v1
with:
command: check
args: --release --target=wasm32-unknown-unknown --manifest-path Cargo.toml --no-default-features --features events,storage,message_interface,participation
args: --release --target=wasm32-unknown-unknown --manifest-path wallet/Cargo.toml --no-default-features --features events,storage,message_interface,participation
8 changes: 4 additions & 4 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,22 +53,22 @@ jobs:
uses: actions-rs/cargo@v1
with:
command: fmt
args: --manifest-path ./bindings/nodejs/Cargo.toml --all -- --check
args: --manifest-path ./wallet/bindings/nodejs/Cargo.toml --all -- --check

- name: Run cargo-license-template for nodejs bindings
uses: actions-rs/cargo@v1
with:
command: license-template
args: --manifest-path ./bindings/nodejs/Cargo.toml --template .license_template
args: --manifest-path ./wallet/bindings/nodejs/Cargo.toml --template .license_template

- name: python binding fmt check
uses: actions-rs/cargo@v1
with:
command: fmt
args: --manifest-path ./bindings/python/Cargo.toml --all -- --check
args: --manifest-path ./wallet/bindings/python/Cargo.toml --all -- --check

- name: Run cargo-license-template for python bindings
uses: actions-rs/cargo@v1
with:
command: license-template
args: --manifest-path ./bindings/python/Cargo.toml --template .license_template
args: --manifest-path ./wallet/bindings/python/Cargo.toml --template .license_template
Loading

0 comments on commit fd3758e

Please sign in to comment.