Skip to content

Commit

Permalink
Optimize alpine tests
Browse files Browse the repository at this point in the history
  • Loading branch information
matyhtf committed Oct 23, 2024
1 parent efe4f9c commit 370a496
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 18 deletions.
20 changes: 10 additions & 10 deletions .github/workflows/alpine.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
ARG PHP_VERSION
ARG ALPINE_VERSION

FROM hyperf/hyperf:${PHP_VERSION}-alpine-v${ALPINE_VERSION}-dev
FROM phpswoole/php:${PHP_VERSION}-alpine

LABEL maintainer="Swoole Team <[email protected]>" version="1.0" license="Apache2"

ARG PHP_VERSION

COPY . /opt/www
COPY . /swoole

WORKDIR /opt/www
WORKDIR /swoole

RUN set -ex \
&& phpize \
&& ./configure --enable-openssl --enable-swoole-curl \
&& make -s -j$(nproc) && make install \
&& echo "extension=swoole.so" > /etc/php$(echo $PHP_VERSION | sed 's/\.//g')/conf.d/50_swoole.ini \
# check
&& php -v \
&& php -m \
&& php --ri swoole \
&& echo -e "\033[42;37m Build Completed :).\033[0m\n"
&& make -s -j$(nproc) && make install

RUN echo "extension=swoole.so" > "/usr/local/etc/php/conf.d/swoole.ini"
RUN php -v
RUN php -m
RUN php --ri swoole
RUN echo -e "\033[42;37m Build Completed :).\033[0m\n"
12 changes: 4 additions & 8 deletions .github/workflows/ext.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
make clean && make -j$(nproc)

build-macos-latest:
if: "!contains(github.event.head_commit.message, '--filter=')"
if: "!contains(github.event.head_commit.message, '--filter=') || contains(github.event.head_commit.message, '[macos]')"
runs-on: macos-latest
steps:
- name: install dependencies
Expand Down Expand Up @@ -70,20 +70,16 @@ jobs:
make clean && make -j$(sysctl -n hw.ncpu)

build-alpine-latest:
if: "!contains(github.event.head_commit.message, '--filter=')"
if: "!contains(github.event.head_commit.message, '--filter=') || contains(github.event.head_commit.message, '[alpine]')"
runs-on: ubuntu-latest
strategy:
matrix:
php-version: [ '8.1', '8.2', '8.3' ]
alpine-version: [ '3.18', '3.19', '3.20' ]
exclude:
- php-version: '8.3'
alpine-version: '3.18'
php-version: [ '8.1', '8.2', '8.3', '8.4' ]
max-parallel: 8
fail-fast: false
steps:
- uses: actions/checkout@v4
- name: build
run: |
cp .github/workflows/alpine.Dockerfile alpine.Dockerfile
docker build -t swoole . -f alpine.Dockerfile --build-arg PHP_VERSION=${{ matrix.php-version }} --build-arg ALPINE_VERSION=${{ matrix.alpine-version }}
docker build -t swoole . -f alpine.Dockerfile --build-arg PHP_VERSION=${{ matrix.php-version }}

0 comments on commit 370a496

Please sign in to comment.