Skip to content

Commit ca2d45d

Browse files
committed
build(ci): remove action-rs
1 parent 9e7f321 commit ca2d45d

File tree

9 files changed

+133
-16
lines changed

9 files changed

+133
-16
lines changed

.github/workflows/cross-compile.yml

+5-6
Original file line numberDiff line numberDiff line change
@@ -134,13 +134,12 @@ jobs:
134134

135135
- name: Build (Linux)
136136
if: matrix.os == 'ubuntu-latest'
137-
uses: actions-rs/cargo@v1
138-
with:
139-
use-cross: true
140-
command: build
141-
args: --release --target ${{ matrix.target }}
137+
run: |
138+
cargo install cross
139+
export CROSS_CONFIG=./Cross_php-${{ matrix.php-versions }}.toml
140+
cross build --release --target ${{ matrix.target }}
142141
143-
- name: Build (MacOS and Windows)
142+
- name: Build Extension
144143
if: matrix.os != 'ubuntu-latest'
145144
run: cargo build --release --target ${{ matrix.target }}
146145

Cross.toml Cross_php-8.0.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[target.x86_64-unknown-linux-gnu]
2-
dockerfile = "Dockerfile"
2+
dockerfile = "./docker/php80/Dockerfile"
33

44
[build]
55
rust-toolchain = "nightly"

Cross_php-8.1.toml

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[target.x86_64-unknown-linux-gnu]
2+
dockerfile = "./docker/php81/Dockerfile"
3+
4+
[build]
5+
rust-toolchain = "nightly"

Cross_php-8.2.toml

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[target.x86_64-unknown-linux-gnu]
2+
dockerfile = "./docker/php82/Dockerfile"
3+
4+
[build]
5+
rust-toolchain = "nightly"

Cross_php-8.3.toml

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[target.x86_64-unknown-linux-gnu]
2+
dockerfile = "./docker/php83/Dockerfile"
3+
4+
[build]
5+
rust-toolchain = "nightly"

Dockerfile docker/php80/Dockerfile

+7-9
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Use the latest version of Ubuntu
2-
FROM ubuntu:20.04
2+
FROM ubuntu:latest
33

44
# Avoid prompts from apt
55
ENV DEBIAN_FRONTEND=noninteractive
@@ -13,14 +13,12 @@ RUN apt-get update && apt-get install -y \
1313
git \
1414
cmake \
1515
llvm \
16-
libclang-dev
16+
libclang-dev \
17+
&& add-apt-repository ppa:ondrej/php -y \
18+
&& apt-get update
1719

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

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

3533
# Verify installations
3634
RUN php -v
37-
RUN php-config --version
35+
RUN php-config --version

docker/php81/Dockerfile

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Use the latest version of Ubuntu
2+
FROM ubuntu:latest
3+
4+
# Avoid prompts from apt
5+
ENV DEBIAN_FRONTEND=noninteractive
6+
7+
# Update and install necessary packages
8+
RUN apt-get update && apt-get install -y \
9+
software-properties-common \
10+
curl \
11+
build-essential \
12+
pkg-config \
13+
git \
14+
cmake \
15+
llvm \
16+
libclang-dev \
17+
&& add-apt-repository ppa:ondrej/php -y \
18+
&& apt-get update
19+
20+
# Install PHP 8.1 and php8.1-dev
21+
RUN apt-get install -y php8.1 php8.1-cli php8.1-common php8.1-dev
22+
23+
# Create a non-root user and switch to it
24+
RUN useradd -m dockeruser
25+
USER dockeruser
26+
27+
# Install Rust and cross
28+
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y \
29+
&& /home/dockeruser/.cargo/bin/rustup default nightly
30+
ENV PATH="/home/dockeruser/.cargo/bin:${PATH}"
31+
RUN cargo install cross
32+
33+
# Verify installations
34+
RUN php -v
35+
RUN php-config --version

docker/php82/Dockerfile

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Use the latest version of Ubuntu
2+
FROM ubuntu:latest
3+
4+
# Avoid prompts from apt
5+
ENV DEBIAN_FRONTEND=noninteractive
6+
7+
# Update and install necessary packages
8+
RUN apt-get update && apt-get install -y \
9+
software-properties-common \
10+
curl \
11+
build-essential \
12+
pkg-config \
13+
git \
14+
cmake \
15+
llvm \
16+
libclang-dev \
17+
&& add-apt-repository ppa:ondrej/php -y \
18+
&& apt-get update
19+
20+
# Install PHP 8.2 and php8.2-dev
21+
RUN apt-get install -y php8.2 php8.2-cli php8.2-common php8.2-dev
22+
23+
# Create a non-root user and switch to it
24+
RUN useradd -m dockeruser
25+
USER dockeruser
26+
27+
# Install Rust and cross
28+
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y \
29+
&& /home/dockeruser/.cargo/bin/rustup default nightly
30+
ENV PATH="/home/dockeruser/.cargo/bin:${PATH}"
31+
RUN cargo install cross
32+
33+
# Verify installations
34+
RUN php -v
35+
RUN php-config --version

docker/php83/Dockerfile

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Use the latest version of Ubuntu
2+
FROM ubuntu:latest
3+
4+
# Avoid prompts from apt
5+
ENV DEBIAN_FRONTEND=noninteractive
6+
7+
# Update and install necessary packages
8+
RUN apt-get update && apt-get install -y \
9+
software-properties-common \
10+
curl \
11+
build-essential \
12+
pkg-config \
13+
git \
14+
cmake \
15+
llvm \
16+
libclang-dev \
17+
&& add-apt-repository ppa:ondrej/php -y \
18+
&& apt-get update
19+
20+
# Install PHP 8.3 and php8.3-dev
21+
RUN apt-get install -y php8.3 php8.3-cli php8.3-common php8.3-dev
22+
23+
# Create a non-root user and switch to it
24+
RUN useradd -m dockeruser
25+
USER dockeruser
26+
27+
# Install Rust and cross
28+
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y \
29+
&& /home/dockeruser/.cargo/bin/rustup default nightly
30+
ENV PATH="/home/dockeruser/.cargo/bin:${PATH}"
31+
RUN cargo install cross
32+
33+
# Verify installations
34+
RUN php -v
35+
RUN php-config --version

0 commit comments

Comments
 (0)