diff --git a/.github/actions/embed/Dockerfile b/.github/actions/embed/Dockerfile deleted file mode 100644 index a16d96b48..000000000 --- a/.github/actions/embed/Dockerfile +++ /dev/null @@ -1,15 +0,0 @@ -FROM debian:trixie - -WORKDIR /tmp - -RUN apt update -y && apt upgrade -y -RUN apt install lsb-release wget gnupg php8.4-dev libphp8.4-embed build-essential curl -y -RUN bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)" - -ENV RUSTUP_HOME=/rust -ENV CARGO_HOME=/cargo -ENV PATH=/cargo/bin:/rust/bin:$PATH - -RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --no-modify-path && cargo install cargo-expand - -ENTRYPOINT [ "/cargo/bin/cargo", "test", "--workspace", "--release", "--features", "closure,embed,anyhow", "--no-fail-fast" ] diff --git a/.github/actions/embed/action.yml b/.github/actions/embed/action.yml deleted file mode 100644 index c99ebf502..000000000 --- a/.github/actions/embed/action.yml +++ /dev/null @@ -1,5 +0,0 @@ -name: 'PHP Embed and Rust' -description: 'Builds the crate after installing the latest PHP with php embed and stable Rust.' -runs: - using: 'docker' - image: 'Dockerfile' diff --git a/.github/actions/zts/Dockerfile b/.github/actions/zts/Dockerfile deleted file mode 100644 index 28ae5d00e..000000000 --- a/.github/actions/zts/Dockerfile +++ /dev/null @@ -1,15 +0,0 @@ -FROM php:8.2-zts-bullseye - -WORKDIR /tmp - -RUN apt update -y && apt upgrade -y -RUN apt install lsb-release wget gnupg software-properties-common -y -RUN bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)" - -ENV RUSTUP_HOME=/rust -ENV CARGO_HOME=/cargo -ENV PATH=/cargo/bin:/rust/bin:$PATH - -RUN (curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain nightly --no-modify-path) && rustup default nightly - -ENTRYPOINT [ "/cargo/bin/cargo", "build", "--all", "--release" ] diff --git a/.github/actions/zts/action.yml b/.github/actions/zts/action.yml deleted file mode 100644 index 9cd1bd112..000000000 --- a/.github/actions/zts/action.yml +++ /dev/null @@ -1,5 +0,0 @@ -name: 'PHP ZTS and Rust' -description: 'Builds the crate after installing the latest PHP with ZTS and stable Rust.' -runs: - using: 'docker' - image: 'Dockerfile' \ No newline at end of file diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5fc0539dd..3f67638a6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -168,19 +168,60 @@ jobs: # Macos fails on unstable rust. We skip the inline examples test for now. if: "!(contains(matrix.os, 'macos') && matrix.rust == 'nightly')" run: cargo test --release --workspace --features closure,anyhow,runtime --no-fail-fast ${{ matrix.php == '8.0' && '--no-default-features' || '' }} - build-zts: - name: Build with ZTS - runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v5 - - name: Build - uses: ./.github/actions/zts test-embed: name: Test with embed runs-on: ubuntu-latest + env: + clang: "17" + php_version: "8.4" steps: - name: Checkout code uses: actions/checkout@v5 - - name: Test - uses: ./.github/actions/embed + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ env.php_version }} + env: + debug: true + + - name: Install libphp-embed + run: sudo apt update -y && sudo apt install -y libphp8.4-embed + + - name: Setup Rust + uses: dtolnay/rust-toolchain@master + with: + toolchain: stable + components: rustfmt, clippy + + - name: Install cargo-expand + uses: dtolnay/install@cargo-expand + + - name: Cache cargo dependencies + uses: Swatinem/rust-cache@v2 + with: + prefix-key: ${{ env.RUST_CACHE_PREFIX }} + + - name: Cache LLVM and Clang + id: cache-llvm + uses: actions/cache@v4 + with: + path: ${{ runner.temp }}/llvm-${{ env.clang }} + key: ubuntu-latest-llvm-${{ env.clang }} + + - name: Setup LLVM & Clang + id: clang + uses: KyleMayes/install-llvm-action@v2 + with: + version: ${{ env.clang }} + directory: ${{ runner.temp }}/llvm-${{ env.clang }} + cached: ${{ steps.cache-llvm.outputs.cache-hit }} + + - name: Configure Clang + run: | + echo "LIBCLANG_PATH=${{ runner.temp }}/llvm-${{ env.clang }}/lib" >> $GITHUB_ENV + echo "LLVM_VERSION=${{ steps.clang.outputs.version }}" >> $GITHUB_ENV + echo "LLVM_CONFIG_PATH=${{ runner.temp }}/llvm-${{ env.clang }}/bin/llvm-config" >> $GITHUB_ENV + + - name: Test with embed feature + run: cargo test --workspace --release --features closure,embed,anyhow --no-fail-fast