chore(enssdk): migrate core ENS types and utilities #4757
Workflow file for this run
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: "Test: CI" | |
| permissions: | |
| contents: read | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| jobs: | |
| audit: | |
| name: "Audit Dependencies" | |
| runs-on: blacksmith-4vcpu-ubuntu-2204 | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: ./.github/actions/setup_node_environment | |
| - run: pnpm audit --audit-level=moderate | |
| prepublish: | |
| name: "Build NPM Packages" | |
| runs-on: blacksmith-4vcpu-ubuntu-2204 | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: ./.github/actions/setup_node_environment | |
| - run: pnpm packages:prepublish | |
| static-analysis: | |
| name: "Static Analysis" | |
| runs-on: blacksmith-4vcpu-ubuntu-2204 | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: ./.github/actions/setup_node_environment | |
| - name: Run Biome CI | |
| run: pnpm lint:ci | |
| - name: Run TypeScript Typecheck | |
| run: pnpm typecheck | |
| - name: Check Terraform Format | |
| run: terraform fmt -recursive -check -diff | |
| unit-tests: | |
| name: "Unit Tests" | |
| runs-on: blacksmith-4vcpu-ubuntu-2204 | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: ./.github/actions/setup_node_environment | |
| - run: pnpm test | |
| openapi-sync-check: | |
| name: "OpenAPI Spec Sync Check" | |
| runs-on: blacksmith-4vcpu-ubuntu-2204 | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: ./.github/actions/setup_node_environment | |
| - name: Generate OpenAPI spec | |
| run: pnpm generate:openapi | |
| - name: Verify spec is in sync | |
| run: | | |
| SPEC_PATH="docs/docs.ensnode.io/ensapi-openapi.json" | |
| # First, ensure the spec file exists and is tracked by git. | |
| if ! git ls-files --error-unmatch "$SPEC_PATH" >/dev/null 2>&1; then | |
| echo "Error: OpenAPI spec file is missing or untracked: $SPEC_PATH" | |
| echo "" | |
| echo "Git status for the spec file (if any):" | |
| git status --porcelain "$SPEC_PATH" || true | |
| echo "" | |
| echo "To fix, run: pnpm generate:openapi" | |
| echo "Then add and commit the generated ensapi-openapi.json." | |
| exit 1 | |
| fi | |
| # Then, ensure the committed spec matches what the code generates. | |
| if ! git diff --quiet "$SPEC_PATH"; then | |
| echo "Error: OpenAPI spec is out of sync" | |
| echo "" | |
| echo "The committed ensapi-openapi.json differs from what the code generates:" | |
| echo "" | |
| git diff --color "$SPEC_PATH" | |
| echo "" | |
| echo "To fix, run: pnpm generate:openapi" | |
| echo "Then commit the updated ensapi-openapi.json." | |
| exit 1 | |
| fi | |
| echo "OpenAPI spec is in sync with codebase" | |
| - name: Validate OpenAPI spec with Mintlify | |
| run: pnpm dlx --allow-build=keytar mint@^4.1.0 openapi-check docs/docs.ensnode.io/ensapi-openapi.json | |
| graphql-schema-check: | |
| name: "GraphQL Schema Check" | |
| runs-on: blacksmith-4vcpu-ubuntu-2204 | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: ./.github/actions/setup_node_environment | |
| - name: Generate Schemas & Typings | |
| run: pnpm generate:gqlschema | |
| - name: Verify generated files are committed | |
| run: | | |
| if ! git diff --quiet packages/enssdk/src/omnigraph/generated/; then | |
| echo "Error: Generated files are out of sync" | |
| echo "" | |
| echo "The following generated files differ from what is committed:" | |
| git diff --name-status packages/enssdk/src/omnigraph/generated/ | |
| echo "" | |
| echo "To fix, run:" | |
| echo " pnpm generate:gqlschema" | |
| echo "Then commit the updated generated files." | |
| exit 1 | |
| fi | |
| echo "GraphQL schema generated files are in sync" | |
| integrity-check: | |
| name: "Integrity Check" | |
| runs-on: blacksmith-4vcpu-ubuntu-2204 | |
| services: | |
| # run postgres alongside this job | |
| postgres: | |
| image: postgres:17 | |
| env: | |
| POSTGRES_DB: postgres | |
| POSTGRES_USER: postgres | |
| POSTGRES_PASSWORD: password | |
| ports: | |
| - 5432:5432 | |
| options: >- | |
| --health-cmd pg_isready | |
| --health-interval 10s | |
| --health-timeout 5s | |
| --health-retries 5 | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: ./.github/actions/setup_node_environment | |
| # This will run the dev command in background, and wait up to | |
| # HEALTH_CHECK_TIMEOUT seconds. It will monitor the log output to | |
| # ensure the app healthcheck is live. If the command does not | |
| # print the log with the healthcheck message within that time, the step | |
| # will exit with a failure. | |
| # This runtime check uses an ephemeral postgres database that only lives in the CI | |
| # environment. It will be discarded after the CI run. The app will not | |
| # check anything beyond the healthcheck as its job is to ensure the app | |
| # starts successfully only. With the configured RPCs there is likely to | |
| # be rate limits hit. To prevent that, we use private RPC URLs from | |
| # GitHub Secrets. | |
| - name: Run ENSIndexer runtime integrity checks | |
| env: | |
| # Note on managing below configuration with GitHub: | |
| # We use private RPC URLs from GitHub Secrets to avoid rate limits. | |
| # Public RPC URLs are used as fallbacks for repository forks | |
| # that don't have the relevant secrets configured. | |
| NAMESPACE: mainnet | |
| ENSDB_URL: postgresql://postgres:password@localhost:5432/postgres | |
| ENSINDEXER_SCHEMA_NAME: ensindexer_test_ci | |
| PLUGINS: subgraph,basenames,lineanames,threedns,protocol-acceleration,registrars,tokenscope | |
| ENSRAINBOW_URL: https://api.ensrainbow.io | |
| ALCHEMY_API_KEY: ${{ secrets.ALCHEMY_API_KEY }} | |
| QUICKNODE_API_KEY: ${{ secrets.QUICKNODE_API_KEY }} | |
| QUICKNODE_ENDPOINT_NAME: ${{ secrets.QUICKNODE_ENDPOINT_NAME}} | |
| # healthcheck script env variables | |
| HEALTH_CHECK_TIMEOUT: 60 | |
| run: ./.github/scripts/run_ensindexer_healthcheck.sh | |
| integration-tests: | |
| name: "Integration Tests" | |
| runs-on: blacksmith-4vcpu-ubuntu-2204 | |
| timeout-minutes: 10 | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: ./.github/actions/setup_node_environment | |
| - name: Run integration tests | |
| run: pnpm test:integration:ci |