feat(dapp): add start an auction test #2920
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Typescript | |
| on: | |
| pull_request: | |
| paths: | |
| - ".github/workflows/typescript.yaml" | |
| - "packages/**" | |
| - "scripts/**" | |
| - "build-scripts/**" | |
| - "sdk/**" | |
| - ".eslintrc.cjs" | |
| - "prettier.config.cjs" | |
| - "dapp/**" | |
| - "names-display/**" | |
| push: | |
| branches: | |
| - develop | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| build_and_lint: | |
| name: TS Build / Lint | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| with: | |
| fetch-depth: 1 | |
| - uses: actions/setup-node@cdca7365b2dadb8aad0a33bc7601856ffabcc48e # v4.3.0 | |
| with: | |
| node-version: 20 | |
| - name: Do a global PNPM install | |
| run: | | |
| npm install -g pnpm | |
| - name: Install Dependencies | |
| run: | | |
| pnpm install | |
| - name: Run pnpm build | |
| env: | |
| NEXT_PUBLIC_NAMES_DAPP_DEFAULT_NETWORK: "devnet" | |
| NEXT_PUBLIC_NAMES_DAPP_CONFIG: | | |
| { | |
| "devnet":{ | |
| "network": "devnet", | |
| "namesDisplayUrl": "http://localhost", | |
| "indexerUrl": "http://localhost:3030", | |
| "baseUrl": "http://localhost:3005" | |
| } | |
| } | |
| run: | | |
| pnpm turbo build | |
| - name: Run pnpm lint | |
| run: | | |
| pnpm lint | |
| sdk_test: | |
| name: SDK Tests | |
| runs-on: ubuntu-latest | |
| services: | |
| postgres: | |
| image: postgres:15 | |
| env: | |
| POSTGRES_USER: postgres | |
| POSTGRES_PASSWORD: postgrespw | |
| POSTGRES_DB: iota_indexer | |
| POSTGRES_HOST_AUTH_METHOD: trust | |
| options: >- | |
| --health-cmd pg_isready | |
| --health-interval 10s | |
| --health-timeout 5s | |
| --health-retries 5 | |
| ports: | |
| - 5432:5432 | |
| steps: | |
| - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| with: | |
| fetch-depth: 1 | |
| - name: Install Homebrew | |
| run: | | |
| /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" | |
| echo "/home/linuxbrew/.linuxbrew/bin" >> $GITHUB_PATH | |
| - name: Install IOTA using Homebrew | |
| run: brew install iotaledger/tap/iota | |
| - uses: actions/setup-node@cdca7365b2dadb8aad0a33bc7601856ffabcc48e # v4.3.0 | |
| with: | |
| node-version: 20 | |
| - name: Do a global PNPM install | |
| run: | | |
| npm install -g pnpm | |
| - name: Install Dependencies | |
| run: | | |
| pnpm install | |
| - name: Typecheck Sdk | |
| run: pnpm -F @iota/iota-names-sdk typecheck | |
| working-directory: ./ | |
| - name: Build SDK | |
| run: | | |
| pnpm sdk build | |
| - name: Prepare local network & run SDK tests | |
| env: | |
| IS_CI_JOB: true | |
| NETWORK: localnet | |
| run: | | |
| iota start --with-faucet --faucet-amount 100000000000000 --with-indexer --with-graphql --force-regenesis --epoch-duration-ms 120000 > /dev/null 2>&1 & | |
| sleep 10 | |
| iota client --yes new-env --alias localnet --rpc http://127.0.0.1:9000 --graphql http://127.0.0.1:9125 | |
| iota client switch --env localnet | |
| iota client faucet | |
| sleep 5 | |
| cd scripts | |
| export NETWORK=localnet | |
| pnpm ts-node init/init.ts localnet | |
| pnpm ts-node tests/register-name.ts | |
| sleep 5 | |
| cat ./package-info/localnet.json | |
| cd ../sdk | |
| VITE_IOTA_BIN="iota" pnpm test:e2e | |
| dapp_e2e_test: | |
| name: Run dapp E2E Tests | |
| runs-on: ubuntu-latest | |
| env: | |
| NEXT_PUBLIC_NAMES_DAPP_DEFAULT_NETWORK: localnet | |
| NEXT_PUBLIC_NAMES_DAPP_CONFIG: | | |
| { | |
| "localnet": { | |
| "network": "localnet", | |
| "namesDisplayUrl": "http://localhost", | |
| "indexerUrl": "http://localhost:3030", | |
| "baseUrl": "http://localhost:3005" | |
| } | |
| } | |
| services: | |
| postgres: | |
| image: postgres:15 | |
| env: | |
| POSTGRES_USER: postgres | |
| POSTGRES_PASSWORD: postgrespw | |
| POSTGRES_DB: iota_indexer | |
| POSTGRES_HOST_AUTH_METHOD: trust | |
| options: >- | |
| --health-cmd pg_isready | |
| --health-interval 10s | |
| --health-timeout 5s | |
| --health-retries 5 | |
| ports: | |
| - 5432:5432 | |
| defaults: | |
| run: | |
| working-directory: ./dapp | |
| steps: | |
| - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| with: | |
| fetch-depth: 1 | |
| - uses: actions/setup-node@cdca7365b2dadb8aad0a33bc7601856ffabcc48e # v4.3.0 | |
| with: | |
| node-version: 20 | |
| - name: Install Homebrew | |
| run: | | |
| /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" | |
| echo "/home/linuxbrew/.linuxbrew/bin" >> $GITHUB_PATH | |
| - name: Install IOTA using Homebrew | |
| run: brew install iotaledger/tap/iota | |
| - name: Do a global PNPM install | |
| run: | | |
| npm install -g pnpm | |
| - name: Install Dependencies | |
| run: | | |
| pnpm install | |
| working-directory: ./ | |
| - name: Download IOTA Wallet Extension | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| pnpm run test:prepare | |
| - name: Install Playwright Browsers | |
| run: | | |
| pnpm run playwright:install | |
| - name: Prepare local network & Run Dapp e2e tests | |
| working-directory: ./ | |
| run: | | |
| iota start --with-faucet --faucet-amount 100000000000000 --with-indexer --with-graphql --force-regenesis --epoch-duration-ms 120000 > /dev/null 2>&1 & | |
| sleep 10 | |
| iota client --yes new-env --alias localnet --rpc http://127.0.0.1:9000 --graphql http://127.0.0.1:9125 | |
| iota client switch --env localnet | |
| iota client faucet | |
| sleep 5 | |
| bash dapp/scripts/update_auctions_duration.sh | |
| cd scripts | |
| export NETWORK=localnet | |
| pnpm ts-node init/init.ts localnet | |
| pnpm ts-node tests/register-name.ts | |
| sleep 5 | |
| cat ./package-info/localnet.json | |
| cd ../dapp | |
| pnpm inject-localnet | |
| cd .. | |
| INDEXER_ENV_FILE="$(mktemp)" | |
| pnpm --dir=scripts ts-node utils/envs.ts localnet bash | sed 's/^export //' > "$INDEXER_ENV_FILE" | |
| docker pull ghcr.io/iotaledger/iota-names/iota-names-indexer:latest | |
| docker rm -f localnet-iota-names-indexer || true | |
| docker run -d \ | |
| --name localnet-iota-names-indexer \ | |
| --env-file "$INDEXER_ENV_FILE" \ | |
| --add-host host.docker.internal:host-gateway \ | |
| -p 3030:3030 \ | |
| -p 9189:9189 \ | |
| ghcr.io/iotaledger/iota-names/iota-names-indexer:latest \ | |
| start \ | |
| --node-url=http://host.docker.internal:9000 \ | |
| --checkpoint-url=http://host.docker.internal:9000 | |
| pnpm dapp build | |
| cd dapp | |
| xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- pnpm run test:e2e | |
| - name: Upload Playwright Report | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: playwright-report | |
| path: dapp/playwright-report/ | |
| retention-days: 7 | |
| names_display_test: | |
| name: Names Display Tests | |
| if: (github.event_name == 'push') || (github.event.pull_request.draft == false || contains(github.event.pull_request.body, '[run-ci]')) | |
| runs-on: self-hosted-x64 | |
| defaults: | |
| run: | |
| working-directory: ./names-display | |
| steps: | |
| - name: checkout code repository | |
| uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 | |
| with: | |
| fetch-depth: 0 | |
| - uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 # v4.0.0 | |
| - name: Install Nodejs | |
| uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 | |
| with: | |
| node-version: "20" | |
| cache: "pnpm" | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| working-directory: ./ | |
| - name: Build sdk | |
| run: pnpm --filter @iota/iota-names-sdk run build | |
| - name: Build names-display service | |
| run: pnpm --filter names-display run build | |
| working-directory: ./ | |
| - name: Run names-display tests | |
| run: pnpm --filter names-display run test | |
| working-directory: ./ |