summaryrefslogtreecommitdiff
path: root/.github
diff options
context:
space:
mode:
authorGreg Roach <fisharebest@webtrees.net>2019-11-27 15:29:50 +0000
committerGreg Roach <fisharebest@webtrees.net>2019-12-03 21:53:34 +0000
commit9b152ff9230017d2c03aa1bf603a98b18250446d (patch)
treefc49cb5d8aef0d23c6fd711c44b48515ef42865c /.github
parentfacade402cb57d53631f2fb96d98b1a0b2ba9815 (diff)
downloadwebtrees-9b152ff9230017d2c03aa1bf603a98b18250446d.tar.gz
webtrees-9b152ff9230017d2c03aa1bf603a98b18250446d.tar.bz2
webtrees-9b152ff9230017d2c03aa1bf603a98b18250446d.zip
Github actions
Diffstat (limited to '.github')
-rw-r--r--.github/workflows/phpcs.yaml24
-rw-r--r--.github/workflows/phpstan.yaml25
-rw-r--r--.github/workflows/phpunit.yaml39
3 files changed, 88 insertions, 0 deletions
diff --git a/.github/workflows/phpcs.yaml b/.github/workflows/phpcs.yaml
new file mode 100644
index 0000000000..c104ef6a86
--- /dev/null
+++ b/.github/workflows/phpcs.yaml
@@ -0,0 +1,24 @@
+name: Code style
+
+on: [push, pull_request]
+
+jobs:
+ run:
+ runs-on: ubuntu-latest
+ name: PHP/PHTML/CSS
+
+ steps:
+ - uses: actions/checkout@v1
+ with:
+ fetch-depth: 1
+
+ - run: composer global require squizlabs/php_codesniffer=* --quiet
+
+ - name: PHP
+ run: ~/.composer/vendor/bin/phpcs --colors --standard=PSR12 --exclude=Generic.Files.LineLength --extensions=php index.php app modules_v4 tests
+
+ - name: Templates
+ run: ~/.composer/vendor/bin/phpcs --colors --standard=PSR12 -n --exclude=Generic.Files.LineLength --extensions=phtml resources/views
+
+ - name: Style sheets
+ run: ~/.composer/vendor/bin/phpcs --colors --extensions=css resources/css
diff --git a/.github/workflows/phpstan.yaml b/.github/workflows/phpstan.yaml
new file mode 100644
index 0000000000..a4053aa8b5
--- /dev/null
+++ b/.github/workflows/phpstan.yaml
@@ -0,0 +1,25 @@
+name: Static analysis
+
+on: [push, pull_request]
+
+jobs:
+ run:
+ runs-on: ubuntu-latest
+ name: phpstan
+
+ steps:
+ - uses: actions/checkout@v1
+ with:
+ fetch-depth: 1
+
+ - uses: shivammathur/setup-php@master
+ with:
+ php-version: 7.4
+ extension-csv: gd,intl,sqlite,zip
+ coverage: disable
+
+ - run: composer global require phpstan/phpstan phpstan/extension-installer phpstan/phpstan-deprecation-rules phpstan/phpstan-strict-rules phpstan/phpstan-phpunit
+
+ - run: composer install --no-progress --no-suggest --ignore-platform-reqs
+
+ - run: ~/.composer/vendor/bin/phpstan analyze --no-progress --level=max app modules_v4 index.php
diff --git a/.github/workflows/phpunit.yaml b/.github/workflows/phpunit.yaml
new file mode 100644
index 0000000000..8dfcaee03d
--- /dev/null
+++ b/.github/workflows/phpunit.yaml
@@ -0,0 +1,39 @@
+name: Unit tests
+
+on: [push, pull_request]
+
+jobs:
+ run:
+ runs-on: ${{ matrix.operating-system }}
+
+ strategy:
+ matrix:
+ operating-system: [ubuntu-latest]
+ php-version: ['7.1', '7.2', '7.3', '7.4']
+
+ name: Testing PHP ${{ matrix.php-version }} on ${{ matrix.operating-system }}
+
+ steps:
+ - uses: shivammathur/setup-php@master
+ with:
+ php-version: ${{ matrix.php-version }}
+ extension-csv: gd,intl,mbstring,pdo_sqlite,sqlite3,zip
+ coverage: pcov
+
+ - uses: actions/checkout@v1
+ with:
+ fetch-depth: 1
+
+ - run: composer validate
+
+ - run: composer install --prefer-dist --no-progress --no-suggest --ignore-platform-reqs
+
+ - run: composer require pcov/clobber
+ - run: vendor/bin/pcov clobber
+
+ - run: vendor/bin/phpunit --coverage-clover=tests/coverage.xml
+
+ - uses: codecov/codecov-action@v1
+ with:
+ token: ${{ secrets.CODECOV_TOKEN }}
+ file: tests/coverage.xml