Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
93 changes: 93 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
name: "PHQL CI"

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

permissions: {}

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}

jobs:
tests:
name: PHP ${{ matrix.php }}
runs-on: ubuntu-latest

permissions:
contents: read

strategy:
fail-fast: false
matrix:
php:
- '8.1'
- '8.2'
- '8.3'
- '8.4'
- '8.5'

steps:
- uses: actions/checkout@v6

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: mbstring
coverage: none
tools: composer:v2
env:
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Validate composer.json
run: composer validate --no-check-all --no-check-publish

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

- name: Run tests
run: composer test

coverage:
name: Code Coverage
runs-on: ubuntu-latest

permissions:
contents: read

steps:
- uses: actions/checkout@v6

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.3'
extensions: mbstring
coverage: xdebug
tools: composer:v2
env:
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}

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

- name: Run tests with coverage
run: vendor/bin/phpunit --coverage-clover coverage.xml

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
with:
file: ./coverage.xml
fail_ci_if_error: false
84 changes: 0 additions & 84 deletions .github/workflows/tests.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ composer.phar
phql.log

# PHPUnit
.phpunit.cache/
.phpunit.result.cache/
coverage/
coverage.xml
11 changes: 8 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@
"php": ">=8.1",
"ext-mbstring": "*"
},
"suggest": {
"phalcon/phalcon": "The Phalcon framework this module integrates with"
},
"require-dev": {
"phpstan/phpstan": "^2.0",
"phpunit/phpunit": "^10.5"
},
"autoload": {
Expand All @@ -25,11 +29,12 @@
},
"autoload-dev": {
"psr-4": {
"Phalcon\\Phql\\Tests\\": "tests/"
"Phalcon\\Phql\\Tests\\": "tests/",
"Phalcon\\Phql\\Tests\\Unit\\": "tests/unit/"
}
},
"scripts": {
"test": "phpunit",
"test:coverage": "phpunit --coverage-html coverage"
"test": "vendor/bin/phpunit -c phpunit.xml --fail-on-all-issues",
"test-coverage": "vendor/bin/phpunit -c phpunit.xml --coverage-html tests/_output/coverage/"
}
}
Loading
Loading