Skip to content

feat(docs): add more PTB examples #263

feat(docs): add more PTB examples

feat(docs): add more PTB examples #263

name: Turborepo Hierarchy
on:
push:
branches:
- "develop"
- "devnet"
- "testnet"
- "mainnet"
- "releases/iota-*-release"
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
jobs:
diff:
runs-on: [ubuntu-latest]
concurrency:
group: turbo-diff-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/develop' }}
outputs:
isRpc: ${{ steps.diff.outputs.isRpc }}
isWallet: ${{ (steps.turbo.outputs.packages && contains(fromJson(steps.turbo.outputs.packages), 'iota-wallet')) }}
isExplorer: ${{ (steps.turbo.outputs.packages && contains(fromJson(steps.turbo.outputs.packages), 'iota-explorer')) }}
isTypescriptSDK: ${{ (steps.turbo.outputs.packages && contains(fromJson(steps.turbo.outputs.packages), '@iota/iota-sdk')) }}
isAppsBackend: ${{ (steps.turbo.outputs.packages && contains(fromJson(steps.turbo.outputs.packages), 'apps-backend')) }}
isGraphQlTransport: ${{ (steps.turbo.outputs.packages && contains(fromJson(steps.turbo.outputs.packages), '@iota/graphql-transport')) }}
isLedgerjs: ${{ (steps.turbo.outputs.packages && contains(fromJson(steps.turbo.outputs.packages), '@iota/ledgerjs-hw-app-iota')) }}
steps:
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
- name: Detect Changes (turbo)
uses: "./.github/actions/turbo-diffs"
id: turbo
- name: Detect Changes (diff)
uses: "./.github/actions/diffs"
id: diff
audit:
name: pnpm audit
runs-on: self-hosted
concurrency:
group: turbo-audit-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/develop' }}
steps:
- name: Checkout
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
- uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 # v4.0.0
- name: Install Nodejs
uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4
with:
node-version: "20"
- name: Run audit
run: pnpm audit --prod --audit-level high
build:
name: Lint, Build, and Test
runs-on: self-hosted
concurrency:
group: turbo-build-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/develop' }}
steps:
- name: Checkout
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
with:
fetch-depth: 2
- uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 # v4.0.0
- name: Install Nodejs
uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4
with:
node-version: "20"
cache: "pnpm"
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Manypkg Check
run: pnpm manypkg check
- name: Turbo Cache
id: turbo-cache
uses: actions/cache@3624ceb22c1c5a301c8db4169662070a689d9ea8 # v4.1.1
with:
path: .turbo
key: turbo-${{ runner.os }}-${{ github.sha }}
restore-keys: |
turbo-${{ runner.os }}-
- name: Lint
run: pnpm turbo lint
- name: Install wasm-pack for mbf package
uses: jetli/wasm-pack-action@0d096b08b4e5a7de8c28de67e11e945404e9eefa # v0.4.0
with:
version: "latest"
- name: Build
run: pnpm turbo build
- name: Test
# @iota/ledgerjs-hw-app-iota is tested separately
run: pnpm turbo test --filter '!@iota/ledgerjs-hw-app-iota'
# Pack wallet extension and upload it as an artifact for easy developer use:
- name: Wallet Extension Has Changes?
id: wallet-diff
continue-on-error: true
run: pnpm dlx turbo-ignore iota-wallet
- name: Wallet Extension Preview Package
if: steps.wallet-diff.outcome == 'failure'
run: pnpm --filter iota-wallet pack:zip
- uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
if: steps.wallet-diff.outcome == 'failure'
with:
name: wallet-extension
path: apps/wallet/web-ext-artifacts/*
if-no-files-found: error
retention-days: 7
e2e:
if: (!cancelled() && !failure() && !github.event.pull_request.draft && github.ref_name != 'develop')
needs: diff
uses: ./.github/workflows/_e2e.yml
with:
isRpc: ${{ needs.diff.outputs.isRpc == 'true' }}
isWallet: ${{ needs.diff.outputs.isWallet == 'true' }}
isExplorer: ${{ needs.diff.outputs.isExplorer == 'true' }}
isAppsBackend: ${{ needs.diff.outputs.isAppsBackend == 'true' }}
isTypescriptSDK: ${{ needs.diff.outputs.isTypescriptSDK == 'true' }}
isGraphQlTransport: ${{ needs.diff.outputs.isGraphQlTransport == 'true' }}
ledgernano:
if: (!cancelled() && !failure()) && needs.diff.outputs.isLedgerjs == 'true' && github.event.pull_request.draft == false
needs: diff
uses: ./.github/workflows/_ledgernano.yml
secrets: inherit