Skip to content

Commit

Permalink
CI
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexSkrypnyk committed Apr 11, 2024
1 parent f69d946 commit 333b0e5
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
9 changes: 3 additions & 6 deletions .github/workflows/test-php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,26 +21,23 @@ jobs:
- name: Checkout code
uses: actions/checkout@v4

- name: Cache Composer dependencies
uses: actions/cache@v4
with:
path: /tmp/composer-cache
key: ${{ runner.os }}-${{ hashFiles('**/composer.lock') }}

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}

- name: Install dependencies
run: composer install
working-directory: sandbox/scaffold

- name: Check coding standards
run: composer lint
working-directory: sandbox/scaffold
continue-on-error: ${{ vars.CI_LINT_IGNORE_FAILURE == '1' }}

- name: Run tests
run: XDEBUG_MODE=coverage composer test
working-directory: sandbox/scaffold
continue-on-error: ${{ vars.CI_TEST_IGNORE_FAILURE == '1' }}

- name: Upload coverage report as an artifact
Expand Down
13 changes: 12 additions & 1 deletion scaffold/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,17 @@
],
"post-root-package-install": [
"DrevOps\\composer\\ScaffoldGeneralizer::generalizeAndRemoveItselfAfterProjectCreate"
]
],
"lint": [
"cp php-script php-script.php && phpcs && rm php-script.php",
"phpmd --exclude vendor,vendor-bin,node_modules . text phpmd.xml",
"phpstan",
"rector --clear-cache --dry-run"
],
"lint-fix": [
"rector --clear-cache",
"cp php-script php-script.php && phpcbf && rm php-script.php"
],
"test": "if [ \"${XDEBUG_MODE}\" = 'coverage' ]; then phpunit; else phpunit --no-coverage; fi"
}
}

0 comments on commit 333b0e5

Please sign in to comment.