-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
329 additions
and
352 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,10 @@ | ||
{ | ||
system ? builtins.currentSystem, | ||
lib ? import <nixpkgs/lib>, | ||
prefix, | ||
}: attrs: | ||
lib.pipe attrs.${system} [ | ||
builtins.attrNames | ||
(builtins.map (x: "${prefix}.${system}.${x}")) | ||
(builtins.concatStringsSep "\n") | ||
] |
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,7 @@ | ||
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates | ||
version: 2 | ||
updates: | ||
- package-ecosystem: "github-actions" | ||
directory: "/" | ||
schedule: | ||
interval: "monthly" |
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,29 +1,23 @@ | ||
|
||
ARG PHP_VERSION=7.4 | ||
ARG BASE_IMAGE=php:$PHP_VERSION | ||
ARG PHP_VERSION=8.1 | ||
ARG PHP_TYPE=bookworm | ||
ARG BASE_IMAGE=php:$PHP_VERSION-cli-$PHP_TYPE | ||
|
||
# image0 | ||
FROM ${BASE_IMAGE} | ||
RUN apt-get update && apt-get install -y \ | ||
autoconf \ | ||
automake \ | ||
gcc \ | ||
libstemmer-dev \ | ||
libtool \ | ||
m4 \ | ||
make \ | ||
pkg-config | ||
WORKDIR /build/php-stemmer | ||
ENV DEV_PACKAGES="libcap-dev libpfm4-dev" | ||
WORKDIR /build | ||
RUN apt-get update && apt-get install -y ${DEV_PACKAGES} | ||
ADD . . | ||
RUN phpize | ||
RUN ./configure CFLAGS="-O3" | ||
RUN ./configure | ||
RUN make | ||
RUN make install | ||
|
||
# image1 | ||
FROM ${BASE_IMAGE} | ||
RUN apt-get update && apt-get install -y \ | ||
libstemmer-dev | ||
ENV BIN_PACKAGES="libcap2 libpfm4" | ||
RUN apt-get update && apt-get install -y ${BIN_PACKAGES} | ||
COPY --from=0 /usr/local/lib/php/extensions /usr/local/lib/php/extensions | ||
RUN docker-php-ext-enable stemmer | ||
RUN docker-php-ext-enable perfidious | ||
ENTRYPOINT ["docker-php-entrypoint"] |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,29 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -e -o pipefail | ||
source .github/scripts/fold.sh | ||
set -ex -o pipefail | ||
|
||
# config | ||
export DOCKER_NAME=${DOCKER_NAME:-"alpine"} | ||
export PHP_VERSION=${PHP_VERSION:-"7.4"} | ||
export TEST_PHP_EXECUTABLE=${TEST_PHP_EXECUTABLE:-"/usr/local/bin/php"} | ||
export RUN_TESTS_PHP=${RUN_TESTS_PHP:-"/usr/local/lib/php/build/run-tests.php"} | ||
export PHP_VERSION="${PHP_VERSION:-"8.1"}" | ||
export TEST_PHP_EXECUTABLE="${TEST_PHP_EXECUTABLE:-"/usr/local/bin/php"}" | ||
export RUN_TESTS_PHP="${RUN_TESTS_PHP:-"/usr/local/lib/php/build/run-tests.php"}" | ||
export IMAGE_TAG="${IMAGE_TAG:-"php-stemmer-${DOCKER_NAME}"}" | ||
|
||
function docker_build() ( | ||
docker build \ | ||
-f .github/php-${DOCKER_NAME}.Dockerfile \ | ||
-t php-stemmer \ | ||
--build-arg PHP_VERSION=${PHP_VERSION} \ | ||
. | ||
) | ||
docker build \ | ||
-f ".github/php-${DOCKER_NAME}.Dockerfile" \ | ||
-t "${IMAGE_TAG}" \ | ||
--build-arg "PHP_VERSION=${PHP_VERSION}" \ | ||
. | ||
|
||
function docker_run() ( | ||
set -x | ||
docker run \ | ||
--env NO_INTERACTION=1 \ | ||
--env REPORT_EXIT_STATUS=1 \ | ||
--env TEST_PHP_EXECUTABLE=${TEST_PHP_EXECUTABLE} \ | ||
-v "$PWD/tests:/mnt" \ | ||
php-stemmer \ | ||
php ${RUN_TESTS_PHP} /mnt | ||
) | ||
trap 'catch' ERR | ||
|
||
function install_apt_packages() ( | ||
${SUDO} add-apt-repository ppa:ondrej/php | ||
${SUDO} apt-get update | ||
${SUDO} apt-get install -y php${PHP_VERSION}-dev | ||
) | ||
catch() { | ||
find tests -print0 -name '*.log' | xargs -0 -n1 cat | ||
} | ||
|
||
function generate_tests() ( | ||
php generate_tests.php | ||
) | ||
|
||
# cifold "install apt packages" install_apt_packages | ||
# cifold "generate tests" generate_tests | ||
cifold "docker build" docker_build | ||
cifold "docker run" docker_run | ||
docker run \ | ||
--env NO_INTERACTION=1 \ | ||
--env REPORT_EXIT_STATUS=1 \ | ||
--env "TEST_PHP_EXECUTABLE=${TEST_PHP_EXECUTABLE}" \ | ||
-v "${PWD}/tests:/mnt" \ | ||
"${IMAGE_TAG}" \ | ||
php "${RUN_TESTS_PHP}" /mnt |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.