Skip to content

Commit

Permalink
Add php unit and phpcs to workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
rubenvdlinde committed Mar 21, 2023
1 parent 6206592 commit 2dbb0c4
Show file tree
Hide file tree
Showing 6 changed files with 115 additions and 0 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/autocomment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#bassed on https://github.com/marketplace/actions/auto-comment
name: Auto Comment
on: [issues, pull_request]
jobs:
run:
runs-on: ubuntu-latest
steps:
- uses: wow-actions/auto-comment@v1
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
issuesOpened: |
👋 @{{ author }}
Thank you for raising an issue. We will investigate the matter and get back to you as soon as possible.
Please make sure you have given us as much context as possible.
pullRequestOpenedReactions: 'hooray, +1'
pullRequestOpenedComment: |
👋 @{{ author }}
Thank you for raising your pull request.
Please make sure you have followed our contributing guidelines. We will review it as soon as possible. In the meanwhile make sure your PR checks the following boxes
- [ ] Is based on an issue
- [ ] Has been locally tested
- [ ] Has been tested with the admin UI
- [ ] Has been discussed with the development team in an open channel
25 changes: 25 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Docs

on: [push]

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: php-actions/composer@v6
with:
php_version: "7.4"
php_extensions: redis exif
version: 2.x
command: require clean/phpdoc-md
- name: Build the docs
run: vendor/bin/phpdoc-md
- name: Git commit
run: |
git config user.name "GitHub Actions"
git config user.email ""
git add docs/classes
git commit -m "Update phpdoc" || echo "No changes to commit"
git push
18 changes: 18 additions & 0 deletions .github/workflows/phpcbf.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: phpcbf

on: [push]

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
tools: cs2pr, phpcbf

- name: Run phpcbf
run: phpcbf -q --report=checkstyle src | cs2pr
18 changes: 18 additions & 0 deletions .github/workflows/phpcs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: phpcs

on: [push]

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
tools: cs2pr, phpcs

- name: Run phpcs
run: phpcs -q --report=checkstyle src | cs2pr
21 changes: 21 additions & 0 deletions .github/workflows/phpunit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: phpcs

on: [push]

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
tools: cs2pr, phpcs

- name: Install PHPUnit
run: simple-phpunit install

- name: Run tests
run: simple-phpunit --coverage-text
10 changes: 10 additions & 0 deletions .phpdoc-md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php
return (object)[
'rootNamespace' => 'CommonGateway\CoreBundle',
'destDirectory' => 'docs/classes',
'format' => 'github',
'classes' => [
'\CommonGateway\CoreBundle\Service\InstallationService',
'\CommonGateway\CoreBundle\Service\PetStoreService'
],
];

0 comments on commit 2dbb0c4

Please sign in to comment.