Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(examples): Separate examples from the workspace and check them in CI #4961

Merged
merged 17 commits into from
Jan 27, 2025
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ ci-clippy = "clippy --all-targets --all-features -- -D warnings"
ci-license = "license-template --template .license_template"
ci-udeps = "udeps --all-targets --backend=depinfo"
ci-udeps-external = "udeps --all-targets --manifest-path external-crates/move/Cargo.toml --backend=depinfo"
ci-check-custom-indexer-example = "check --manifest-path examples/custom-indexer/rust/Cargo.toml"
ci-check-tic-tac-toe-example = "check --manifest-path examples/tic-tac-toe/cli/Cargo.toml"
thibault-martinez marked this conversation as resolved.
Show resolved Hide resolved
ci-check-docs-example = "check --manifest-path docs/examples/rust/Cargo.toml"

[build]
rustflags = ["-C", "force-frame-pointers=yes", "-C", "force-unwind-tables=yes"]
Expand Down
5 changes: 4 additions & 1 deletion .github/actions/diffs/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,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 +43,10 @@ runs:
- "Cargo.lock"
- ".config/nextest.toml"
- "rust-toolchain.toml"
isRustExample:
- "examples/custom-indexer/rust/**"
- "examples/tic-tac-toe/cli/**"
- "docs/examples/rust/**"
isDoc:
- "docs/content/**"
- "docs/site/**"
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/_rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ on:
inputs:
isRust:
type: boolean
isRustExample:
type: boolean

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

deny:
uses: ./.github/workflows/_cargo_deny.yml
Expand Down
14 changes: 14 additions & 0 deletions .github/workflows/_rust_lints.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ on:
inputs:
isRust:
type: boolean
isRustExample:
type: boolean

concurrency:
group: rust-lints-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
Expand Down Expand Up @@ -45,6 +47,18 @@ jobs:
exit 1 # Fail the workflow
fi

examples:
if: (!cancelled() && !failure() && inputs.isRustExample)
runs-on: [self-hosted]
steps:
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
- name: Check docs example
DaughterOfMars marked this conversation as resolved.
Show resolved Hide resolved
run: cargo ci-check-docs-example
- name: Check custom indexer example
run: cargo ci-check-custom-indexer-example
- name: Check tic tac toe example
run: cargo ci-check-tic-tac-toe-example

clippy:
if: (!cancelled() && !failure() && inputs.isRust)
needs:
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/hierarchy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ jobs:
cancel-in-progress: ${{ github.ref != 'refs/heads/develop' }}
outputs:
isRust: ${{ steps.diff.outputs.isRust }}
isRustExample: ${{ steps.diff.outputs.isRustExample }}
isMove: ${{ steps.diff.outputs.isMove }}
isRosetta: ${{ steps.diff.outputs.isRosetta }}
isDoc: ${{ steps.diff.outputs.isDoc }}
Expand Down Expand Up @@ -106,6 +107,7 @@ jobs:
secrets: inherit
with:
isRust: ${{ needs.diff.outputs.isRust == 'true' }}
isRustExample: ${{ needs.diff.outputs.isRustExample == 'true' }}

rosetta:
needs:
Expand Down
Loading
Loading