Skip to content

Commit

Permalink
Merge pull request #2437 from zephir-lang/development
Browse files Browse the repository at this point in the history
0.18.0
  • Loading branch information
Jeckerson authored Sep 30, 2024
2 parents 9f99da6 + b50a053 commit 1c4d380
Show file tree
Hide file tree
Showing 953 changed files with 148,320 additions and 49,423 deletions.
43 changes: 0 additions & 43 deletions .ci/memcheck.sh

This file was deleted.

File renamed without changes.
6 changes: 3 additions & 3 deletions docker/8.0/Dockerfile → .docker/8.0/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM composer:latest as composer
FROM composer:latest AS composer
FROM php:8.0-fpm

RUN CPU_CORES="$(getconf _NPROCESSORS_ONLN)";
Expand All @@ -13,10 +13,10 @@ RUN apt update -y && apt install -y \
libicu-dev \
libgmp-dev \
libzip-dev && \
pecl install psr zephir_parser
pecl install psr xdebug zephir_parser

RUN docker-php-ext-install zip gmp intl mysqli && \
docker-php-ext-enable psr zephir_parser
docker-php-ext-enable psr zephir_parser xdebug

COPY --from=composer /usr/bin/composer /usr/local/bin/composer
# Bash script with helper aliases
Expand Down
File renamed without changes.
6 changes: 3 additions & 3 deletions docker/8.1/Dockerfile → .docker/8.1/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM composer:latest as composer
FROM composer:latest AS composer
FROM php:8.1-fpm

RUN CPU_CORES="$(getconf _NPROCESSORS_ONLN)";
Expand All @@ -13,10 +13,10 @@ RUN apt update -y && apt install -y \
libicu-dev \
libgmp-dev \
libzip-dev && \
pecl install psr zephir_parser
pecl install psr xdebug zephir_parser

RUN docker-php-ext-install zip gmp intl mysqli && \
docker-php-ext-enable psr zephir_parser
docker-php-ext-enable psr zephir_parser xdebug

COPY --from=composer /usr/bin/composer /usr/local/bin/composer
# Bash script with helper aliases
Expand Down
File renamed without changes.
6 changes: 3 additions & 3 deletions docker/8.2/Dockerfile → .docker/8.2/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM composer:latest as composer
FROM composer:latest AS composer
FROM php:8.2-fpm

RUN CPU_CORES="$(getconf _NPROCESSORS_ONLN)";
Expand All @@ -13,10 +13,10 @@ RUN apt update -y && apt install -y \
libicu-dev \
libgmp-dev \
libzip-dev && \
pecl install psr zephir_parser
pecl install psr xdebug zephir_parser

RUN docker-php-ext-install zip gmp intl mysqli && \
docker-php-ext-enable psr zephir_parser
docker-php-ext-enable psr zephir_parser xdebug

COPY --from=composer /usr/bin/composer /usr/local/bin/composer
# Bash script with helper aliases
Expand Down
File renamed without changes.
8 changes: 4 additions & 4 deletions docker/7.4/Dockerfile → .docker/8.3/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
FROM composer:latest as composer
FROM php:7.4-fpm
FROM composer:latest AS composer
FROM php:8.3-fpm

RUN CPU_CORES="$(getconf _NPROCESSORS_ONLN)";
ENV MAKEFLAGS="-j${CPU_CORES}"
Expand All @@ -13,10 +13,10 @@ RUN apt update -y && apt install -y \
libicu-dev \
libgmp-dev \
libzip-dev && \
pecl install psr zephir_parser
pecl install psr zephir_parser xdebug

RUN docker-php-ext-install zip gmp intl mysqli && \
docker-php-ext-enable psr zephir_parser
docker-php-ext-enable psr zephir_parser xdebug

