Skip to content

Commit

Permalink
Merge branch 'develop' into dev-tools/fix-vercel-workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
DaughterOfMars committed Jan 28, 2025
2 parents 9b20413 + 794e8f4 commit 20ace34
Show file tree
Hide file tree
Showing 317 changed files with 12,401 additions and 4,306 deletions.
42 changes: 41 additions & 1 deletion .github/actions/diffs/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,21 @@ outputs:
isRust:
description: True when changes happened to the Rust code
value: "${{ steps.diff.outputs.isRust }}"
isRustExample:
description: True when changes happened to the Rust example code
value: "${{ steps.diff.outputs.isRustExample }}"
isRpc:
description: True when changes happened to the RPC code
value: "${{ steps.diff.outputs.isRpc }}"
isPgIntegration:
description: True when changes happened to the PG integration code
value: "${{ steps.diff.outputs.isPgIntegration }}"
isMove:
description: True when changes happened to the Move code
value: "${{ steps.diff.outputs.isMove }}"
isRosetta:
description: True when changes happened to the rosetta code
value: "${{ steps.diff.outputs.isRosetta }}"
isExternalCrates:
description: True when changes happened in external crates
value: "${{ steps.diff.outputs.isExternalCrates }}"
Expand All @@ -31,7 +43,6 @@ runs:
- "crates/**"
- "external-crates/**"
- "iota-execution/**"
- "docs/examples/rust/**"
- ".github/workflows/hierarchy.yml"
- ".github/workflows/codecov.yml"
- ".github/workflows/_rust.yml"
Expand All @@ -44,6 +55,35 @@ runs:
- "Cargo.lock"
- ".config/nextest.toml"
- "rust-toolchain.toml"
isRustExample:
- "examples/custom-indexer/rust/**"
- "examples/tic-tac-toe/cli/**"
- "docs/examples/rust/**"
isRpc:
- "crates/iota-json-rpc/**"
- "crates/iota-json-rpc-types/**"
- "crates/iota-json-rpc-api/**"
- "crates/iota-graphql-rpc/**"
- ".github/workflows/hierarchy.yml"
- ".github/workflows/_e2e.yml"
- "Cargo.toml"
- "Cargo.lock"
- ".config/nextest.toml"
- "rust-toolchain.toml"
isPgIntegration:
- "crates/iota-indexer/**"
- "crates/iota-graphql-rpc/**"
- "crates/iota-graphql-e2e-tests/**"
- "crates/iota-framework/**"
- "crates/iota-json-rpc-types/**"
- "crates/iota-json-rpc-api/**"
- ".github/workflows/hierarchy.yml"
- ".github/workflows/_rust.yml"
- ".github/workflows/_rust_tests.yml"
- "Cargo.toml"
- "Cargo.lock"
- ".config/nextest.toml"
- "rust-toolchain.toml"
isDoc:
- "docs/content/**"
- "docs/site/**"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/_cargo_deny.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:

concurrency:
group: cargo-deny-${{ inputs.manifest-path || './Cargo.toml' }}-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
cancel-in-progress: ${{ github.ref != 'refs/heads/develop' }}

jobs:
bans-licenses-sources:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/_docs_lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on: workflow_call

concurrency:
group: docs-lint-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
cancel-in-progress: ${{ github.ref != 'refs/heads/develop' }}

jobs:
spelling:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/_docusaurus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on: workflow_call

concurrency:
group: docusaurus-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
cancel-in-progress: ${{ github.ref != 'refs/heads/develop' }}

jobs:
build:
Expand Down
22 changes: 11 additions & 11 deletions .github/workflows/_e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
workflow_dispatch:
workflow_call:
inputs:
isRust:
isRpc:
type: boolean
required: false
isExplorer:
Expand All @@ -25,7 +25,7 @@ on:

concurrency:
group: e2e-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
cancel-in-progress: ${{ github.ref != 'refs/heads/develop' }}

