Skip to content

Commit

Permalink
change: Using syntro testsuite and updated dependencies (#26)
Browse files Browse the repository at this point in the history
* change: Using syntro testsuite and updated dependencies

* composer

* no displaylogic
  • Loading branch information
mleutenegger authored Feb 3, 2024
1 parent f2b5db9 commit 1c113ea
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 105 deletions.
113 changes: 10 additions & 103 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,107 +26,14 @@ on:
branches:
- develop
- master
env:
DB: MYSQL
PDO: 1
SS_ENVIRONMENT_TYPE: "dev"
RECIPE_CMS_VERSION: '4.10'
jobs:
phpunit:
name: 🧩 PHPUnit
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php:
- 7.4
container: brettt89/silverstripe-web:${{ matrix.php }}-apache
services:
database:
image: mysql:5.7
ports:
- 3306:3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
env:
MYSQL_ALLOW_EMPTY_PASSWORD: 'yes'
env:
SS_DEFAULT_ADMIN_USERNAME: admin
SS_DEFAULT_ADMIN_PASSWORD: admin
SS_DATABASE_SERVER: database
SS_DATABASE_NAME: ss_default_${{ matrix.php }}
SS_DATABASE_USERNAME: root
SS_DATABASE_PASSWORD: ''
SS_ENVIRONMENT_TYPE: dev
steps:
- name: Install Composer
run: |
curl \
-sS https://getcomposer.org/installer \
| php && \
mv -f composer.phar /usr/local/bin/composer
- name: Install git
run: |
apt update && apt-get install git -yqq
- name: Checkout code
uses: actions/checkout@v2
- name: setup ssh agent
uses: webfactory/ssh-agent@v0.5.4
with:
ssh-private-key: |
${{ secrets.DEPLOYKEY_ELEMENTAL_BOOTSTRAP_BLOCKS }}
- name: install dependencies
run: |
composer require --no-update silverstripe/recipe-cms:$RECIPE_CMS_VERSION &&\
composer install --prefer-dist --no-interaction --no-progress --no-suggest --optimize-autoloader --verbose --profile
- name: run phpunit
run: vendor/bin/phpunit -c "phpunit.xml" tests/
# - name: generate coverage
# run: phpdbg -qrr vendor/bin/phpunit -dmemory_limit=512M --coverage-clover=coverage.xml tests/
# if: ${{ matrix.php == '7.4' }}
# - name: submit coverage
# uses: codecov/codecov-action@v2
# with:
# token: ${{ secrets.CODECOV_TOKEN }}
# files: ./coverage.xml
# if: ${{ matrix.php == '7.4' }}
phpstan:
name: 🔺 PHPStan
runs-on: ubuntu-latest
container: brettt89/silverstripe-web:7.4-apache
steps:
- name: Install Composer
run: |
curl \
-sS https://getcomposer.org/installer \
| php && \
mv -f composer.phar /usr/local/bin/composer
- name: Install git
run: |
apt update && apt-get install git -yqq
- name: Checkout code
uses: actions/checkout@v2
- name: setup ssh agent
uses: webfactory/ssh-agent@v0.5.4
with:
ssh-private-key: |
${{ secrets.DEPLOYKEY_ELEMENTAL_BOOTSTRAP_BLOCKS }}
- name: install dependencies
run: |
composer require --no-update silverstripe/recipe-cms:$RECIPE_CMS_VERSION &&\
composer install --prefer-dist --no-interaction --no-progress --no-suggest --optimize-autoloader --verbose --profile
- name: run phpstan
run: vendor/bin/phpstan analyse src/ -c "phpstan.neon" -a vendor/syntro/silverstripe-phpstan/bootstrap.php --level 4
phpcs:
name: 🔮 PHPcs
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: lint source
uses: chindit/actions-phpcs@master
with:
dir: src/
- name: lint tests
uses: chindit/actions-phpcs@master
with:
dir: tests/
silverstripe-module:
name: 🧰 Silverstripe Module Testsuite
uses: syntro-opensource/workflows/.github/workflows/silverstripe-module.yml@4
with:
phpunit: true
# phpunit_config_file:
phpstan: true
# phpstan_config:
# phpstan_bootstrap:
phpcs: true
12 changes: 10 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"require-dev": {
"squizlabs/php_codesniffer": "^3.0",
"syntro/silverstripe-phpstan": "^1",
"phpunit/phpunit": "^5.7"
"phpunit/phpunit": "^9.4"
},
"extra": {
"expose": [
Expand All @@ -51,5 +51,13 @@
"phpunit-flush": "../../bin/phpunit . '' flush=1"
},
"minimum-stability": "dev",
"prefer-stable": true
"prefer-stable": true,
"config": {
"process-timeout": 600,
"allow-plugins": {
"composer/installers": true,
"silverstripe/recipe-plugin": true,
"silverstripe/vendor-plugin": true
}
}
}

0 comments on commit 1c113ea

Please sign in to comment.