Skip to content

Commit

Permalink
Merge branch 'development' into comms-rpc-improve-last-request-latency
Browse files Browse the repository at this point in the history
* development:
  feat: improve wallet connectivity status for console wallet (#3577)
  v0.21.1
  feat: add error codes to LibWallet for CipherSeed errors (#3578)
  ci: split cucumber job into two (#3583)
  feat(wallet): import utxo’s as EncumberedToBeReceived rather than Unspent (#3575)
  docs: rfc 0250_Covenants (#3574)
  • Loading branch information
sdbondi committed Nov 17, 2021
2 parents eb8b815 + e191e27 commit fde4f9b
Show file tree
Hide file tree
Showing 43 changed files with 754 additions and 274 deletions.
232 changes: 43 additions & 189 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,107 +4,59 @@ defaults:
rust_image: &rust_image quay.io/tarilabs/rust_tari-build-with-deps:nightly-2021-09-18

commands:
test:
description: Run the tests
parameters:
release:
description: Set this to true to compile in release mode.
type: boolean
default: false
cucumber-js:
description: Run cucumber scenarios
steps:
- run:
name: Calculate dependencies
command: |
rustc --version >rust-version
test -e Cargo.lock || cargo generate-lockfile
name: node -v
command: node -v
- run:
name: Install cargo2junit
command: cargo install cargo2junit
- restore_cache:
keys:
- v6-cargo-cache-{{arch}}-{{checksum "rust-version"}}-<<parameters.release>>-{{checksum "Cargo.lock"}}
name: npm ci
command: cd integration_tests && npm ci
- run:
name: Run tests
command: mkdir -p testresults && cargo test --workspace --all-features -v --jobs=3 <<#parameters.release>>--release<</parameters.release>> -- -Z unstable-options --format json --report-time | cargo2junit > testresults/results.xml
- save_cache:
paths:
- /usr/local/cargo/registry
- target
key: v6-cargo-cache-{{arch}}-{{checksum "rust-version"}}-<<parameters.release>>-{{checksum "Cargo.lock"}}
- store_test_results:
path: testresults
- store_artifacts:
path: testresults
build:
description: Build
parameters:
release:
description: Set this to true to compile in release mode.
type: boolean
default: false
steps:
name: Check formatting
command: cd integration_tests && npm run check-fmt
- run:
name: Calculate dependencies
command: |
rustc --version >rust-version
test -e Cargo.lock || cargo generate-lockfile
- restore_cache:
keys:
- v6-cargo-cache-{{arch}}-{{checksum "rust-version"}}-<<parameters.release>>-{{checksum "Cargo.lock"}}
name: Check eslint
command: cd integration_tests && npm run lint
- run:
name: Build
command: cargo build -v --all --all-features --jobs=3 <<#parameters.release>>--release<</parameters.release>>
name: Build base node
command: cargo build --release --bin tari_base_node
- run:
name: Build Wallet
command: cargo build -p tari_wallet <<#parameters.release>>--release<</parameters.release>>
- save_cache:
paths:
- /usr/local/cargo/registry
- target
key: v6-cargo-cache-{{arch}}-{{checksum "rust-version"}}-<<parameters.release>>-{{checksum "Cargo.lock"}}
clippy:
description: cargo clippy
steps:
name: Build wallet
command: cargo build --release --bin tari_console_wallet
- run:
name: Calculate dependencies
command: |
rustc --version >rust-version
test -e Cargo.lock || cargo generate-lockfile
- restore_cache:
keys:
- v6-cargo-cache-{{arch}}-{{checksum "rust-version"}}-{{checksum "Cargo.lock"}}
name: Build mmproxy
command: cargo build --release --bin tari_merge_mining_proxy
- run:
name: Cargo fmt
command: |
TOOLCHAIN=$(awk '/channel = /{print $NF}' rust-toolchain.toml)
rustup component add --toolchain $TOOLCHAIN rustfmt
cargo fmt --all -- --check
name: Build mining_node
command: cargo build --release --bin tari_mining_node
- run:
name: Run clippy (main source)
command: |
TOOLCHAIN=$(awk '/channel = /{print $NF}' rust-toolchain.toml)
rustup component add --toolchain $TOOLCHAIN clippy
cargo clippy -- -D warnings -W clippy::cognitive_complexity
name: Build stratum_transcoder
command: cargo build --release --bin tari_stratum_transcoder
- run:
name: Run clippy (all targets)
command: cargo clippy --all-targets -- -D warnings
- save_cache:
paths:
- /usr/local/cargo/registry
- target
key: v6-cargo-cache-{{arch}}-{{checksum "rust-version"}}-{{checksum "Cargo.lock"}}
cucumber-js:
description: Run cucumber scenarios
name: Run cucumber scenarios
no_output_timeout: 20m
command: cd integration_tests && mkdir -p cucumber_output && node_modules/.bin/cucumber-js --profile "ci" --tags "@critical and not @long-running and not @broken and not @wallet-ffi" --format json:cucumber_output/tests.cucumber --exit --retry 3 --retry-tag-filter "@flaky and not @broken"
- run:
name: Generate report
command: cd integration_tests && node ./generate_report.js
when: always
- store_test_results:
path: integration_tests/cucumber_output
- store_artifacts:
path: integration_tests/cucumber_output
- store_artifacts:
path: integration_tests/temp/reports
cucumber-js-ffi:
description: Run cucumber scenarios (FFI)
steps:
- run:
name: node -v
command: node -v
- run:
name: npm ci
command: cd integration_tests && npm ci
- run:
name: Check formatting
command: cd integration_tests && npm run check-fmt
- run:
name: Check eslint
command: cd integration_tests && npm run lint
Expand All @@ -126,14 +78,6 @@ commands:
- run:
name: Build stratum_transcoder
command: cargo build --release --bin tari_stratum_transcoder
- run:
name: Run cucumber scenarios
no_output_timeout: 20m
command: cd integration_tests && mkdir -p cucumber_output && node_modules/.bin/cucumber-js --profile "ci" --tags "@critical and not @long-running and not @broken and not @wallet-ffi" --format json:cucumber_output/tests.cucumber --exit --retry 3 --retry-tag-filter "@flaky and not @broken"
- run:
name: Generate report
command: cd integration_tests && node ./generate_report.js
when: always
# Below step requires NodeJS v12 to run correctly, see explanation in WalletFFI.feature
- run:
name: Run FFI wallet library cucumber scenarios
Expand All @@ -154,30 +98,6 @@ commands:
path: integration_tests/temp/reports

jobs:
test-docs:
docker:
- image: *rust_image
steps:
- checkout
- run:
name: RFC documentation
command: |
cargo install mdbook --version ^0.4
cd RFC && mdbook test && mdbook build
- persist_to_workspace:
root: .
paths: book

test-tari-release:
docker:
- image: *rust_image
resource_class: medium
steps:
- checkout
- test:
release: true

run-integration-tests:
docker:
- image: *rust_image
Expand All @@ -188,64 +108,16 @@ jobs:
- checkout
- cucumber-js

build-tari-release:
docker:
- image: *rust_image
resource_class: medium
steps:
- checkout
- build:
release: true

clippy:
run-ffi-integration-tests:
docker:
- image: *rust_image
resource_class: medium
environment:
CARGO_HTTP_MULTIPLEXING: false
steps:
- checkout
- clippy
- cucumber-js-ffi

deploy-docs:
docker:
- image: quay.io/tarilabs/git-ssh-client:0.2-alpine
steps:
- checkout
- attach_workspace:
at: .
- add_ssh_keys:
fingerprints:
- "a6:a6:e2:be:a3:94:3e:4c:9d:51:25:f6:98:f9:0c:a4"
- run:
name: Deploy docs to gh-pages branch
command: |
DEST_BRANCH=gh-pages
DEST_PATH=book/
if [[ ! -d $DEST_PATH ]]; then
echo "$DEST_PATH directory not found!"
exit 1
fi
TMP_DIR=$(mktemp -d /tmp/ghpages_XXXXXX)
echo "Copying book files to temporary location $TMP_DIR"
cp -R $DEST_PATH/* $DEST_PATH/.nojekyll $TMP_DIR
REMOTE=$(git remote get-url origin)
cd $TMP_DIR
git config --global user.email "ci-build@tari.com"
git config --global user.name "ci-build"
git init
git checkout -b $DEST_BRANCH
git remote add origin $REMOTE
git add --all .
git commit -m "[skip ci] Update RFC docs"
git push origin $DEST_BRANCH --force
echo "Published."

workflows:
version: 2
Expand All @@ -255,25 +127,7 @@ workflows:
filters:
branches:
ignore: gh-pages
# - test-docs:
# filters:
# branches:
# ignore: gh-pages
# - deploy-docs:
# requires:
# - test-docs
# filters:
# branches:
# only: development
# - build-tari-release:
# filters:
# branches:
# ignore: gh-pages
# - test-tari-release:
# filters:
# branches:
# ignore: gh-pages
# - clippy:
# filters:
# branches:
# ignore: gh-pages
- run-ffi-integration-tests:
filters:
branches:
ignore: gh-pages
Loading

0 comments on commit fde4f9b

Please sign in to comment.