-
Notifications
You must be signed in to change notification settings - Fork 81
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #222 from AlexNDRmac/builds-for-debian
Builds for debian
- Loading branch information
Showing
5 changed files
with
152 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
FROM debian:11.5-slim as builder | ||
|
||
LABEL Description="Base image with custom PHP version based on Debian" | ||
LABEL name="spx-profiler-debian11" | ||
|
||
ENV DEBIAN_FRONTEND="noninteractive" | ||
ARG PHP_VERSION | ||
|
||
RUN apt update && apt upgrade -y && \ | ||
apt install --no-install-recommends -y \ | ||
lsb-release \ | ||
ca-certificates \ | ||
apt-transport-https \ | ||
software-properties-common \ | ||
gnupg2 \ | ||
wget \ | ||
curl \ | ||
git \ | ||
make\ | ||
zlib1g-dev \ | ||
&& \ | ||
echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" | tee /etc/apt/sources.list.d/sury-php.list && \ | ||
wget -qO - https://packages.sury.org/php/apt.gpg | apt-key add - && \ | ||
apt update && \ | ||
apt install -y php${PHP_VERSION}-dev |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
name: 'PHP Extension build action' | ||
description: 'Build PHP extension for debian using docker' | ||
|
||
runs: | ||
using: 'composite' | ||
steps: | ||
- name: Cache Docker layers | ||
uses: actions/cache@v3 | ||
with: | ||
path: /tmp/.buildx-cache | ||
key: ${{ runner.os }}-buildx-php${{ matrix.php }} | ||
restore-keys: | | ||
${{ runner.os }}-buildx- | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
|
||
- uses: docker/build-push-action@v4 | ||
with: | ||
push: false | ||
load: true | ||
tags: builder:${{ matrix.php }} | ||
file: ./.github/workflows/build-debian-ext/Dockerfile | ||
build-args: | | ||
PHP_VERSION=${{ matrix.php }} | ||
cache-from: type=local,src=/tmp/.buildx-cache | ||
cache-to: type=local,dest=/tmp/.buildx-cache-new | ||
|
||
- name: Move buildx cache | ||
shell: bash | ||
run: | | ||
rm -rf /tmp/.buildx-cache | ||
mv /tmp/.buildx-cache-new /tmp/.buildx-cache | ||
- name: Run the build process with Docker | ||
uses: addnab/docker-run-action@v3 | ||
with: | ||
image: builder:${{ matrix.php }} | ||
options: -v ${{ github.workspace }}:/php-spx | ||
run: | | ||
cd /php-spx | ||
phpize | ||
./configure | ||
make -j"$(getconf _NPROCESSORS_ONLN)" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
name: 'PHP Extension build action' | ||
description: 'Build PHP extension for linux/mac' | ||
|
||
runs: | ||
using: 'composite' | ||
steps: | ||
- name: Setup PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: ${{ matrix.php }} | ||
|
||
- name: Install dependencies | ||
shell: bash | ||
if: runner.os == 'macOS' | ||
run: brew install zlib | ||
|
||
- name: phpize | ||
shell: bash | ||
run: phpize | ||
|
||
- name: Configure | ||
shell: bash | ||
run: | | ||
if [ "${{ runner.os }}" = "macOS" ]; then | ||
./configure --with-zlib-dir=$(brew --prefix)/opt/zlib | ||
else | ||
./configure | ||
fi | ||
- name: Compile | ||
shell: bash | ||
run: | | ||
make -j"$(getconf _NPROCESSORS_ONLN)" | ||
sudo make install | ||
- name: Extension Info | ||
shell: bash | ||
run: | | ||
php --ini | ||
php -d extension=./modules/spx.so --ri spx | ||
- name: Run Tests | ||
shell: bash | ||
run: make test | ||
env: | ||
NO_INTERACTION: 1 | ||
REPORT_EXIT_STATUS: 1 | ||
TEST_PHP_ARGS: "--show-diff" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters