Skip to content

Commit

Permalink
Merge pull request #301 from mruz/dev
Browse files Browse the repository at this point in the history
PHP 8.1 support
  • Loading branch information
mruz authored Jun 12, 2022
2 parents 8cc573a + 10b3531 commit acdce47
Show file tree
Hide file tree
Showing 5 changed files with 100 additions and 5 deletions.
94 changes: 94 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
name: Ice Framework CI

on:
push:
pull_request:

jobs:
build:
name: Build PHP ${{ matrix.php }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
php: ['7.4', '8.0', '8.1']
include:
- name: focal
os: ubuntu-20.04
services:
mysql:
image: mysql:5.7
ports:
- 3306:3306
env:
MYSQL_ALLOW_EMPTY_PASSWORD: yes
MYSQL_DATABASE: ice_test
mongodb:
image: mongo
env:
MONGO_INITDB_ROOT_USERNAME: root
MONGO_INITDB_ROOT_PASSWORD: password
MONGO_INITDB_DATABASE: ice_test
ports:
- 27017:27017

steps:
- uses: actions/checkout@v2

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: gettext, gd, intl, json, mbstring, pdo, mysql, mongodb
tools: pecl, phpize, php-config
env:
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Apt install
run: sudo apt-get install -y gdb re2c

- name: Composer install
run: composer install --prefer-source --no-scripts

- name: Compile Zephir Parser
shell: bash
run: cd vendor/iceframework/zephir-parser; ./install; sudo cp tests/ci/zephir_parser.ini /etc/php/${{ matrix.php }}/cli/conf.d/

- name: Generate Ice
shell: bash
run: php -d memory_limit=512M ./vendor/bin/zephir generate; mkdir generated; cp -a ext/. generated

- name: Compile Ice
shell: bash
run: cd ext; export CFLAGS="-g3 -O1 -fno-delete-null-pointer-checks -Wall -fvisibility=hidden -DZEPHIR_RELEASE=1"; phpize && ./configure --enable-ice && make -j2 && sudo make install && sudo cp ../tests/ci/ice.ini /etc/php/${{ matrix.php }}/cli/conf.d/

- name: Create test databases
shell: bash
run: |
echo "source tests/ci/ice_test.sql;" | mysql -h 127.0.0.1 -u root ice_test
- name: Test Ice
shell: bash
run: ./vendor/bin/phpunit --configuration tests/phpunit.xml --testsuite=all

- name: Create artifacts
if: steps.build.outcome == 'success' && github.repository_owner == 'ice' && github.ref == 'refs/heads/dev'
run: |
if [[ "${{ matrix.php }}" = "8.1" ]]; then
openssl enc -d -aes-256-cbc -in id_rsa.enc -out ~/.ssh/id_rsa -pbkdf2 -k "$SECRET_KEY"; chmod 600 ~/.ssh/id_rsa
openssl enc -d -aes-256-cbc -in id_pgp.enc -out ~/.gnupg/id_pgp -pbkdf2 -k "$SECRET_KEY"; chmod 600 ~/.gnupg/id_pgp; gpg --allow-secret-key-import --import ~/.gnupg/id_pgp
git config push.default simple
git config commit.gpgsign true
git config --global user.email "info@iceframework.org"
git config --global user.name "Ice Framework"
git config --global user.signingkey 781C2FB7
git remote set-url origin git@github.com:ice/framework.git
export ZEPHIR_TARGET="php8"
export SHORT_SHA=`echo ${GITHUB_SHA} | cut -c1-7`
git checkout dev
rm -rf build/$ZEPHIR_TARGET/; mkdir -p build/$ZEPHIR_TARGET; cp -a generated/. build/$ZEPHIR_TARGET
git add -A build/$ZEPHIR_TARGET; git commit -m "$ZEPHIR_TARGET, $SHORT_SHA: regenerate ice sources [ci skip]" build/$ZEPHIR_TARGET'
git fetch && git rebase --autostash FETCH_HEAD && git push
fi
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
},
"require-dev": {
"phpunit/phpunit": ">=8.0.0",
"iceframework/zephir-parser": "1.3.5",
"phalcon/zephir": "0.13.0",
"iceframework/zephir-parser": "1.5.0",
"phalcon/zephir": "0.16.0",
"mongodb/mongodb": "^1.2.0"
},
"scripts": {
Expand Down
Binary file modified id_pgp.enc
Binary file not shown.
Binary file modified id_rsa.enc
Binary file not shown.
7 changes: 4 additions & 3 deletions tests/ci/ice_test.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php return [
'mysql' => [
'type' => 'mysql',
'host' => 'localhost',
'host' => '127.0.0.1',
'port' => 3306,
'user' => 'root',
'password' => '',
Expand All @@ -12,13 +12,14 @@
],
'mongodb' => [
'type' => 'mongodb',
'host' => 'localhost',
'host' => '127.0.0.1',
'port' => 27017,
'user' => 'root',
'password' => 'password',
'name' => 'ice_test',
'options' => [
'authMechanism' => 'SCRAM-SHA-1',
'authMechanism' => 'SCRAM-SHA-256',
'authSource' => 'admin'
],
],
'auth' => [
Expand Down

0 comments on commit acdce47

Please sign in to comment.