Skip to content

Commit

Permalink
Merge branch 'develop' into devx/tutorial-for-review-rating-with-mult…
Browse files Browse the repository at this point in the history
…isig
  • Loading branch information
vivekjain23 authored Nov 14, 2024
2 parents fae979d + ac01bde commit f173741
Show file tree
Hide file tree
Showing 15 changed files with 736 additions and 136 deletions.
33 changes: 15 additions & 18 deletions .github/workflows/_e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,22 @@ on:
inputs:
isRust:
type: boolean
required: true
required: false
isExplorer:
type: boolean
required: true
required: false
isAppsBackend:
type: boolean
required: true
required: false
isTypescriptSDK:
type: boolean
required: true
required: false
isWallet:
type: boolean
required: true
required: false
isGraphQlTransport:
type: boolean
required: true
isDevelop:
type: boolean
required: true
required: false

concurrency:
group: e2e-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
Expand All @@ -33,7 +30,7 @@ jobs:
# Run e2e test against localnet built on the develop branch
localnet:
name: Localnet
if: inputs.isExplorer || inputs.isTypescriptSDK || inputs.isWallet || inputs.isRust || inputs.isDevelop
if: inputs.isExplorer || inputs.isTypescriptSDK || inputs.isWallet || inputs.isRust || github.ref_name == 'develop'
runs-on: self-hosted
services:
postgres:
Expand Down Expand Up @@ -70,27 +67,27 @@ jobs:
echo "E2E_RUN_LOCAL_NET_CMD=(RUST_LOG=info RUST_BACKTRACE=1 $(echo $PWD/target/debug/iota) start --with-faucet --force-regenesis --with-indexer --with-graphql)" >> $GITHUB_ENV
- name: Run TS SDK e2e tests
if: inputs.isTypescriptSDK || inputs.isRust || inputs.isDevelop
if: inputs.isTypescriptSDK || inputs.isRust || github.ref_name == 'develop'
run: pnpm dlx concurrently --kill-others --success command-1 "$E2E_RUN_LOCAL_NET_CMD" 'pnpm --filter @iota/iota-sdk test:e2e'

- name: Run RPC/GraphQL compatibility e2e tests
if: inputs.isGraphQlTransport || inputs.isRust || inputs.isDevelop
if: inputs.isGraphQlTransport || inputs.isRust || github.ref_name == 'develop'
run: pnpm dlx concurrently --kill-others --success command-1 "$E2E_RUN_LOCAL_NET_CMD" 'pnpm --filter @iota/graphql-transport test:e2e'

- name: Build apps-backend
if: inputs.isAppsBackend || inputs.isDevelop
if: inputs.isAppsBackend || github.ref_name == 'develop'
run: pnpm --filter apps-backend build

- name: Run apps-backend e2e tests
if: inputs.isAppsBackend || inputs.isDevelop
if: inputs.isAppsBackend || github.ref_name == 'develop'
run: pnpm --filter apps-backend test:e2e

- name: Build explorer
if: inputs.isTypescriptSDK || inputs.isExplorer || inputs.isRust || inputs.isDevelop
if: inputs.isTypescriptSDK || inputs.isExplorer || inputs.isRust || github.ref_name == 'develop'
run: pnpm turbo --filter=iota-explorer build

- name: Run Explorer e2e tests
if: inputs.isTypescriptSDK || inputs.isExplorer || inputs.isRust || inputs.isDevelop
if: inputs.isTypescriptSDK || inputs.isExplorer || inputs.isRust || github.ref_name == 'develop'
run: pnpm --filter iota-explorer playwright test
- uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # pin@v4
if: always()
Expand All @@ -111,11 +108,11 @@ jobs:
run: cargo run --bin iota start --force-regenesis --with-faucet --epoch-duration-ms 10000 &

- name: Build Wallet
if: inputs.isWallet || inputs.isRust || inputs.isTypescriptSDK || inputs.isDevelop
if: inputs.isWallet || inputs.isRust || inputs.isTypescriptSDK || github.ref_name == 'develop'
run: pnpm wallet build

- name: Run Wallet e2e tests
if: inputs.isWallet || inputs.isRust || inputs.isTypescriptSDK || inputs.isDevelop
if: inputs.isWallet || inputs.isRust || inputs.isTypescriptSDK || github.ref_name == 'develop'
run: xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- pnpm --filter iota-wallet playwright test

- uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # pin@v4
Expand Down
22 changes: 7 additions & 15 deletions .github/workflows/_external_rust_tests.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
name: Rust tests

on: workflow_call
on:
workflow_call:
inputs:
changedCrates:
type: string
required: false

concurrency:
group: ext-rust-tests-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
Expand All @@ -12,21 +17,8 @@ env:
CARGO_INCREMENTAL: 0

jobs:
changes:
runs-on: [self-hosted]
outputs:
components: ${{ steps.filter.outputs.changes }}
steps:
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # pin@v4
- uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # pin@v3
id: filter
with:
list-files: "json"
filters: .github/external-crates-filters.yml

test:
name: Test external crates
needs: changes
if: (!cancelled())
env:
# Tests written with #[sim_test] are often flaky if run as #[tokio::test] - this var
Expand All @@ -43,7 +35,7 @@ jobs:
run: pip install pyopenssl --upgrade --break-system-packages
- name: cargo test
run: |
array=(${{ join(fromJson(needs.changes.outputs.components), ' ') }})
array=(${{ inputs.changedCrates }})
result=""
Expand Down
38 changes: 33 additions & 5 deletions .github/workflows/_rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,19 +43,47 @@ jobs:
deny:
uses: ./.github/workflows/_cargo_deny.yml

rust-tests:
crates-changes:
needs: rust-lints
runs-on: [self-hosted]
outputs:
components: ${{ steps.filter.outputs.changes }}
steps:
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # pin@v4
- uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # pin@v3
id: filter
with:
list-files: "json"
filters: .github/crates-filters.yml

external-changes:
needs: rust-lints
runs-on: [self-hosted]
outputs:
components: ${{ steps.filter.outputs.changes }}
steps:
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # pin@v4
- uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # pin@v3
id: filter
with:
list-files: "json"
filters: .github/external-crates-filters.yml

crates-tests:
if: |
!cancelled() && !failure() && inputs.isRust && github.event.pull_request.draft == false
needs:
- rust-lints
needs: crates-changes
uses: ./.github/workflows/_rust_tests.yml
with:
changedCrates: ${{ join(fromJson(needs.crates-changes.outputs.components), ' ') }}

external-tests:
if: |
!cancelled() && !failure() && inputs.isRust && github.event.pull_request.draft == false
needs:
- rust-lints
needs: external-changes
uses: ./.github/workflows/_external_rust_tests.yml
with:
changedCrates: ${{ join(fromJson(needs.external-changes.outputs.components), ' ') }}

execution-cut:
if: |
Expand Down
25 changes: 8 additions & 17 deletions .github/workflows/_rust_tests.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
name: Rust tests

on: workflow_call
on:
workflow_call:
inputs:
changedCrates:
type: string
required: false

concurrency:
group: rust-tests-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
Expand All @@ -21,21 +26,8 @@ env:
RUSTDOCFLAGS: -D warnings

jobs:
changes:
runs-on: [self-hosted]
outputs:
components: ${{ steps.filter.outputs.changes }}
steps:
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # pin@v4
- uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # pin@v3
id: filter
with:
list-files: "json"
filters: .github/crates-filters.yml

test:
name: Test rust crates
needs: changes
if: (!cancelled())
env:
# Tests written with #[sim_test] are often flaky if run as #[tokio::test] - this var
Expand All @@ -50,7 +42,7 @@ jobs:
tool: nextest
- name: cargo test
run: |
array=(${{ join(fromJson(needs.changes.outputs.components), ' ') }})
array=(${{ inputs.changedCrates }})
result=""
Expand Down Expand Up @@ -126,7 +118,6 @@ jobs:

simtest:
name: Simtest rust
needs: changes
timeout-minutes: 45
runs-on: [self-hosted]
env:
Expand All @@ -138,7 +129,7 @@ jobs:
tool: nextest
- name: setup filter
run: |
array=(${{ join(fromJson(needs.changes.outputs.components), ' ') }})
array=(${{ inputs.changedCrates }})
result=""
Expand Down
16 changes: 5 additions & 11 deletions .github/workflows/_vercel_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,9 @@ on:
shouldDeployPreview:
type: boolean
required: true
isDevelop:
type: boolean
required: true
githubRef:
type: string
required: true

concurrency:
group: ${{ github.workflow }}-${{ inputs.githubRef }}
group: vercel-deploy-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
Expand All @@ -44,7 +38,7 @@ jobs:

