Skip to content

Commit

Permalink
fix github workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
lhapaipai committed Nov 2, 2023
1 parent 8353b6a commit 66336cb
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 5,495 deletions.
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/tests export-ignore
/phpunit.xml.dist export-ignore
.github export-ignore
.gitattributes export-ignore
.gitignore export-ignore
Expand Down
22 changes: 10 additions & 12 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,29 +22,27 @@ jobs:
- name: Lint PHP
run: find -L . -path ./vendor -prune -o -type f -name '*.php' -print0 | xargs -0 -n 1 -P $(nproc) php -l

- name: Declare variables
if: matrix.php-versions == 8.1
id: vars
run: |
echo "::set-output name=composer_cache_dir::$(composer config cache-files-dir)"
- name: Get composer cache directory
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT

- name: Cache composer
if: matrix.php-versions == 8.1
uses: actions/cache@v3
with:
path: ${{ steps.vars.outputs.composer_cache_dir }}
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-
restore-keys: ${{ runner.os }}-composer-

- name: Install dependencies
if: matrix.php-versions == 8.1
run: composer install --no-interaction --no-ansi

- name: Validate coding standards
if: matrix.php-versions == 8.1
if: matrix.php-versions == 8.2
run: php vendor/bin/php-cs-fixer fix --config=.php-cs-fixer.dist.php --verbose --diff --dry-run --stop-on-violation --using-cache=no

- name: Static analysis
if: matrix.php-versions == 8.1
run: php vendor/bin/phpstan analyse --configuration=phpstan.neon --verbose

- name: Tests
if: matrix.php-versions == 8.2
run: php bin/phpunit
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@
/vendor
/.php-cs-fixer.cache
/.phpunit.result.cache
/composer.lock
9 changes: 5 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,12 @@
"symfony/web-link": "^4.4 || ^5.0 || ^6.0 || ^7.0"
},
"scripts": {
"cs-fix": "php8.1 vendor/bin/php-cs-fixer fix --config=.php-cs-fixer.dist.php",
"cs-fix": "php8.2 vendor/bin/php-cs-fixer fix --config=.php-cs-fixer.dist.php",
"ci-check": [
"find -L . -path ./vendor -prune -o -type f -name '*.php' -print0 | xargs -0 -n 1 -P $(nproc) php -l",
"php8.1 vendor/bin/php-cs-fixer fix --config=.php-cs-fixer.dist.php --diff --dry-run --stop-on-violation --using-cache=no",
"php8.1 vendor/bin/phpstan analyse --configuration=phpstan.neon"
"find -L . -path ./vendor -prune -o -type f -name '*.php' -print0 | xargs -0 -n 1 -P $(nproc) php7.4 -l",
"find -L . -path ./vendor -prune -o -type f -name '*.php' -print0 | xargs -0 -n 1 -P $(nproc) php8.2 -l",
"php8.2 vendor/bin/php-cs-fixer fix --config=.php-cs-fixer.dist.php --diff --dry-run --stop-on-violation --using-cache=no",
"php8.2 vendor/bin/phpstan analyse --configuration=phpstan.neon"
]
}
}
Loading

0 comments on commit 66336cb

Please sign in to comment.