Repository navigation
feat(engine): single-source logic engine generating TypeScript, Python, Go and Rust #24
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: Engine | |
| on: | |
| pull_request: | |
| types: [opened, synchronize, reopened, ready_for_review] | |
| paths: | |
| - "engine/**" | |
| - "core/**" | |
| - ".github/workflows/engine.yml" | |
| push: | |
| branches: [main] | |
| paths: | |
| - "engine/**" | |
| - "core/**" | |
| - ".github/workflows/engine.yml" | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: ${{ github.event_name == 'pull_request' }} | |
| permissions: | |
| contents: read | |
| jobs: | |
| verify: | |
| name: Verify the engine and the core it generates | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 20 | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| persist-credentials: false | |
| # The engine has its own toolchain: Node runs its TypeScript directly, and the generated | |
| # Python and Go are compiled by the runner's own preinstalled toolchains. | |
| - name: Setup Node.js | |
| uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 | |
| with: | |
| node-version-file: .nvmrc | |
| - name: Install the engine's dependencies | |
| run: npm ci | |
| working-directory: engine | |
| # The generated output is committed, so the three formatters decide its bytes. Prettier and | |
| # gofmt come with the engine's install and with Go; ruff is pinned to the version in | |
| # `engine/toolchain.lock.json`, and `verify` fails outright if any of the three is missing. | |
| - name: Install ruff, the Python formatter | |
| run: pipx install ruff==0.15.8 | |
| - name: Verify | |
| # Compiles, generates every target in both idiom modes, regenerates and diffs for | |
| # determinism, runs each target's linters over the output, and runs the differential | |
| # conformance harness against the published package and across the three targets. | |
| run: node ../engine/scripts/verify.ts . | |
| working-directory: core | |
| - name: Check the committed output is what the engine emits | |
| # `out/` is committed so it can be read in review; the verification above regenerated it, | |
| # so a diff here means the sources changed without the output being regenerated. | |
| run: git diff --exit-code --stat -- out | |
| working-directory: core |