Skip to content

Run linting without building the native code #414

Description

@kraenhansen

Tracking two related TODOs in the lint job of .github/workflows/check.yml.

The lint job currently has to set up a full native toolchain — JDK 17, the Android SDK + NDK, and the x86_64-linux-android Rust target — and then bootstrap two packages, purely so that type-checking has types to work with:

# Set up JDK and Android SDK only because we need weak-node-api, to build ferric-example and to run the linting
# TODO: Remove this once we have a way to run linting without building the native code

# Bootstrap weak-node-api and ferric-example to get types
# TODO: Solve this by adding an option to ferric to build only types or by committing the types into the repo as a fixture for an "init" command

That is a lot of wall-clock time and cache surface for a job whose actual output is ESLint, Prettier, depcheck and publint results. It also couples the fastest-feedback job to the health of the native toolchain: an NDK or rustup hiccup fails linting on a pure-TypeScript PR.

Two things need solving, and they can be tackled independently:

  1. weak-node-apipnpm --filter weak-node-api run bootstrap is run for its generated types. Splitting the generation of the TypeScript/C++ declarations from the actual native build would let the lint job generate types only, dropping the JDK/Android SDK/NDK setup.
  2. ferric-example — as the existing TODO suggests, either add an option to ferric to emit only the .d.ts (skipping the Cargo build), or commit the generated types into the repo as a fixture — the latter doubles as the fixture an init command would need (Ferric init command #299).

Once both are addressed, the JDK, Android SDK and rustup target add steps can be removed from the lint job.

Metadata

Metadata

Assignees

No one assigned

    Labels

    AutomatableAn issue we expect to be fixed using automation.CIContinuous integration

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions