Skip to content

Commit

Permalink
ci: use Nextest, remove broken rust-cache, more unit test coverage
Browse files Browse the repository at this point in the history
Signed-off-by: Nurzhan Sakén <[email protected]>
  • Loading branch information
nxsaken committed Sep 23, 2024
1 parent 8580c57 commit d9cb4c0
Show file tree
Hide file tree
Showing 19 changed files with 156 additions and 174 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/iroha2-custom-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,8 @@ jobs:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.CHECKOUT_REF }}
- uses: Swatinem/rust-cache@v2
- name: Build iroha executor
run: cargo run --bin iroha_wasm_builder -- build ./wasm_samples/default_executor --optimize --out-file ${{ env.DOCKER_COMPOSE_PATH }}/executor.wasm
run: mold --run cargo run --bin iroha_wasm_builder -- build ./wasm_samples/default_executor --optimize --out-file ${{ env.DOCKER_COMPOSE_PATH }}/executor.wasm
- name: Upload executor to reuse in other jobs
uses: actions/upload-artifact@v4
with:
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/iroha2-dev-nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,8 @@ jobs:
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2
- name: Build iroha executor
run: cargo run --bin iroha_wasm_builder -- build ./wasm_samples/default_executor --optimize --out-file ${{ env.DOCKER_COMPOSE_PATH }}/executor.wasm
run: mold --run cargo run --bin iroha_wasm_builder -- build ./wasm_samples/default_executor --optimize --out-file ${{ env.DOCKER_COMPOSE_PATH }}/executor.wasm
- name: Upload executor to reuse in other jobs
uses: actions/upload-artifact@v4
with:
Expand Down
38 changes: 4 additions & 34 deletions .github/workflows/iroha2-dev-pr-static.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,55 +8,25 @@ on:
- '**.json'
- '**.toml'
- '.github/workflows/iroha2-dev-pr-static.yml'
- 'pytests/**.py'
- '**.py'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

env:
RUSTUP_TOOLCHAIN: nightly-2024-09-09
DOCKER_COMPOSE_PATH: defaults

jobs:
build_executor:
runs-on: ubuntu-latest
container:
image: hyperledger/iroha2-ci:nightly-2024-09-09
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2
- name: Build iroha executor
run: cargo run --bin iroha_wasm_builder -- build ./wasm_samples/default_executor --optimize --out-file ${{ env.DOCKER_COMPOSE_PATH }}/executor.wasm
- name: Upload executor to reuse in other jobs
uses: actions/upload-artifact@v4
with:
name: executor.wasm
path: ${{ env.DOCKER_COMPOSE_PATH }}/executor.wasm
retention-days: 1

smart_contracts_analysis:
runs-on: ubuntu-latest
needs: build_executor
container:
image: hyperledger/iroha2-ci:nightly-2024-09-09
steps:
- uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2
- name: Download executor.wasm file
uses: actions/download-artifact@v4
with:
name: executor.wasm
path: ${{ env.DOCKER_COMPOSE_PATH }}
- name: Default executor format
run: |
cd ./wasm_samples/default_executor
mold --run cargo fmt --all -- --check
- name: Integration tests smart contracts format
run: |
cd ./wasm_samples
mold --run cargo fmt --all -- --check
- name: cargo fmt (wasm_samples)
working-directory: wasm_samples
run: cargo fmt --all -- --check

python_static_analysis:
runs-on: ubuntu-latest
Expand Down
13 changes: 6 additions & 7 deletions .github/workflows/iroha2-dev-pr-wasm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ on:
pull_request:
branches: [main]
paths:
- '.github/workflows/iroha2-dev-pr-wasm.yaml'

- 'crates/iroha_data_model/**.rs'
- 'crates/iroha_data_model/**.yml'
- 'crates/iroha_data_model/**.json'
Expand Down Expand Up @@ -34,7 +36,6 @@ concurrency:
cancel-in-progress: true

env:
RUSTUP_TOOLCHAIN: nightly-2024-09-09
DOCKER_COMPOSE_PATH: defaults

jobs:
Expand All @@ -45,9 +46,8 @@ jobs:
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2
- name: Build iroha executor
run: cargo run --bin iroha_wasm_builder -- build ./wasm_samples/default_executor --optimize --out-file ${{ env.DOCKER_COMPOSE_PATH }}/executor.wasm
run: mold --run cargo run --bin iroha_wasm_builder -- build ./wasm_samples/default_executor --optimize --out-file ${{ env.DOCKER_COMPOSE_PATH }}/executor.wasm
- name: Upload executor to reuse in other jobs
uses: actions/upload-artifact@v4
with:
Expand All @@ -57,19 +57,18 @@ jobs:

tests:
runs-on: ubuntu-latest
needs: build_executor
container:
image: hyperledger/iroha2-ci:nightly-2024-09-09
needs: build_executor
steps:
- uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2
- name: Download executor.wasm file
- name: Download executor.wasm
uses: actions/download-artifact@v4
with:
name: executor.wasm
path: ${{ env.DOCKER_COMPOSE_PATH }}
- name: Install iroha_wasm_test_runner
run: cargo install --path crates/iroha_wasm_test_runner
run: which iroha_wasm_test_runner || cargo install --path crates/iroha_wasm_test_runner
- name: Run smart contract tests on WebAssembly VM
working-directory: crates/iroha_smart_contract
run: mold --run cargo test -p iroha_smart_contract -p iroha_smart_contract_utils --release --tests --target wasm32-unknown-unknown --no-fail-fast --quiet
Loading

0 comments on commit d9cb4c0

Please sign in to comment.