diff --git a/.github/workflows/test_and_build.yml b/.github/workflows/test_and_build.yml index 16dd001f5..add3d34aa 100644 --- a/.github/workflows/test_and_build.yml +++ b/.github/workflows/test_and_build.yml @@ -79,6 +79,10 @@ jobs: - name: Check phar run: sudo ./easyengine.phar cli info + - name: Check phar contents + run: | + php -r '$bad = []; foreach ( new RecursiveIteratorIterator( new Phar( "easyengine.phar" ) ) as $f ) { $p = $f->getPathname(); if ( preg_match( "#/vendor/easyengine/[^/]+/(tests|features)/#", $p ) ) { $bad[] = $p; } } if ( $bad ) { fwrite( STDERR, "Package tests or features in the phar:\n" . implode( "\n", $bad ) . "\n" ); exit( 1 ); }' + - name: Upload built Phar file uses: actions/upload-artifact@v7 with: diff --git a/utils/make-phar.php b/utils/make-phar.php index 4429f36bc..c7a2d5f7e 100644 --- a/utils/make-phar.php +++ b/utils/make-phar.php @@ -267,6 +267,8 @@ function get_composer_versions( $current_version ) { add_file( $phar, $file ); } +// A fresh finder: the one above still carries its *.php pattern and would add the packages' tests and features too. +$finder = new Finder(); $finder ->files() ->ignoreDotFiles(false)