Skip to content

CI: fix Scrutinizer build (pin default-jammy image, drop external coverage)#17

Merged
mmucklo merged 2 commits into
masterfrom
fix-scrutinizer-image
Apr 13, 2026
Merged

CI: fix Scrutinizer build (pin default-jammy image, drop external coverage)#17
mmucklo merged 2 commits into
masterfrom
fix-scrutinizer-image

Conversation

@mmucklo

@mmucklo mmucklo commented Apr 13, 2026

Copy link
Copy Markdown
Owner

Problem

Scrutinizer was failing every inspection with:

```
[Downloading]: https://php-package-mirror.scrutinizer-ci.com/8.3.4.tar.bz2
bzip2: (stdin) is not a bzip2 file.
tar: Child returned status 2
BUILD ERROR
```

Their package mirror is no longer serving the 8.3.4 tarball. Because we pinned `build.environment.php: 8.3`, Scrutinizer was attempting to compile PHP from source and aborting before any analysis could run.

Fix

Match the proven-working pattern from `mmucklo/email-parse`:

  • `build.image: default-jammy` — pre-built image with PHP available, no source compile.
  • Drop `build.environment.php` — no version pin means no mirror dependency.
  • Drop `tools.external_code_coverage` and run PHPUnit inside Scrutinizer with `XDEBUG_MODE=coverage vendor/bin/phpunit --coverage-clover=.coverage`. Coverage is generated locally to the inspection — no upload bridge needed.

Workflow cleanup

Removed the `ocular install` + `Upload coverage to Scrutinizer` steps from `.github/workflows/ci.yml`. Those steps existed to feed `external_code_coverage` from GH Actions; with Scrutinizer generating coverage itself, they're dead weight. The Codecov upload step is preserved.

Test plan

  • YAML validates.
  • Confirm on PR run: Scrutinizer build succeeds, analysis completes, coverage reports.
  • Confirm GH Actions still green on PHP 8.1 / 8.2 / 8.3 / 8.4 + Codecov upload.

🤖 Generated with Claude Code

Scrutinizer was failing with "(stdin) is not a bzip2 file" — their
php-package-mirror is not serving the requested 8.3.4 tarball, so
their build aborts before our code is ever inspected. The pre-built
default-jammy image bypasses the source compile entirely.

Match the working pattern from mmucklo/email-parse:
- Set build.image: default-jammy.
- Drop build.environment.php (no version pinning means no source build).
- Drop tools.external_code_coverage and run PHPUnit inside Scrutinizer
  (XDEBUG_MODE=coverage vendor/bin/phpunit --coverage-clover=.coverage)
  so coverage is generated locally to the inspection.

Workflow cleanup:
- Remove the ocular install + upload steps from .github/workflows/ci.yml.
  They were the bridge for tools.external_code_coverage; with Scrutinizer
  generating coverage itself, the bridge is no longer needed.

Codecov upload from GH Actions is preserved.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@codecov

codecov Bot commented Apr 13, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.07%. Comparing base (692aa5a) to head (663db4c).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##             master      #17   +/-   ##
=========================================
  Coverage     98.07%   98.07%           
  Complexity       27       27           
=========================================
  Files             1        1           
  Lines            52       52           
=========================================
  Hits             51       51           
  Misses            1        1           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

phpcs-run requires either a directory argument or a phpcs.xml config
file in the repo root, and we have neither — the step exits 1:

  No checking directory given, please add checking directory, e.g.
  'phpcs-run ./'; Or add configuration file 'phpcs.xml' in root directory

Matches the email-parse reference config (analysis runs php-scrutinizer-run
only). Roadmap §7 already plans php-cs-fixer / pint in GH Actions, which
will be stricter and deterministic than Scrutinizer's phpcs and won't
depend on their container.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@mmucklo mmucklo merged commit a5bba46 into master Apr 13, 2026
7 checks passed
@mmucklo mmucklo deleted the fix-scrutinizer-image branch April 13, 2026 04:54
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