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
34 changes: 34 additions & 0 deletions .github/workflows/static-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Test
permissions:
contents: write
on:
pull_request:
push:
branches:
- master

jobs:
phpstan:
name: Static Analysis with PHPStan and php-cs-fixer
runs-on: ubuntu-20.04
strategy:
fail-fast: false

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Install PHP
uses: shivammathur/setup-php@v2
with:
coverage: pcov
ini-values: zend.assertions=1, assert.exception=1
php-version: 8.1
extensions: memcached
tools: cs2pr

- name: Install dependencies with Composer
uses: ramsey/composer-install@v2

- name: PHPStan Analysis
run: vendor/bin/phpstan analyze
34 changes: 34 additions & 0 deletions .github/workflows/style.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Test
permissions:
contents: write
on:
pull_request:
push:
branches:
- master

jobs:
phpstan:
name: Linting with php-cs-fixer
runs-on: ubuntu-20.04
strategy:
fail-fast: false

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Install PHP
uses: shivammathur/setup-php@v2
with:
coverage: pcov
ini-values: zend.assertions=1, assert.exception=1
php-version: 8.1
extensions: memcached
tools: cs2pr

- name: Install dependencies with Composer
uses: ramsey/composer-install@v2

- name: Run PHP-CS-Fixer
run: ./vendor/bin/php-cs-fixer fix --dry-run --diff --format checkstyle | cs2pr
10 changes: 2 additions & 8 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Install PHP
uses: shivammathur/setup-php@v2
Expand All @@ -64,9 +64,6 @@ jobs:
- name: Install dependencies with Composer
uses: ramsey/composer-install@v2

- name: Run PHP-CS-Fixer
run: ./vendor/bin/php-cs-fixer fix --dry-run --diff --format checkstyle | cs2pr

- name: Create and set permissions on SQLite Database
run: |
touch test.db
Expand All @@ -92,10 +89,7 @@ jobs:

- name: Run PHPUnit
run: |
vendor/bin/phpunit -c phpunit.xml.dist

- name: PHPStan Analysis
run: vendor/bin/phpstan analyze
vendor/bin/phpunit -c phpunit.xml.dist --coverage-clover=coverage.xml

- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# PHP ActiveRecord
[![Test](https://github.com/php-activerecord/activerecord/actions/workflows/test.yml/badge.svg)](https://github.com/php-activerecord/activerecord/actions/workflows/test.yml)
[![Coverage Status](https://codecov.io/gh/shmax/graphql-php-validation-toolkit/branch/master/graph/badge.svg)](https://codecov.io/gh/shmax/graphql-php-validation-toolkit/branch/master)
[![codecov](https://codecov.io/github/php-activerecord/activerecord/graph/badge.svg?token=IJBKNRHVOC)](https://codecov.io/github/php-activerecord/activerecord)

**We encourage pull requests, and issues will be dealt with thoroughly and in a timely manner.**

Expand Down