Skip to content

Commit

Permalink
[TASK] Move script definitions from composer.json into Makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
brotkrueml committed Jun 28, 2021
1 parent dd963a5 commit 612f778
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 13 deletions.
4 changes: 4 additions & 0 deletions .editorconfig
Expand Up @@ -48,3 +48,7 @@ indent_size = 2
# .htaccess
[{_.htaccess,.htaccess}]
indent_style = tab

# Makefile
[Makefile]
indent_style = tab
5 changes: 3 additions & 2 deletions .gitattributes
Expand Up @@ -6,7 +6,8 @@
/.gitignore export-ignore
/.php_cs export-ignore
/Build/ export-ignore
/Documentation/ export-ignore
/Tests/ export-ignore
/CHANGELOG.md export-ignore
/Documentation/ export-ignore
/Makefile export-ignore
/README.md export-ignore
/Tests/ export-ignore
9 changes: 3 additions & 6 deletions .github/workflows/ci.yml
Expand Up @@ -36,15 +36,13 @@ jobs:
extension-csv: mbstring
- name: Install composer dependencies
run: |
composer --version
composer require typo3/cms-core=${{ matrix.typo3-versions }}
git checkout composer.json
- name: Run PHP linter
run: |
find . -name \*.php ! -path "./.Build/*" -exec php -l {} \;
- name: Run unit tests
run: |
.Build/bin/phpunit -c Tests/phpunit.xml.dist
make tests
code-coverage:
name: Code Coverage
runs-on: ubuntu-latest
Expand All @@ -59,11 +57,10 @@ jobs:
php-version: 7.4
- name: Install composer dependencies
run: |
composer --version
composer install
- name: Run unit tests
- name: Generate code coverage report
run: |
.Build/bin/phpunit -c Tests/phpunit.xml.dist
make code-coverage
- name: Send code coverage report to coveralls.io
run: .Build/bin/php-coveralls -v
env:
Expand Down
2 changes: 1 addition & 1 deletion Documentation/Maintenance/Index.rst
Expand Up @@ -103,7 +103,7 @@ extension for the TYPO3 Extension Repository (TER) can be done with:

::

composer zip
make zip

This creates/replaces a file :file:`../zip/codehighlight_x.y.z.zip` which is
ready for upload to TER. :file:`x.y.z` holds the recent version number.
22 changes: 22 additions & 0 deletions Makefile
@@ -0,0 +1,22 @@
.PHONY: qa
qa: coding-standards tests

.PHONY: code-coverage
code-coverage: vendor
XDEBUG_MODE=coverage .Build/bin/phpunit -c Tests/phpunit.xml.dist --log-junit .Build/logs/phpunit.xml --coverage-text --coverage-clover .Build/logs/clover.xml

.PHONY: coding-standards
coding-standards: vendor
.Build/bin/php-cs-fixer fix --config=.php_cs --diff

.PHONY: tests
tests: vendor
.Build/bin/phpunit --configuration=Tests/phpunit.xml.dist

vendor: composer.json composer.lock
composer validate
composer install

.PHONY: zip
zip:
grep -Po "(?<='version' => ')([0-9]+\.[0-9]+\.[0-9]+)" ext_emconf.php | xargs -I {version} sh -c 'mkdir -p ../zip; git archive -v -o "../zip/${PWD##*/}_{version}.zip" v{version}'
4 changes: 0 additions & 4 deletions composer.json
Expand Up @@ -55,9 +55,5 @@
"app-dir": ".Build",
"web-dir": ".Build/web"
}
},
"scripts": {
"zip": "grep -Po \"(?<='version' => ')([0-9]+\\.[0-9]+\\.[0-9]+)\" ext_emconf.php | xargs -I {version} sh -c 'mkdir -p ../zip; git archive -v -o \"../zip/${PWD##*/}_{version}.zip\" v{version}'",
"fix-cs": ".Build/bin/php-cs-fixer fix"
}
}

0 comments on commit 612f778

Please sign in to comment.