Skip to content

Commit

Permalink
Merge pull request #16 from phalcon/develop
Browse files Browse the repository at this point in the history
v2.0.0
  • Loading branch information
niden authored Jan 2, 2023
2 parents 7f87357 + 781ac34 commit e336cbc
Show file tree
Hide file tree
Showing 44 changed files with 2,331 additions and 1,239 deletions.
10 changes: 5 additions & 5 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ A clear and concise description of what you expected to happen.
If applicable, add screenshots to help explain your problem.

**Details**
- Phalcon version
- PHP Version: (`php -v`)
- Operating System:
- Server: Nginx | Apache | Other
- Other related info (Database, table schema):
- Phalcon version
- PHP Version: (`php -v`)
- Operating System:
- Server: Nginx | Apache | Other
- Other related info (Database, table schema):

**Additional context**
Add any other context about the problem here.
3 changes: 1 addition & 2 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@ Hello!

**In raising this pull request, I confirm the following:**

- [ ] I have read and understood the [Contributing Guidelines](https://github.com/phalcon/traits/blob/master/CONTRIBUTING.md)
- [ ] I have read and understood the Contributing Guidelines
- [ ] I have checked that another pull request for this purpose does not exist
- [ ] I wrote some tests for this PR
- [ ] I have updated the relevant CHANGELOG
- [ ] I have created a PR for the [documentation](https://github.com/phalcon/docs) about this change

Small description of change:

Expand Down
139 changes: 0 additions & 139 deletions .github/workflows/build-and-test.yml

This file was deleted.

198 changes: 198 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,198 @@
# This file is part of Phalcon.
#
# (c) Phalcon Team <team@phalcon.io>
#
# For the full copyright and license information, please view
# the LICENSE file that was distributed with this source code.

name: "Phalcon CI"

on:
schedule:
- cron: '0 2 * * *' # Daily at 02:00 runs only on default branch
push:
paths-ignore:
- '**.md'
- '**.txt'
pull_request:
workflow_dispatch:

env:
fail-fast: true

# For tests
LANG: en_US.UTF-8
LANGUAGE: en_US.UTF-8
LC_ALL: en_US.UTF-8

# Windows specific
TOOLS_DIR: 'C:\tools'

# PHP extensions required by Composer
EXTENSIONS: intl, json, mbstring, msgpack

permissions: { }
jobs:
# PHP CodeSniffer inspection
phpcs:
name: "Validate Tests code style"
if: "!contains(github.event.head_commit.message, 'ci skip')"

# needs: [ generate ]

permissions:
contents: read

runs-on: ubuntu-20.04

strategy:
fail-fast: true
matrix:
php:
- '8.0'
- '8.1'
- '8.2'
steps:
- uses: actions/checkout@v3

- name: "Setup PHP"
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: ${{ env.EXTENSIONS }}
ini-values: apc.enable_cli=on, session.save_path=/tmp
tools: pecl, composer:v2
env:
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: "Install development dependencies with Composer"
uses: "ramsey/composer-install@v2"
with:
composer-options: "--prefer-dist"

- name: "PHPCS"
run: |
vendor/bin/phpcs --standard=./phpcs.xml
unit-tests:
needs: phpcs

permissions:
contents: read # to fetch code (actions/checkout)

name: Unit tests / PHP-${{ matrix.php }}-${{ matrix.ts }}-${{ matrix.name }}
runs-on: ${{ matrix.os }}

strategy:
matrix:
php:
- '8.0'
- '8.1'
- '8.2'
ts:
- 'nts'
- 'ts'
name:
- ubuntu-gcc
- macos-clang
# matrix names should be in next format:
# {php}-{ts}-{os.name}-{compiler}-{arch}
include:
# Linux
- { name: ubuntu-gcc, os: ubuntu-20.04, compiler: gcc }
# macOS
- { name: macos-clang, os: macos-11, compiler: clang }
# Windows
- { 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' }

steps:
- uses: actions/checkout@v3
- name: "Setup platform specific environment"
shell: pwsh
run: |
git config --global core.autocrlf false
$SessionSavePath = if ("${{ runner.os }}" -eq "Windows") { 'C:\temp' } else { '/tmp' }
Write-Output "SESSION_SAVE_PATH=$SessionSavePath" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
- name: "Setup PHP"
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: ${{ env.EXTENSIONS }}
ini-values: apc.enable_cli=on, session.save_path=${{ env.SESSION_SAVE_PATH }}
tools: pecl, composer:v2
coverage: pcov
env:
PHPTS: ${{ matrix.ts }}
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: "Validate composer"
run: composer validate --no-check-all --no-check-publish

- name: "Install development dependencies with Composer"
uses: "ramsey/composer-install@v2"
with:
composer-options: "--prefer-dist"

- name: "Setup Tests"
shell: bash
run: |
cp config/.env.example .env
vendor/bin/codecept build
- name: "Run Unit Tests"
if: always()
run: |
vendor/bin/codecept run --coverage-xml=coverage.xml --ext DotReporter unit
- name: "Upload coverage file artifact"
uses: "actions/upload-artifact@v3"
with:
name: "unit-${{ matrix.php }}-${{ matrix.ts }}-${{ matrix.name }}.coverage"
path: "tests/_output/coverage.xml"

upload-coverage:
permissions:
contents: read

name: "Upload coverage to Codecov/Codacy"
runs-on: "ubuntu-22.04"
needs:
- "unit-tests"

steps:
- name: "Checkout"
uses: "actions/checkout@v3"
with:
fetch-depth: 2

- name: "Display structure of downloaded files"
run: |
mkdir -p reports
- name: "Download coverage files"
uses: "actions/download-artifact@v3"
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 }}
directory: reports
fail_ci_if_error: true
verbose: true

- name: "Upload to Codacy"
uses: codacy/codacy-coverage-reporter-action@v1
with:
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
coverage-reports: reports/unit-8.0-ts-ubuntu-gcc.coverage/coverage.xml, reports/unit-8.1-ts-ubuntu-gcc.coverage/coverage.xml, reports/unit-8.2-ts-ubuntu-gcc.coverage/coverage.xml
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## 2.0.0 (2023-01-01)

### Feat

- **php/initrait**: added ini trait and relevant tests

## 1.3.0 (2022-10-04)

### Feat
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
## Phalcon Traits

[![Phalcon CI](https://github.com/phalcon/traits/actions/workflows/build-and-test.yml/badge.svg?branch=1.x)](https://github.com/niden/traits/actions/workflows/build-and-test.yml)
[![Phalcon CI](https://github.com/phalcon/traits/actions/workflows/main.yml/badge.svg?branch=1.x)](https://github.com/phalcon/traits/actions/workflows/main.yml)
[![PDS Skeleton](https://img.shields.io/badge/pds-skeleton-blue.svg?style=flat-square)](https://github.com/php-pds/skeleton)
[![codecov](https://codecov.io/gh/phalcon/traits/branch/1.x/graph/badge.svg?token=I4bgs0E168)](https://codecov.io/gh/phalcon/traits)
[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)
[![Codacy Badge](https://app.codacy.com/project/badge/Grade/049cb6c1c06342579ebffb8e78ab9dd1)](https://www.codacy.com/gh/phalcon/traits/dashboard?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=phalcon/traits&amp;utm_campaign=Badge_Grade)

This package contains traits with methods that are used for Phalcon v6 onward.

Expand Down
Loading

0 comments on commit e336cbc

Please sign in to comment.