explorer-staging:
name: Vercel Explorer Staging
if: inputs.isDevelop
if: github.ref_name == 'develop'
uses: ./.github/workflows/apps_explorer_deploy.yml
secrets: inherit
with:
Expand All @@ -61,7 +55,7 @@ jobs:

ui-kit-prod:
name: Vercel UI Kit Production
if: inputs.isDevelop
if: github.ref_name == 'develop'
uses: ./.github/workflows/apps_ui_kit_deploy.yml
secrets: inherit
with:
Expand All @@ -77,7 +71,7 @@ jobs:

wallet-dashboard-prod:
name: Vercel Wallet Dashboard Production
if: inputs.isDevelop
if: github.ref_name == 'develop'
uses: ./.github/workflows/apps_wallet_dashboard_deploy.yml
secrets: inherit
with:
Expand All @@ -93,7 +87,7 @@ jobs:

apps-backend-prod:
name: Vercel apps-backend Production
if: inputs.isDevelop
if: github.ref_name == 'develop'
uses: ./.github/workflows/apps_backend_deploy.yml
secrets: inherit
with:
Expand Down
5 changes: 1 addition & 4 deletions .github/workflows/hierarchy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,6 @@ jobs:
isAppsBackend: ${{ needs.diff.outputs.isAppsBackend == 'true' }}
isTypescriptSDK: ${{ needs.diff.outputs.isTypescriptSDK == 'true' }}
isGraphQlTransport: ${{ needs.diff.outputs.isGraphQlTransport == 'true' }}
isDevelop: ${{ github.ref_name == 'develop' }}

vercel-deploy:
if: (!cancelled() && !failure())
Expand All @@ -160,14 +159,12 @@ jobs:
uses: ./.github/workflows/_vercel_deploy.yml
secrets: inherit
with:
shouldDeployPreview: ${{github.event_name == 'pull_request' && github.event.pull_request.draft == false}}
shouldDeployPreview: ${{ github.event_name == 'pull_request' && github.event.pull_request.draft == false }}
isExplorer: ${{ needs.diff.outputs.isExplorer == 'true' }}
isTypescriptSDK: ${{ needs.diff.outputs.isTypescriptSDK == 'true' }}
isAppsBackend: ${{ needs.diff.outputs.isAppsBackend == 'true' }}
isAppsUiKit: ${{ needs.diff.outputs.isAppsUiKit == 'true' }}
isWalletDashboard: ${{ needs.diff.outputs.isWalletDashboard == 'true' }}
isDevelop: ${{ github.ref_name == 'develop' }}
githubRef: ${{ github.event.pull_request.number || github.ref }}

ledgernano:
if: (!cancelled() && !failure()) && needs.diff.outputs.isLedgerjs == 'true' && github.event.pull_request.draft == false
Expand Down
33 changes: 27 additions & 6 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Nightly binary build
name: Nightly checks

on:
schedule:
Expand Down Expand Up @@ -29,11 +29,6 @@ env:
RUST_BACKTRACE: short

jobs:
cargo-deny-external:
uses: ./.github/workflows/_cargo_deny.yml
with:
manifest-path: external-crates/move/Cargo.toml

release:
name: build release binaries
runs-on: ${{ matrix.os }}
Expand Down Expand Up @@ -72,3 +67,29 @@ jobs:
with:
command: build
args: --all-targets --all-features --release

tests:
uses: ./.github/workflows/_rust_tests.yml

external-tests:
uses: ./.github/workflows/_external_rust_tests.yml

move-tests:
uses: ./.github/workflows/_move_tests.yml

deny:
uses: ./.github/workflows/_cargo_deny.yml

deny-external:
uses: ./.github/workflows/_cargo_deny.yml
with:
manifest-path: external-crates/move/Cargo.toml

e2e:
uses: ./.github/workflows/_e2e.yml

execution-cut:
uses: ./.github/workflows/_execution_cut.yml

split-cluster:
uses: ./.github/workflows/split_cluster.yml
7 changes: 7 additions & 0 deletions .github/workflows/split_cluster.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
name: Split Cluster Check

on:
workflow_call:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]

env:
CARGO_TERM_COLOR: always
RUST_LOG: "error"
# Don't emit giant backtraces in the CI logs.
RUST_BACKTRACE: short

jobs:
# TODO: re-enable https://github.com/iotaledger/iota/issues/3862
# validate-mainnet:
Expand Down
2 changes: 1 addition & 1 deletion crates/iota-indexer/database_schema.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit f173741

Please sign in to comment.