env:
RUST_LOG: warn
Expand All @@ -34,7 +34,7 @@ jobs:
# Run e2e test against localnet built on the develop branch
localnet:
name: Localnet
if: inputs.isExplorer || inputs.isTypescriptSDK || inputs.isWallet || inputs.isRust || github.ref_name == 'develop'
if: inputs.isExplorer || inputs.isTypescriptSDK || inputs.isWallet || inputs.isRpc || github.ref_name == 'develop'
runs-on: self-hosted
services:
postgres:
Expand Down Expand Up @@ -71,11 +71,11 @@ jobs:
echo "E2E_RUN_LOCAL_NET_CMD=(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 || github.ref_name == 'develop'
if: inputs.isTypescriptSDK || inputs.isRpc || 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 || github.ref_name == 'develop'
if: inputs.isGraphQlTransport || inputs.isRpc || 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
Expand All @@ -87,11 +87,11 @@ jobs:
run: pnpm --filter apps-backend test:e2e

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

- name: Run Explorer e2e tests
if: inputs.isTypescriptSDK || inputs.isExplorer || inputs.isRust || github.ref_name == 'develop'
if: inputs.isTypescriptSDK || inputs.isExplorer || inputs.isRpc || github.ref_name == 'develop'
run: pnpm --filter iota-explorer playwright test
- uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
if: always()
Expand All @@ -101,22 +101,22 @@ jobs:
retention-days: 30

- name: Build Kiosk
if: inputs.isRust || inputs.isTypescriptSDK
if: inputs.isRpc || inputs.isTypescriptSDK
run: pnpm turbo --filter=@iota/kiosk build

- name: Run Kiosk e2e tests
if: inputs.isRust || inputs.isTypescriptSDK
if: inputs.isRpc || inputs.isTypescriptSDK
run: pnpm dlx concurrently --kill-others --success command-1 "$E2E_RUN_LOCAL_NET_CMD" 'pnpm --filter=@iota/kiosk test:e2e'

- name: Run Local net
run: cargo run --bin iota start --force-regenesis --with-faucet --epoch-duration-ms 10000 &

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

- name: Run Wallet e2e tests
if: inputs.isWallet || inputs.isRust || inputs.isTypescriptSDK || github.ref_name == 'develop'
if: inputs.isWallet || inputs.isRpc || 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 # v4.4.3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/_ledgernano.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on: workflow_call

concurrency:
group: ledgernano-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
cancel-in-progress: ${{ github.ref != 'refs/heads/develop' }}

jobs:
ledgernano:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/_move_ide.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on: workflow_call

concurrency:
group: move-ide-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
cancel-in-progress: ${{ github.ref != 'refs/heads/develop' }}

jobs:
move-auto-formatter-test:
Expand Down
14 changes: 13 additions & 1 deletion .github/workflows/_rust.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
name: Rust

on: workflow_call
on:
workflow_call:
inputs:
isRust:
type: boolean
isRustExample:
type: boolean
isPgIntegration:
type: boolean

env:
CARGO_TERM_COLOR: always
Expand Down Expand Up @@ -28,6 +36,9 @@ env:
jobs:
rust-lints:
uses: ./.github/workflows/_rust_lints.yml
with:
isRust: ${{ inputs.isRust }}
isRustExample: ${{ inputs.isRustExample }}

deny:
uses: ./.github/workflows/_cargo_deny.yml
Expand Down Expand Up @@ -64,6 +75,7 @@ jobs:
uses: ./.github/workflows/_rust_tests.yml
with:
changedCrates: ${{ join(fromJson(needs.crates-changes.outputs.components), ' ') }}
isPgIntegration: ${{ inputs.isPgIntegration }}

external-tests:
if: github.event.pull_request.draft == false
Expand Down
32 changes: 30 additions & 2 deletions .github/workflows/_rust_lints.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
name: Rust lints

on: workflow_call
on:
workflow_call:
inputs:
isRust:
type: boolean
isRustExample:
type: boolean

concurrency:
group: rust-lints-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
cancel-in-progress: ${{ github.ref != 'refs/heads/develop' }}

env:
CARGO_TERM_COLOR: always
Expand All @@ -14,6 +20,7 @@ env:

