[CS] Internal variables renamed to match the code style #9
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release | |
on: | |
push: | |
tags: | |
- "v*" | |
paths-ignore: | |
- "**.md" | |
- ".github/**" | |
- "examples/**" | |
- "make/**" | |
env: | |
VALIDATORURL: https://github.com/itplr-kosit/validator/releases/download/v1.5.0/validator-1.5.0-distribution.zip | |
VALIDATORSCENARIOURL: https://github.com/itplr-kosit/validator-configuration-xrechnung/releases/download/release-2023-07-31/validator-configuration-xrechnung_3.0.0_2023-07-31.zip | |
VALIDATORPATH: build/validator | |
VALIDATORZIPFILENAME: validator.zip | |
VALIDATORSCENARIOZIPFILENAME: validator-configuration.zip | |
VALIDATORJARFILENAME: validationtool-1.5.0-standalone.jar | |
VALIDATORSCENARIOFILENAME: scenarios.xml | |
PHPDOCUMENTORURL: https://phpdoc.org/phpDocumentor.phar | |
PHPDOCUMENTORFILENAME: phpDocumentor.phar | |
GH_PAT: ${{ secrets.UPDATEWIKITOKEN }} | |
jobs: | |
build: | |
permissions: write-all | |
runs-on: "ubuntu-24.04" | |
steps: | |
- name: Checkout Sources | |
uses: actions/checkout@v4 | |
- name: Setup PHP with PECL extension | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: "8.4" | |
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, bcmath, intl, gd, exif, iconv, imagick, json, xdebug | |
coverage: xdebug | |
- name: Set up JDK 11 | |
uses: actions/setup-java@v4 | |
with: | |
java-version: "11" | |
distribution: "adopt" | |
- name: Get Composer Cache Directory | |
id: composer-cache | |
run: | | |
echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT | |
- uses: actions/cache@v4 | |
with: | |
path: ${{ steps.composer-cache.outputs.dir }} | |
key: ${{ runner.os }}-8.4-composer-${{ hashFiles('**/composer.lock') }} | |
restore-keys: | | |
${{ runner.os }}-8.4-composer- | |
- name: Install composer dependencies | |
run: | | |
composer config -g github-oauth.github.com ${{ secrets.GITHUB_TOKEN }} | |
composer install | |
- name: Prepare Directories | |
run: | | |
mkdir build/builddoc | |
mkdir build/doc | |
mkdir build/coverage | |
mkdir build/coverage-html | |
mkdir build/logs | |
mkdir build/pdepend | |
mkdir build/dist | |
mkdir build/phpdoc | |
- name: Run Lint | |
run: | | |
for afile in $(find . -type f -name '*.php' -path './src*/*' -print); do | |
php -l $afile | |
done | |
for afile in $(find . -type f -name '*.php' -path './tests*/*' -print); do | |
php -l $afile | |
done | |
- name: Run PHPLOC | |
continue-on-error: true | |
run: | | |
vendor/bin/phploc --count-tests --log-csv build/logs/phploc.csv --log-xml build/logs/phploc.xml src tests | |
- name: Run PDEPEND | |
continue-on-error: true | |
run: | | |
vendor/bin/pdepend --jdepend-xml=build/logs/jdepend.xml --jdepend-chart=build/pdepend/dependencies.svg --overview-pyramid=build/pdepend/overview-pyramid.svg src | |
- name: Run PHPMD | |
continue-on-error: true | |
run: | | |
vendor/bin/phpmd src xml build/phpmd.xml --reportfile build/logs/pmd.xml --exclude src/entities/ | |
vendor/bin/phpmd src github build/phpmd.xml --exclude src/entities/ | |
- name: Run PHPCS | |
continue-on-error: true | |
run: | | |
vendor/bin/phpcs --report=checkstyle --report-file=build/logs/checkstyle.xml --standard=build/phpcsrules.xml --extensions=php --ignore=autoload.php src tests | |
- name: Run PHPSTAN | |
continue-on-error: true | |
run: | | |
vendor/bin/phpstan analyze -c build/phpstan.neon --autoload-file=vendor/autoload.php --no-interaction --no-progress --error-format=checkstyle > build/logs/checkstyle_phpstan.xml | |
- name: Run PHPCPD | |
continue-on-error: true | |
run: | | |
vendor/bin/phpcpd --log-pmd build/logs/pmd-cpd.xml --exclude src/entities/ src | |
- name: Run Tests (PHPUnit) | |
run: | | |
vendor/bin/phpunit --stop-on-failure --configuration build/phpunit.xml | |
env: | |
XDEBUG_MODE: coverage | |
- name: Run Tests (Schematron) | |
run: | | |
set -e | |
rm -rf $VALIDATORPATH | |
mkdir $VALIDATORPATH | |
wget $VALIDATORURL -O $VALIDATORPATH/$VALIDATORZIPFILENAME | |
wget $VALIDATORSCENARIOURL -O $VALIDATORPATH/$VALIDATORSCENARIOZIPFILENAME | |
unzip $VALIDATORPATH/$VALIDATORZIPFILENAME -d $VALIDATORPATH | |
unzip $VALIDATORPATH/$VALIDATORSCENARIOZIPFILENAME -d $VALIDATORPATH | |
rm -f examples/factur-x.xml | |
php -f examples/XRechnung3SimpleQuick.php | |
java -jar $VALIDATORPATH/$VALIDATORJARFILENAME -r $VALIDATORPATH -s $VALIDATORPATH/$VALIDATORSCENARIOFILENAME examples/factur-x.xml | |
rm -f examples/factur-x.xml | |
php -f examples/En16931SimpleQuick.php | |
java -jar $VALIDATORPATH/$VALIDATORJARFILENAME -r $VALIDATORPATH -s $VALIDATORPATH/$VALIDATORSCENARIOFILENAME examples/factur-x.xml | |
rm -rf build/validator | |
- name: Documentation | |
continue-on-error: true | |
run: | | |
wget $PHPDOCUMENTORURL -O $PHPDOCUMENTORFILENAME | |
chmod +x $PHPDOCUMENTORFILENAME | |
cd build | |
php ../$PHPDOCUMENTORFILENAME | |
cd .. | |
rm -f $PHPDOCUMENTORFILENAME | |
- name: Deploy | |
continue-on-error: true | |
run: | | |
zip -r build/dist/doc.zip build/doc | |
- name: Publish Unit Test Results | |
uses: EnricoMi/publish-unit-test-result-action@v2 | |
with: | |
files: "build/logs/junit.xml" | |
- name: Publish Build Logs | |
uses: actions/upload-artifact@v4 | |
with: | |
name: Build log artifacts for ubuntu-24.04 PHP 8.4 (Release) | |
path: build/logs | |
- name: Update Wiki | |
continue-on-error: true | |
run: | | |
php -f make/genmethoddocs.php | |
git clone https://$GH_PAT@github.com/horstoeko/zugferd.wiki.git wiki | |
mv make/*.md wiki | |
cd wiki | |
git config user.name "HorstOeko" | |
git config user.email "horstoeko@erling.com.de" | |
git add -A | |
git commit -m "Automatische Aktualisierung des Wikis" | |
git push | |
- name: Make Release | |
uses: "marvinpinto/action-automatic-releases@latest" | |
with: | |
repo_token: "${{ secrets.GITHUB_TOKEN }}" | |
prerelease: false | |
files: | | |
build/dist/doc.zip |