|
56 | 56 | if not success: |
57 | 57 | assert 'unsupported baseline' in result.stderr |
58 | 58 |
|
| 59 | +# PHP 2026-11-19 release metadata, cross-checked against docker-library/php. |
| 60 | +security_versions = { |
| 61 | + '8.2.36': 'df50a00d2b453096608bf2bd98a9fab9a3df8678a77b93011b65c3cfe9a018fa', |
| 62 | + '8.3.37': '0237af84478b7a7649d3964153f1b8653d622550b846f56d63062de683fb86bb', |
| 63 | + '8.4.28': '0c8ec360e5dd8154f270b2fd50cd44ecc824e6ee39c85f911312b80d4daecd72', |
| 64 | + '8.5.13': '607602acaf0c3061818e9916ec44a058e8b3d43959a83862b9cd3ec7bf5b785f', |
| 65 | +} |
| 66 | + |
59 | 67 | # Run only the existing workflow's Python assembly, never a Docker/Actions job. |
60 | 68 | workflow = (root / '.github/workflows/php8-security-release.yml').read_text() |
61 | 69 | assembly = textwrap.dedent(workflow.split("python3 - <<'PY'\n", 1)[1].split('\n PY', 1)[0]) |
62 | 70 | with tempfile.TemporaryDirectory() as tmp: |
63 | | - for version in ('8.2.35', '8.3.36', '8.4.27', '8.5.12'): |
| 71 | + for version, sha256 in security_versions.items(): |
64 | 72 | directory = Path(tmp) / version |
65 | 73 | directory.mkdir() |
66 | 74 | env = dict(os.environ, PHP_VERSION=version, RUNNER_TEMP=str(directory)) |
|
69 | 77 | assert (context / 'data/rebuild-php-eol').is_file() |
70 | 78 | assert (context / 'data/prepare-apt').is_file() |
71 | 79 | assert 'RUN sh /usr/local/bin/rebuild-php-eol' in (context / 'Dockerfile').read_text() |
| 80 | + dockerfile = (context / 'Dockerfile').read_text() |
| 81 | + assert f'ENV PHP_SHA256="{sha256}"' in dockerfile |
| 82 | + assert f'https://www.php.net/distributions/php-{version}.tar.xz' in dockerfile |
| 83 | + assert 'gpg --batch --verify php.tar.xz.asc php.tar.xz' in dockerfile |
| 84 | + assert f'ENV PHP_VERSION {version}\n' in dockerfile |
| 85 | + assert f'PHP_VERSION === "{version}"' in dockerfile |
| 86 | + assert f'"{version}"' in workflow.split('phpVersion: [', 1)[1].split(']', 1)[0] |
72 | 87 | php7 = (root / '.github/workflows/php7-release.yml').read_text() |
73 | 88 | assert "buildPhp74:\n description: 'Build and publish PHP 7.4'\n type: boolean\n default: true" in php7 |
74 | 89 | assert 'Build PHP-7.4 and Push\n if: ${{ inputs.buildPhp74 }}' in php7 |
|
0 commit comments