@@ -541,18 +541,11 @@ jobs:
541541
542542 name : PHP ${{ matrix.php-version }} on ${{ matrix.os }}
543543 runs-on : ${{ matrix.os }}
544- env :
545- CARGO_TERM_COLOR : always
546544 steps :
547545 - uses : actions/checkout@v4
548546
549547 - uses : dtolnay/rust-toolchain@stable
550548
551- - name : Cache cargo dependencies
552- uses : Swatinem/rust-cache@v2
553- with :
554- workspaces : bindings/php
555-
556549 - name : Cache LLVM and Clang
557550 id : cache-llvm
558551 uses : actions/cache@v4
@@ -585,71 +578,31 @@ jobs:
585578
586579 - name : Build PHP extension
587580 run : |
588- # Export PHP configuration for ext-php-rs
589581 export PHP_CONFIG=$(which php-config)
590-
582+
591583 cargo build --release
592-
593- # Get PHP extension directory
584+
594585 EXT_DIR=$(php -r "echo ini_get('extension_dir');")
595-
596- # Find the built library - ext-php-rs names it differently on different platforms
586+
597587 if [[ "${{ matrix.os }}" == "macos-13" ]]; then
598- # On macOS, look for .dylib files
599- BUILT_LIB=$(find target/release -name "libcss_inline_php.dylib" -o -name "css_inline_php.dylib" | head -1)
600- if [[ -z "$BUILT_LIB" ]]; then
601- # Fallback: any .dylib file
602- BUILT_LIB=$(find target/release -name "*.dylib" | head -1)
603- fi
604- sudo cp "$BUILT_LIB" "$EXT_DIR/css_inline.so"
588+ BUILT_LIB=$(find target/release -name "*.dylib" | head -1)
605589 else
606- # On Linux, look for .so files
607- BUILT_LIB=$(find target/release -name "libcss_inline_php.so" -o -name "css_inline_php.so" | head -1)
608- if [[ -z "$BUILT_LIB" ]]; then
609- # Fallback: any .so file
610- BUILT_LIB=$(find target/release -name "*.so" | head -1)
611- fi
612- sudo cp "$BUILT_LIB" "$EXT_DIR/css_inline.so"
590+ BUILT_LIB=$(find target/release -name "*.so" | head -1)
613591 fi
614-
615- echo "Built library: $BUILT_LIB"
616- echo "Installed to: $EXT_DIR/css_inline.so"
617-
618- # Verify the file exists and has correct permissions
619- ls -la "$EXT_DIR/css_inline.so"
592+ sudo cp "$BUILT_LIB" "$EXT_DIR/css_inline.so"
620593 working-directory : ./bindings/php
621594 shell : bash
622595
623596 - name : Enable and verify extension
624597 run : |
625- # Create ini file to load extension
626598 if [[ "${{ matrix.os }}" == "macos-13" ]]; then
627- # On macOS, find the additional ini directory
628- PHP_INI_DIR=$(php -i | grep "Scan this dir for additional .ini files" | cut -d' ' -f9 | tr -d ' ')
629- if [[ -z "$PHP_INI_DIR" || "$PHP_INI_DIR" == "(none)" ]]; then
630- # If no scan dir, use the main php.ini location
631- PHP_INI=$(php -i | grep "Loaded Configuration File" | cut -d' ' -f9)
632- PHP_INI_DIR=$(dirname "$PHP_INI")/conf.d
633- sudo mkdir -p "$PHP_INI_DIR"
634- fi
599+ PHP_INI=$(php -i | grep "Loaded Configuration File" | cut -d' ' -f9)
600+ PHP_INI_DIR=$(dirname "$PHP_INI")/conf.d
601+ sudo mkdir -p "$PHP_INI_DIR"
635602 echo "extension=css_inline" | sudo tee "$PHP_INI_DIR/99-css_inline.ini"
636603 else
637604 echo "extension=css_inline" | sudo tee /etc/php/${{ matrix.php-version }}/cli/conf.d/99-css_inline.ini
638605 fi
639-
640- # Verify extension is loaded
641- php -m | grep -i css_inline || (
642- echo "Extension failed to load. Debugging info:"
643- echo "PHP Version:"
644- php -v
645- echo "Extension dir contents:"
646- ls -la $(php -r "echo ini_get('extension_dir');")
647- echo "PHP info grep for css_inline:"
648- php -i | grep -i css_inline || true
649- echo "Try loading directly:"
650- php -d "extension=$(php -r 'echo ini_get("extension_dir");')/css_inline.so" -m | grep -i css_inline || true
651- exit 1
652- )
653606 shell : bash
654607
655608 - name : Install dependencies
0 commit comments