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
53 changes: 53 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: CI

on:
push:
branches: [main]
pull_request:

permissions:
contents: read

jobs:
tests:
name: Tests (PHP ${{ matrix.php }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php: ['8.2', '8.3', '8.4']
steps:
- uses: actions/checkout@v4
- uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
coverage: none
- name: Validate composer.json and composer.lock
run: composer validate --strict
- name: Lint
run: find CRM settings managed tests square.php -name '*.php' -print0 | xargs -0 -n1 php -l
# PHPUnit is in the committed vendor/. Deprecations, notices and
# warnings fail the run (see tests/phpunit/phpunit.xml.dist).
- name: Unit tests
run: vendor/bin/phpunit --configuration tests/phpunit/phpunit.xml.dist

standards:
name: Coding standard and static analysis
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
coverage: none
tools: phpstan:1.12.32
- name: Coding standard
run: vendor/bin/phpcs --standard=phpcs.xml.dist CRM square.php settings managed tests
# CiviCRM core's classes are needed for analysis only; the release
# tarball includes the vendor/ packages its classes extend.
- name: Fetch CiviCRM 6.16.5
run: curl -sSfL https://download.civicrm.org/civicrm-6.16.5-drupal.tar.gz | tar -xz -C "$RUNNER_TEMP"
- name: Static analysis
env:
CIVICRM_CORE: ${{ runner.temp }}/civicrm
run: phpstan analyse -c phpstan.neon.dist --no-progress --memory-limit=2G
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/tests/phpunit/.phpunit.result.cache*
/tests/phpunit/.phpunit.cache/
/.phpunit.result.cache
Loading
Loading