Skip to content

Commit

Permalink
build(ci): remove action-rs
Browse files Browse the repository at this point in the history
  • Loading branch information
darkterminal committed Jun 21, 2024
1 parent 9e7f321 commit ca2d45d
Show file tree
Hide file tree
Showing 9 changed files with 133 additions and 16 deletions.
11 changes: 5 additions & 6 deletions .github/workflows/cross-compile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -134,13 +134,12 @@ jobs:

- name: Build (Linux)
if: matrix.os == 'ubuntu-latest'
uses: actions-rs/cargo@v1
with:
use-cross: true
command: build
args: --release --target ${{ matrix.target }}
run: |
cargo install cross
export CROSS_CONFIG=./Cross_php-${{ matrix.php-versions }}.toml
cross build --release --target ${{ matrix.target }}
- name: Build (MacOS and Windows)
- name: Build Extension
if: matrix.os != 'ubuntu-latest'
run: cargo build --release --target ${{ matrix.target }}

Expand Down
2 changes: 1 addition & 1 deletion Cross.toml → Cross_php-8.0.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[target.x86_64-unknown-linux-gnu]
dockerfile = "Dockerfile"
dockerfile = "./docker/php80/Dockerfile"

[build]
rust-toolchain = "nightly"
5 changes: 5 additions & 0 deletions Cross_php-8.1.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[target.x86_64-unknown-linux-gnu]
dockerfile = "./docker/php81/Dockerfile"

[build]
rust-toolchain = "nightly"
5 changes: 5 additions & 0 deletions Cross_php-8.2.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[target.x86_64-unknown-linux-gnu]
dockerfile = "./docker/php82/Dockerfile"

[build]
rust-toolchain = "nightly"
5 changes: 5 additions & 0 deletions Cross_php-8.3.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[target.x86_64-unknown-linux-gnu]
dockerfile = "./docker/php83/Dockerfile"

[build]
rust-toolchain = "nightly"
16 changes: 7 additions & 9 deletions Dockerfile → docker/php80/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Use the latest version of Ubuntu
FROM ubuntu:20.04
FROM ubuntu:latest

# Avoid prompts from apt
ENV DEBIAN_FRONTEND=noninteractive
Expand All @@ -13,14 +13,12 @@ RUN apt-get update && apt-get install -y \
git \
cmake \
llvm \
libclang-dev
libclang-dev \
&& add-apt-repository ppa:ondrej/php -y \
&& apt-get update

# Install PHP 8.0, 8.1, 8.2, 8.3 using retry logic
RUN LC_ALL=C.UTF-8 add-apt-repository -y ppa:ondrej/php && apt-get update && apt-get install -y \
php8.0 php8.0-cli php8.0-common php8.0-dev \
php8.1 php8.1-cli php8.1-common php8.1-dev \
php8.2 php8.2-cli php8.2-common php8.2-dev \
php8.3 php8.3-cli php8.3-common php8.3-dev
# Install PHP 8.0 and php8.0-dev
RUN apt-get install -y php8.0 php8.0-cli php8.0-common php8.0-dev

# Create a non-root user and switch to it
RUN useradd -m dockeruser
Expand All @@ -34,4 +32,4 @@ RUN cargo install cross

# Verify installations
RUN php -v
RUN php-config --version
RUN php-config --version
35 changes: 35 additions & 0 deletions docker/php81/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Use the latest version of Ubuntu
FROM ubuntu:latest

# Avoid prompts from apt
ENV DEBIAN_FRONTEND=noninteractive

# Update and install necessary packages
RUN apt-get update && apt-get install -y \
software-properties-common \
curl \
build-essential \
pkg-config \
git \
cmake \
llvm \
libclang-dev \
&& add-apt-repository ppa:ondrej/php -y \
&& apt-get update

# Install PHP 8.1 and php8.1-dev
RUN apt-get install -y php8.1 php8.1-cli php8.1-common php8.1-dev

# Create a non-root user and switch to it
RUN useradd -m dockeruser
USER dockeruser

# Install Rust and cross
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y \
&& /home/dockeruser/.cargo/bin/rustup default nightly
ENV PATH="/home/dockeruser/.cargo/bin:${PATH}"
RUN cargo install cross

# Verify installations
RUN php -v
RUN php-config --version
35 changes: 35 additions & 0 deletions docker/php82/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Use the latest version of Ubuntu
FROM ubuntu:latest

# Avoid prompts from apt
ENV DEBIAN_FRONTEND=noninteractive

# Update and install necessary packages
RUN apt-get update && apt-get install -y \
software-properties-common \
curl \
build-essential \
pkg-config \
git \
cmake \
llvm \
libclang-dev \
&& add-apt-repository ppa:ondrej/php -y \
&& apt-get update

# Install PHP 8.2 and php8.2-dev
RUN apt-get install -y php8.2 php8.2-cli php8.2-common php8.2-dev

# Create a non-root user and switch to it
RUN useradd -m dockeruser
USER dockeruser

# Install Rust and cross
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y \
&& /home/dockeruser/.cargo/bin/rustup default nightly
ENV PATH="/home/dockeruser/.cargo/bin:${PATH}"
RUN cargo install cross

# Verify installations
RUN php -v
RUN php-config --version
35 changes: 35 additions & 0 deletions docker/php83/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Use the latest version of Ubuntu
FROM ubuntu:latest

# Avoid prompts from apt
ENV DEBIAN_FRONTEND=noninteractive

# Update and install necessary packages
RUN apt-get update && apt-get install -y \
software-properties-common \
curl \
build-essential \
pkg-config \
git \
cmake \
llvm \
libclang-dev \
&& add-apt-repository ppa:ondrej/php -y \
&& apt-get update

# Install PHP 8.3 and php8.3-dev
RUN apt-get install -y php8.3 php8.3-cli php8.3-common php8.3-dev

# Create a non-root user and switch to it
RUN useradd -m dockeruser
USER dockeruser

# Install Rust and cross
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y \
&& /home/dockeruser/.cargo/bin/rustup default nightly
ENV PATH="/home/dockeruser/.cargo/bin:${PATH}"
RUN cargo install cross

# Verify installations
RUN php -v
RUN php-config --version

0 comments on commit ca2d45d

Please sign in to comment.