COPY --from=composer /usr/bin/composer /usr/local/bin/composer
# Bash script with helper aliases
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/build-macos-ext/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,8 @@ runs:
shell: bash
run: |
cp ./ext/modules/stub.so "$(php -r 'echo ini_get("extension_dir");')/stub.so"
echo "extension=stub.so" > /usr/local/etc/php/${{ matrix.php }}/conf.d/99-stub.ini
if [ "${{ matrix.ts }}" = "ts" ]; then
echo "extension=stub.so" > /usr/local/etc/php/${{ matrix.php }}-zts/conf.d/99-stub.ini
else
echo "extension=stub.so" > /usr/local/etc/php/${{ matrix.php }}/conf.d/99-stub.ini
fi
3 changes: 1 addition & 2 deletions .github/workflows/build-win-ext/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ runs:
using: 'composite'
steps:
- name: Setup Downloads Cache
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: ${{ env.CACHE_DIR }}
key: ${{ runner.os }}-downloads-${{ hashFiles('**/.github/workflows/build-win-ext/actions.yml') }}
Expand All @@ -46,7 +46,6 @@ runs:
shell: powershell
run: |
Write-Output "::group::Install dependencies"
mkdir ${{ env.CACHE_DIR }}\Choco
choco install --no-progress -y --cache-location=${{ env.CACHE_DIR }}\Choco re2c
Write-Output "::endgroup::"
Expand Down
116 changes: 80 additions & 36 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ on:

env:
RE2C_VERSION: 2.2
ZEPHIR_PARSER_VERSION: 1.5.3
ZEPHIR_PARSER_VERSION: 1.6.1
PSR_VERSION: 1.2.0
CACHE_DIR: .cache

Expand All @@ -26,17 +26,16 @@ jobs:
name: Static Code Analysis
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 1

- name: Setup PHP
uses: shivammathur/setup-php@v2
env:
PHP_CS_FIXER_VERSION: 3.2.0
PHP_CS_FIXER_VERSION: 3.37.0
with:
php-version: '7.4'
php-version: '8.0'
coverage: none
tools: php-cs-fixer:${{ env.PHP_CS_FIXER_VERSION }}, phpcs

Expand All @@ -45,10 +44,11 @@ jobs:
phpcs --version
phpcs --runtime-set ignore_warnings_on_exit true
- name: Run PHP CS Fixer
if: always()
run: |
php-cs-fixer fix --diff --dry-run -v --using-cache=no
# Disabling for now until I figure out the rules
# - name: Run PHP CS Fixer
# if: always()
# run: |
# php-cs-fixer fix --diff --dry-run -v --using-cache=no

- name: Run Shell Check
if: always()
Expand All @@ -61,7 +61,7 @@ jobs:
strategy:
fail-fast: false
matrix:
php: [ '7.4', '8.0' , '8.1', '8.2' ]
php: [ '8.0', '8.1', '8.2', '8.3' ]
ts: [ 'ts', 'nts' ]
arch: [ 'x64' ]

Expand All @@ -77,23 +77,21 @@ jobs:
# macOS
- { name: macos-clang, os: macos-12, compiler: clang }
# Windows
- { php: '7.4', ts: 'ts', arch: 'x64', name: 'windows2019-vc15', os: 'windows-2019', compiler: 'vc15' }
- { php: '7.4', ts: 'nts', arch: 'x64', name: 'windows2019-vc15', os: 'windows-2019', compiler: 'vc15' }
- { php: '8.0', ts: 'ts', arch: 'x64', name: 'windows2019-vs16', os: 'windows-2019', compiler: 'vs16' }
- { php: '8.0', ts: 'nts', arch: 'x64', name: 'windows2019-vs16', os: 'windows-2019', compiler: 'vs16' }
- { php: '8.1', ts: 'ts', arch: 'x64', name: 'windows2019-vs16', os: 'windows-2019', compiler: 'vs16' }
- { php: '8.1', ts: 'nts', arch: 'x64', name: 'windows2019-vs16', os: 'windows-2019', compiler: 'vs16' }
# Disabled due PSR extension wasn't complied for 8.2
# Disabled due PSR extension wasn't complied for >=8.2
#- { php: '8.2', ts: 'ts', arch: 'x64', name: 'windows2019-vs16', os: 'windows-2019', compiler: 'vs16' }
#- { php: '8.2', ts: 'nts', arch: 'x64', name: 'windows2019-vs16', os: 'windows-2019', compiler: 'vs16' }

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 5

