Skip to content

Commit

Permalink
ci: Build executor.wasm in CI
Browse files Browse the repository at this point in the history
Signed-off-by: BAStos525 <[email protected]>
  • Loading branch information
BAStos525 authored and nxsaken committed Aug 5, 2024
1 parent 4983549 commit db0737a
Show file tree
Hide file tree
Showing 16 changed files with 264 additions and 58 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/iroha2-dev-nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,39 @@ name: I2::Dev::Nightly::Publish

on: workflow_dispatch

env:
DOCKER_COMPOSE_PATH: defaults

jobs:
build_executor:
runs-on: ubuntu-latest
container:
image: hyperledger/iroha2-ci:nightly-2024-04-18
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

dockerhub:
runs-on: ubuntu-latest
needs: build_executor
container:
image: hyperledger/iroha2-ci:nightly-2024-04-18
steps:
- uses: actions/checkout@v4
- name: Download executor.wasm file
uses: actions/download-artifact@v4
with:
name: executor.wasm
path: ${{ env.DOCKER_COMPOSE_PATH }}
- uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
Expand Down
24 changes: 24 additions & 0 deletions .github/workflows/iroha2-dev-pr-static.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,39 @@ concurrency:

env:
RUSTUP_TOOLCHAIN: nightly-2024-04-18
DOCKER_COMPOSE_PATH: defaults

jobs:
build_executor:
runs-on: ubuntu-latest
container:
image: hyperledger/iroha2-ci:nightly-2024-04-18
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-04-18
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
Expand Down
24 changes: 24 additions & 0 deletions .github/workflows/iroha2-dev-pr-wasm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,39 @@ concurrency:

env:
RUSTUP_TOOLCHAIN: nightly-2024-04-18
DOCKER_COMPOSE_PATH: defaults

jobs:
build_executor:
runs-on: ubuntu-latest
container:
image: hyperledger/iroha2-ci:nightly-2024-04-18
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

tests:
runs-on: ubuntu-latest
needs: build_executor
container:
image: hyperledger/iroha2-ci:nightly-2024-04-18
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: Install iroha_wasm_test_runner
run: cargo install --path tools/wasm_test_runner
- name: Run smart contract tests on WebAssembly VM
Expand Down
48 changes: 48 additions & 0 deletions .github/workflows/iroha2-dev-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ concurrency:
env:
CARGO_TERM_COLOR: always
CLIENT_CLI_DIR: "/__w/${{ github.event.repository.name }}/${{ github.event.repository.name }}/test"
DOCKER_COMPOSE_PATH: defaults

jobs:
consistency:
Expand All @@ -37,14 +38,37 @@ jobs:
if: always()
run: ./scripts/tests/consistency.sh docker-compose

build_executor:
runs-on: ubuntu-latest
container:
image: hyperledger/iroha2-ci:nightly-2024-04-18
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

# exclude: client/tests/integration/
with_coverage:
runs-on: [self-hosted, Linux, iroha2]
needs: build_executor
container:
image: hyperledger/iroha2-ci:nightly-2024-04-18
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: Run tests, with coverage
run: |
mold --run cargo test --all-features --no-fail-fast --workspace --exclude iroha
Expand All @@ -66,24 +90,36 @@ jobs:
# exclude: client/tests/integration/extra_functional
integration:
runs-on: [self-hosted, Linux, iroha2]
needs: build_executor
container:
image: hyperledger/iroha2-ci:nightly-2024-04-18
timeout-minutes: 30
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: Run tests, with no-default-features
run: mold --run cargo test --no-default-features --no-fail-fast -p iroha integration -- --skip extra_functional

# include: client/tests/integration/extra_functional
extra_functional:
runs-on: [self-hosted, Linux, iroha2]
needs: build_executor
container:
image: hyperledger/iroha2-ci:nightly-2024-04-18
timeout-minutes: 60
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: Run tests
run: mold --run cargo test --no-default-features --no-fail-fast -p iroha extra_functional

Expand Down Expand Up @@ -122,11 +158,17 @@ jobs:

workspace_analysis_clippy:
runs-on: ubuntu-latest
needs: build_executor
container:
image: hyperledger/iroha2-ci:nightly-2024-04-18
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: Format
run: cargo fmt --all -- --check
- name: Lints without features
Expand All @@ -146,12 +188,18 @@ jobs:

torii-api-and-client-cli-tests:
runs-on: [self-hosted, Linux, iroha2]
needs: build_executor
container:
image: hyperledger/iroha2-ci:nightly-2024-04-18
timeout-minutes: 60
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: Build binaries
run: |
cargo build -p iroha_client_cli -p kagami -p irohad
Expand Down
26 changes: 24 additions & 2 deletions .github/workflows/iroha2-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,33 @@ env:
DOCKER_COMPOSE_PATH: defaults

jobs:
build_executor:
runs-on: ubuntu-latest
container:
image: hyperledger/iroha2-ci:nightly-2024-04-18
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

registry:
runs-on: [self-hosted, Linux, iroha2]
needs: build_executor
steps:
- uses: actions/checkout@v4
- name: Download executor.wasm file
uses: actions/download-artifact@v4
with:
name: executor.wasm
path: ${{ env.DOCKER_COMPOSE_PATH }}
- name: Set up Docker Buildx
id: buildx
if: always()
Expand All @@ -28,8 +51,7 @@ jobs:
file: Dockerfile
tags: |
hyperledger/iroha:local
hyperledger/iroha:dev
docker.soramitsu.co.jp/iroha2/iroha:dev
hyperldedger/iroha:dev
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Test docker-compose.single.yml before pushing
Expand Down
24 changes: 24 additions & 0 deletions .github/workflows/iroha2-pr-ui.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,29 @@ concurrency:

env:
CARGO_TERM_COLOR: always
DOCKER_COMPOSE_PATH: defaults

jobs:
build_executor:
runs-on: ubuntu-latest
container:
image: hyperledger/iroha2-ci:nightly-2024-04-18
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

test:
runs-on: ubuntu-latest
needs: build_executor
container:
image: hyperledger/iroha2-ci:nightly-2024-04-18
timeout-minutes: 60
Expand All @@ -32,6 +51,11 @@ jobs:
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
- 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: Run tests, with ${{ matrix.feature_flag }}
run: |
mold --run cargo test --test ui --${{ matrix.feature_flag }}
24 changes: 24 additions & 0 deletions .github/workflows/iroha2-profiling-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,29 @@ env:
IROHA2_RUSTFLAGS: -C force-frame-pointers=on
IROHA2_FEATURES: profiling
IROHA2_CARGOFLAGS: -Z build-std
DOCKER_COMPOSE_PATH: defaults

jobs:
build_executor:
runs-on: ubuntu-latest
container:
image: hyperledger/iroha2-ci:nightly-2024-04-18
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

registry:
runs-on: [self-hosted, Linux, iroha2]
needs: build_executor
container:
image: hyperledger/iroha2-ci:nightly-2024-04-18
steps:
Expand All @@ -35,6 +54,11 @@ jobs:
registry: docker.soramitsu.co.jp
username: ${{ secrets.HARBOR_USERNAME }}
password: ${{ secrets.HARBOR_TOKEN }}
- name: Download executor.wasm file
uses: actions/download-artifact@v4
with:
name: executor.wasm
path: ${{ env.DOCKER_COMPOSE_PATH }}
- name: Set up Docker Buildx
id: buildx
if: always()
Expand Down
Loading

0 comments on commit db0737a

Please sign in to comment.