Skip to content

fix(ci): install Linux native build deps before flutter test - #12

Closed
dotsem wants to merge 1 commit into
mainfrom
fix/ci-linux-native-deps
Closed

dotsem wants to merge 1 commit into
mainfrom
fix/ci-linux-native-deps

Conversation

@dotsem

@dotsem dotsem commented Nov 30, 2026

Copy link
Copy Markdown
Member

Problem

Dart build hooks (native assets) also run during flutter test. window_manager 0.6.0 → nativeapi → cnativeapi compiles C++ and calls pkg-config --cflags gtk+-3.0 x11 xi, so the test job in ci.yml fails on the bare ubuntu-latest runner. Linux builds passed only because build/action.yml installed the apt packages itself.

Change

  • Move the apt list into one file, setup/scripts/install-linux-deps.sh, and add libx11-dev and libxi-dev to it.
  • setup: new input linux-native-deps (default "false"). It is skipped on runners that aren't Linux.
  • build: the Linux target runs the same script through github.action_path/../setup/scripts/, the same way it already reaches resolve-version.sh.
  • ci.yml test job: passes linux-native-deps: true. analyze is unchanged, so it doesn't pay the install time.
  • internal-test.yml: new test-setup-linux-native-deps job. It asserts that pkg-config --cflags gtk+-3.0 x11 xi and clang++ both succeed after ./setup.
  • README: documents the new input.

New input, default off. Not a breaking change.

cd.yml

cd.yml does not run tests. Its Linux build calls dotactions/flutter/build@main, which now runs the shared script, so it uses the same package list. No separate fix is needed there.

Notes

  • test-ci in internal-test.yml runs main's setup@main. Until this PR is merged and released, that job passes an input main doesn't know yet. GitHub warns about it and does not fail. The new test-setup-linux-native-deps job covers the actual install from this branch.
  • actionlint is clean. zizmor's only new findings came from the new test job: artipacked (fixed with persist-credentials: false) and self-repository on ./setup. I left the second one so the job matches the existing ./<action> convention.

Native-asset build hooks (e.g. window_manager 0.6 -> cnativeapi) compile
C++ during `flutter test`, which failed on the bare runner for lack of
GTK/X11/Xi headers.

Move the apt package list to setup/scripts/install-linux-deps.sh, shared
by the build action's Linux target and a new `linux-native-deps` input on
setup, which ci.yml's test job enables. Add libx11-dev and libxi-dev.
@dotsem dotsem closed this Nov 30, 2026
@github-actions

Copy link
Copy Markdown

Flutter coverage

✅ Patch coverage is 100.00% (no changed executable lines found; target 80%).
Project statement coverage is 75.00%.

Flags (1)
  • flutter: 75%

Generated by Coverage Action

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant