Skip to content

Commit

Permalink
Make things less verbose (#2160)
Browse files Browse the repository at this point in the history
  • Loading branch information
pgherveou committed Mar 15, 2024
1 parent 6eea3c3 commit 9fd6126
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 36 deletions.
54 changes: 27 additions & 27 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ env:
CARGO_INCREMENTAL: 0
PURELY_STD_CRATES: ink/codegen metadata engine e2e e2e/macro ink/ir
ALSO_WASM_CRATES: env storage storage/traits allocator prelude primitives ink ink/macro
# TODO `cargo clippy --verbose --all-targets --all-features` for this crate
# TODO `cargo clippy --all-targets --all-features` for this crate
# currently fails on `stable`, but succeeds on `nightly`. This is due to
# this fix not yet in stable: https://github.com/rust-lang/rust-clippy/issues/8895.
# Remove the following line again as soon as `clippy` on stable succeeds again.
Expand Down Expand Up @@ -102,16 +102,16 @@ jobs:

- name: Check Formatting
run: |
cargo +nightly fmt --verbose --all -- --check
cargo +nightly fmt --all -- --check
# For the UI tests we need to disable the license check
cargo +nightly fmt --verbose --all -- --check ./crates/ink/tests/ui/contract/{pass,fail}/*.rs
cargo +nightly fmt --verbose --all -- --check ./crates/ink/tests/ui/trait_def/{pass,fail}/*.rs
cargo +nightly fmt --all -- --check ./crates/ink/tests/ui/contract/{pass,fail}/*.rs
cargo +nightly fmt --all -- --check ./crates/ink/tests/ui/trait_def/{pass,fail}/*.rs
- name: Check Examples Formatting
run: |
scripts/for_all_contracts_exec.sh --path integration-tests -- cargo +nightly fmt --verbose --manifest-path {} -- --check
scripts/for_all_contracts_exec.sh --path integration-tests -- cargo +nightly fmt --manifest-path {} -- --check
# This file is not a part of the cargo project, so it wouldn't be formatted the usual way
rustfmt +nightly --verbose --check ./integration-tests/psp22-extension/runtime/psp22-extension-example.rs
rustfmt +nightly --check ./integration-tests/psp22-extension/runtime/psp22-extension-example.rs
clippy:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -139,14 +139,14 @@ jobs:
run: |
ALL_CRATES="${PURELY_STD_CRATES} ${ALSO_WASM_CRATES}"
for crate in ${ALL_CRATES}; do
cargo clippy --verbose --all-targets --all-features --manifest-path ./crates/${crate}/Cargo.toml \
cargo clippy --all-targets --all-features --manifest-path ./crates/${crate}/Cargo.toml \
-- -D warnings -A ${CLIPPY_ALLOWED};
done
- name: Run Clippy for WASM Crates
run: |
for crate in ${ALSO_WASM_CRATES}; do
cargo clippy --verbose --no-default-features --manifest-path ./crates/${crate}/Cargo.toml --target wasm32-unknown-unknown \
cargo clippy --no-default-features --manifest-path ./crates/${crate}/Cargo.toml --target wasm32-unknown-unknown \
-- -D warnings -A ${CLIPPY_ALLOWED};
done
Expand Down Expand Up @@ -179,13 +179,13 @@ jobs:
- name: Run Clippy for Examples
if: ${{ matrix.type == 'STD' }}
run: |
scripts/for_all_contracts_exec.sh --path integration-tests -- cargo clippy --verbose --all-targets \
scripts/for_all_contracts_exec.sh --path integration-tests -- cargo clippy --all-targets \
--manifest-path {} -- -D warnings -A $CLIPPY_ALLOWED
- name: Run Clippy for WASM Examples
if: ${{ matrix.type == 'WASM' }}
run: |
scripts/for_all_contracts_exec.sh --path integration-tests -- cargo clippy --verbose --no-default-features \
scripts/for_all_contracts_exec.sh --path integration-tests -- cargo clippy --no-default-features \
--target wasm32-unknown-unknown --manifest-path {} -- -D warnings -A $CLIPPY_ALLOWED
check:
Expand Down Expand Up @@ -219,14 +219,14 @@ jobs:
run: |
ALL_CRATES="${PURELY_STD_CRATES} ${ALSO_WASM_CRATES}"
for crate in ${ALL_CRATES}; do
cargo check --verbose --all-features --manifest-path ./crates/${crate}/Cargo.toml;
cargo check --all-features --manifest-path ./crates/${crate}/Cargo.toml;
done
- name: Check WASM
if: ${{ matrix.type == 'WASM' }}
run: |
for crate in ${ALSO_WASM_CRATES}; do
cargo check --verbose --no-default-features --target wasm32-unknown-unknown \
cargo check --no-default-features --target wasm32-unknown-unknown \
--manifest-path ./crates/${crate}/Cargo.toml;
done
Expand All @@ -236,7 +236,7 @@ jobs:
RUSTC_BOOTSTRAP: 1
run: |
for crate in ${ALSO_WASM_CRATES}; do
cargo check --verbose --no-default-features --target $RISCV_TARGET -Zbuild-std="core,alloc" \
cargo check --no-default-features --target $RISCV_TARGET -Zbuild-std="core,alloc" \
--manifest-path ./crates/${crate}/Cargo.toml;
done
Expand Down Expand Up @@ -269,11 +269,11 @@ jobs:
# add required components for CI
rustup component add rustfmt clippy
cargo check --verbose
cargo +nightly fmt --verbose --all -- --check
cargo clippy --verbose -- -D warnings;
cargo +nightly fmt --all -- --check
cargo clippy -- -D warnings;
# Needed until https://github.com/mozilla/sccache/issues/1000 is fixed.
unset RUSTC_WRAPPER
cargo test --verbose --all-features
cargo test --all-features
### workspace

Expand Down Expand Up @@ -308,14 +308,14 @@ jobs:
run: |
ALL_CRATES="${PURELY_STD_CRATES} ${ALSO_WASM_CRATES}"
for crate in ${ALL_CRATES}; do
cargo build --verbose --all-features --release --manifest-path ./crates/${crate}/Cargo.toml;
cargo build --all-features --release --manifest-path ./crates/${crate}/Cargo.toml;
done
- name: Build WASM
if: ${{ matrix.type == 'WASM' }}
run: |
for crate in ${ALSO_WASM_CRATES}; do
cargo build --verbose --no-default-features --release --target wasm32-unknown-unknown \
cargo build --no-default-features --release --target wasm32-unknown-unknown \
--manifest-path ./crates/${crate}/Cargo.toml;
done
Expand Down Expand Up @@ -353,9 +353,9 @@ jobs:
# at the same time, hence we use this workaround.
QUICKCHECK_TESTS: 0
run: |
cargo test --verbose --all-features --no-fail-fast --workspace --locked
cargo test --verbose --all-features --no-fail-fast --workspace --doc --locked
pushd linting && cargo test --verbose --all-features --no-fail-fast --workspace && popd
cargo test --all-features --no-fail-fast --workspace --locked
cargo test --all-features --no-fail-fast --workspace --doc --locked
pushd linting && cargo test --all-features --no-fail-fast --workspace && popd
docs:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -442,8 +442,8 @@ jobs:
# FIXME: Access from 2 users, should be solved once ci-image works from a non-root user
git config --global --add safe.directory '*'
# RUSTFLAGS are the cause target cache can't be used here
cargo build --verbose --all-features --workspace
cargo test --verbose --all-features --no-fail-fast --workspace --locked
cargo build --all-features --workspace
cargo test --all-features --no-fail-fast --workspace --locked
# coverage with branches
grcov . --binary-path ./target/debug/ --source-dir . --output-type lcov --llvm --branch \
--ignore-not-existing --ignore "/*" --ignore "tests/*" --output-path lcov-w-branch.info
Expand Down Expand Up @@ -486,10 +486,10 @@ jobs:
run: |
# run all tests with --all-features, which will run the e2e-tests feature if present
scripts/for_all_contracts_exec.sh --path integration-tests --ignore static-buffer -- cargo test \
--verbose --all-features --manifest-path {}
--all-features --manifest-path {}
# run the static buffer test with a custom buffer size
cargo clean --manifest-path integration-tests/static-buffer/Cargo.toml
INK_STATIC_BUFFER_SIZE=30 cargo test --verbose --manifest-path integration-tests/static-buffer/Cargo.toml --all-features
INK_STATIC_BUFFER_SIZE=30 cargo test --manifest-path integration-tests/static-buffer/Cargo.toml --all-features
- name: Run E2E test with on-chain contract
env:
Expand Down Expand Up @@ -595,7 +595,7 @@ jobs:
# Once https://github.com/paritytech/ink/issues/336 has been implemented we can get rid
# of this flag.
scripts/for_all_contracts_exec.sh --path integration-tests -- cargo doc --manifest-path {} \
--document-private-items --verbose --no-deps
--document-private-items --no-deps
# measurements

Expand Down Expand Up @@ -644,7 +644,7 @@ jobs:
for crate in ${ALL_CRATES}; do
if grep "ink-fuzz-tests =" ./crates/${crate}/Cargo.toml;
then
cargo test --verbose --features ink-fuzz-tests --manifest-path ./crates/${crate}/Cargo.toml --no-fail-fast -- fuzz_ || exit_code=$?;
cargo test --features ink-fuzz-tests --manifest-path ./crates/${crate}/Cargo.toml --no-fail-fast -- fuzz_ || exit_code=$?;
all_tests_passed=$(( all_tests_passed | exit_code ));
fi
done
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,19 +94,19 @@ jobs:
$delegator_subcontracts = "accumulator","adder","subber"
foreach ($contract in $delegator_subcontracts) {
echo "Processing delegator contract: $contract";
cargo ${{ matrix.job }} --verbose --manifest-path integration-tests/delegator/${contract}/Cargo.toml;
cargo ${{ matrix.job }} --manifest-path integration-tests/delegator/${contract}/Cargo.toml;
}
$upgradeable_contracts = "forward-calls","set-code-hash"
foreach ($contract in $upgradeable_contracts) {
echo "Processing upgradeable contract: $contract";
cargo ${{ matrix.job }} --verbose --manifest-path integration-tests/upgradeable-contracts/${contract}/Cargo.toml;
cargo ${{ matrix.job }} --manifest-path integration-tests/upgradeable-contracts/${contract}/Cargo.toml;
}
cargo ${{ matrix.job }} --verbose --manifest-path integration-tests/upgradeable-contracts/set-code-hash/updated-incrementer/Cargo.toml;
cargo ${{ matrix.job }} --manifest-path integration-tests/upgradeable-contracts/set-code-hash/updated-incrementer/Cargo.toml;
foreach ($example in Get-ChildItem -Directory "integration-tests\*") {
if ($example -Match 'upgradeable-contracts') { continue }
if ($example -Match 'lang-err-integration-tests') { continue }
echo "Processing example: $example";
cargo ${{ matrix.job }} --verbose --manifest-path=$example/Cargo.toml;
cargo ${{ matrix.job }} --manifest-path=$example/Cargo.toml;
cargo clean --manifest-path=$example/Cargo.toml;
}
Expand All @@ -115,16 +115,16 @@ jobs:
run: |
for contract in ${DELEGATOR_SUBCONTRACTS}; do
echo "Processing delegator contract: $contract";
cargo ${{ matrix.job }} --verbose --manifest-path integration-tests/delegator/${contract}/Cargo.toml;
cargo ${{ matrix.job }} --manifest-path integration-tests/delegator/${contract}/Cargo.toml;
done
for contract in ${UPGRADEABLE_CONTRACTS}; do
echo "Processing upgradeable contract: $contract";
cargo ${{ matrix.job }} --verbose --manifest-path=integration-tests/upgradeable-contracts/$contract/Cargo.toml;
cargo ${{ matrix.job }} --manifest-path=integration-tests/upgradeable-contracts/$contract/Cargo.toml;
done
cargo ${{ matrix.job }} --verbose --manifest-path=integration-tests/upgradeable-contracts/set-code-hash/updated-incrementer/Cargo.toml;
cargo ${{ matrix.job }} --manifest-path=integration-tests/upgradeable-contracts/set-code-hash/updated-incrementer/Cargo.toml;
for example in integration-tests/*/; do
if [ "$example" = "integration-tests/upgradeable-contracts/" ]; then continue; fi;
if [ "$example" = "integration-tests/lang-err-integration-tests/" ]; then continue; fi;
echo "Processing example: $example";
cargo ${{ matrix.job }} --verbose --manifest-path=$example/Cargo.toml;
cargo ${{ matrix.job }} --manifest-path=$example/Cargo.toml;
done
2 changes: 1 addition & 1 deletion .github/workflows/measurements.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:
${SCRIPTS_DIR}/for_all_contracts_exec.sh --path integration-tests --quiet -- ${SCRIPTS_DIR}/contract_size.sh {} > ${PR_CONTRACT_SIZES}
sed -ie 's/^integration-tests\///g' ${PR_CONTRACT_SIZES}
# Measure contract sizes for the upstream branch
git clone --verbose --depth 1 --branch ${UPSTREAM_BRANCH} ${UPSTREAM_REPO} ${UPSTREAM_DIR}
git clone --depth 1 --branch ${UPSTREAM_BRANCH} ${UPSTREAM_REPO} ${UPSTREAM_DIR}
pushd ${UPSTREAM_DIR}
${SCRIPTS_DIR}/for_all_contracts_exec.sh --path integration-tests --quiet -- ${SCRIPTS_DIR}/contract_size.sh {} > ${UPSTREAM_CONTRACT_SIZES}
sed -ie 's/^integration-tests\///g' ${UPSTREAM_CONTRACT_SIZES}
Expand Down

0 comments on commit 9fd6126

Please sign in to comment.