- name: Install PHP ${{ matrix.php }}
uses: shivammathur/setup-php@develop
uses: shivammathur/setup-php@v2
with:
php-version: '${{ matrix.php }}'
extensions: mbstring, fileinfo, gmp, sqlite, pdo_sqlite, psr-${{ env.PSR_VERSION }}, zip, mysqli, zephir_parser-${{ env.ZEPHIR_PARSER_VERSION }}
Expand All @@ -115,22 +113,8 @@ jobs:
phpts: ${{ matrix.ts }}
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}

# - name: Get composer cache directory
# id: composer-cache
# run: echo "::set-output name=dir::$(composer config cache-files-dir)"

# - name: Set Up Composer Cache
# uses: actions/cache@v2
# with:
# path: ${{ steps.composer-cache.outputs.dir }}
# key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
# restore-keys: ${{ runner.os }}-composer-

- name: Install Project Dependencies
run: |
echo "::group::Install composer dependencies"
composer install --prefer-dist --no-interaction --no-ansi --no-progress
echo "::endgroup::"
run: composer install --prefer-dist --no-interaction --no-ansi --no-progress

- name: Fast Commands Test
run: php zephir --help
Expand Down Expand Up @@ -177,31 +161,91 @@ jobs:
shell: pwsh
run: |
php vendor/bin/phpunit -c phpunit.ext.xml
env:
XDEBUG_MODE: coverage

- name: Unit Tests (Zephir)
if: always()
run: php vendor/bin/phpunit --testsuite Zephir
run: php vendor/bin/phpunit --testsuite Zephir --coverage-php ./tests/output/clover.xml
env:
XDEBUG_MODE: coverage

- name: "Upload coverage file artifact"
uses: "actions/upload-artifact@v3"
with:
name: "unit-${{ matrix.php }}-${{ matrix.ts }}-${{ matrix.name }}.coverage"
path: "tests/output/clover.xml"

- name: Black-box Testing
if: always() && runner.os != 'Windows'
shell: bash
working-directory: tests/sharness
run: |
make -j$(getconf _NPROCESSORS_ONLN)
- name: Upload Code Coverage Report
uses: codecov/codecov-action@v2
upload-coverage:
permissions:
contents: read

name: "Upload coverage"
runs-on: "ubuntu-22.04"
needs:
- "build-and-test"

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 2

# - name: 'Qodana Scan'
# uses: JetBrains/[email protected]
# env:
# QODANA_TOKEN: ${{ secrets.QODANA_TOKEN }}
# with:
# args: --baseline,./qodana.sarif.json

# - name: 'Qodana Scan'
# run: |
# docker run \
# -v $(pwd):/data/project/ \
# -v $(pwd):/data/base/ \
# -e QODANA_TOKEN="${{ secrets.CODECOV_TOKEN }}" \
# jetbrains/qodana-php \
# --baseline /data/base/qodana.sarif.json

- name: "Create download folder"
run: |
mkdir -p reports
- name: "Download coverage files"
uses: "actions/[email protected]"
with:
path: "reports"

- name: "Display structure of downloaded files"
run: ls -R
working-directory: reports

- name: "Upload to Codecov"
uses: "codecov/codecov-action@v3"
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./tests/output/clover.xml
flags: unittests,${{ runner.os }},php-${{ matrix.php }}
directory: reports
fail_ci_if_error: true
verbose: true
name: codecov-umbrella

- name: "Upload to Qodana"
run: |
docker run \
-v $(pwd):/data/project/ \
-v ./reports/:/data/coverage \
-e QODANA_TOKEN="${{ secrets.QODANA_TOKEN }}" \
jetbrains/qodana-php
- name: Upload build artifacts after Failure
if: failure()
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: debug-PHP-${{ matrix.php }}-${{ matrix.ts }}-${{ matrix.name }}-${{ matrix.arch }}
path: |
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ jobs:
BOX_VERSION: 4.2.0

steps:
- name: Checkout Code
uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 5

Expand All @@ -32,7 +31,7 @@ jobs:
run: echo ::set-output name=dir::$(composer config cache-files-dir)

- name: Setup Composer Cache
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
Expand Down
Loading

0 comments on commit 1c4d380

Please sign in to comment.