datahaven/.github/workflows/CI.yml
Facundo Farall 935babe36a
ci: 👷 Add CI to check PAPI metadata (#107)
Add CI check for Polkadot-API metadata freshness

This PR adds a new CI workflow that ensures the Polkadot-API metadata
file (`test/.papi/metadata/datahaven.scale`)
   is kept up-to-date when runtime changes are made.

  Changes:

  - Added task-check-metadata.yml workflow that:
- Reuses the WASM artifact from the build-operator job (no duplicate
compilation)
    - Runs `bun x papi add` to regenerate metadata
    - Fails if the metadata file has uncommitted changes
- Integrated the check into `CI.yml` as a second-tier job alongside
`docker-build`

  Why:

- Prevents TypeScript type definitions from becoming out of sync with
the runtime
- Reminds developers to run `bun generate:types:fast` when making
runtime changes
  - Ensures consistent type safety across the codebase

The check provides clear error messages with instructions when metadata
is outdated.
2025-06-19 19:12:04 -03:00

54 lines
No EOL
1.4 KiB
YAML

#! Main CI Specification for DataHaven Repository
name: CI
on:
workflow_dispatch:
push:
branches:
- main
pull_request:
branches: [main]
concurrency:
group: pr-checks-${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
# First Tier - Build the binary first
build-operator:
uses: ./.github/workflows/task-build-operator.yml
# First Tier - Other parallel jobs
ts-build:
uses: ./.github/workflows/task-ts-build.yml
ts-lint:
uses: ./.github/workflows/task-ts-lint.yml
unit-tests:
uses: ./.github/workflows/task-rust-tests.yml
contract-tests:
uses: ./.github/workflows/task-foundry-tests.yml
rust-lint:
uses: ./.github/workflows/task-rust-lint.yml
# Second Tier - Jobs that depend on operator build
check-metadata:
needs: [build-operator]
uses: ./.github/workflows/task-check-metadata.yml
with:
binary-hash: ${{ needs.build-operator.outputs.binary-hash }}
docker-build:
needs: [build-operator]
uses: ./.github/workflows/task-docker.yml
secrets: inherit
with:
binary-hash: ${{ needs.build-operator.outputs.binary-hash }}
# Third Tier - E2E tests depend on docker build
e2e-tests:
needs: [docker-build]
uses: ./.github/workflows/task-e2e.yml
secrets: inherit
with:
image-tag: ${{ needs.docker-build.outputs.image-tag }}