jobs:
rustfmt:
if: inputs.isRust
runs-on: [self-hosted]
steps:
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
Expand All @@ -23,6 +30,7 @@ jobs:
run: cargo +nightly ci-fmt

cargo-sort:
if: inputs.isRust
runs-on: [self-hosted]
steps:
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
Expand All @@ -39,6 +47,26 @@ jobs:
exit 1 # Fail the workflow
fi
examples:
if: inputs.isRustExample
runs-on: [self-hosted]
steps:
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
- name: Check examples
# Set the globstar opt here to enable recursive glob.
run: |
shopt -s globstar
for manifest in ./**/examples/**/Cargo.toml; do
echo "Checking format for $manifest"
cargo +nightly ci-fmt --manifest-path $manifest
echo "Clippy linting for $manifest"
cargo clippy --manifest-path $manifest --all-features
echo "Checking unused dependencies of $manifest"
cargo +nightly ci-udeps --manifest-path $manifest
done
clippy:
needs: rustfmt
runs-on: [self-hosted]
Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/_rust_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ on:
runSimtest:
type: boolean
default: true
isPgIntegration:
type: boolean
default: false

concurrency:
group: rust-tests-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
Expand Down Expand Up @@ -147,8 +150,8 @@ jobs:
eval ${command}
graphql-rpc:
name: graphql-rpc
pg-integration:
if: inputs.isPgIntegration
timeout-minutes: 45
runs-on: [self-hosted]
env:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/_typos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on: workflow_call

concurrency:
group: typos-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
cancel-in-progress: ${{ github.ref != 'refs/heads/develop' }}

jobs:
run:
Expand Down
16 changes: 11 additions & 5 deletions .github/workflows/hierarchy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,15 @@ on:

jobs:
diff:
runs-on: [self-hosted]
runs-on: [ubuntu-latest]
concurrency:
group: diff-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/develop' }}
outputs:
isRust: ${{ steps.diff.outputs.isRust }}
isRustExample: ${{ steps.diff.outputs.isRustExample }}
isRpc: ${{ steps.diff.outputs.isRpc }}
isPgIntegration: ${{ steps.diff.outputs.isPgIntegration }}
isMove: ${{ steps.diff.outputs.isMove }}
isRosetta: ${{ steps.diff.outputs.isRosetta }}
isDoc: ${{ steps.diff.outputs.isDoc }}
Expand All @@ -44,7 +47,7 @@ jobs:
runs-on: [self-hosted]
concurrency:
group: dprint-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
cancel-in-progress: ${{ github.ref != 'refs/heads/develop' }}
steps:
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
- name: Check dprint formatting
Expand All @@ -57,7 +60,7 @@ jobs:
name: license-check
concurrency:
group: license-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
cancel-in-progress: ${{ github.ref != 'refs/heads/develop' }}
needs: diff
if: needs.diff.outputs.isRust == 'true'
runs-on: [self-hosted]
Expand Down Expand Up @@ -100,8 +103,11 @@ jobs:
- dprint-format
- license-check
- typos
if: needs.diff.outputs.isRust == 'true'
uses: ./.github/workflows/_rust.yml
with:
isRust: ${{ needs.diff.outputs.isRust == 'true' }}
isRustExample: ${{ needs.diff.outputs.isRustExample == 'true' }}
isPgIntegration: ${{ needs.diff.outputs.isPgIntegration == 'true' }}

rosetta:
needs:
Expand All @@ -120,7 +126,7 @@ jobs:
- typos
uses: ./.github/workflows/_e2e.yml
with:
isRust: ${{ needs.diff.outputs.isRust == 'true' }}
isRpc: ${{ needs.diff.outputs.isRpc == 'true' }}
isWallet: ${{ needs.diff.outputs.isWallet == 'true' }}
isExplorer: ${{ needs.diff.outputs.isExplorer == 'true' }}
isAppsBackend: ${{ needs.diff.outputs.isAppsBackend == 'true' }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/preview_wiki.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ on:

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
cancel-in-progress: ${{ github.ref != 'refs/heads/develop' }}

jobs:
wiki-preview:
Expand Down
Loading

0 comments on commit 20ace34

Please sign in to comment.