build(deps-dev): Update degraciamathieu/php-smelly-code-detector requirement from ^1.1 to ^1.1 || ^2.0 in /laravel-sentry-handler #37
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: laravel-sentry-handler-test | |
on: | |
push: | |
branches: [ master ] | |
paths: | |
- 'laravel-sentry-handler/**' | |
pull_request: | |
branches: [ master ] | |
paths: | |
- 'laravel-sentry-handler/**' | |
defaults: | |
run: | |
working-directory: laravel-sentry-handler | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
permissions: | |
pull-requests: write | |
strategy: | |
fail-fast: true | |
matrix: | |
php_version: [ 8.1, 8.2 ] | |
include: | |
- php_version: 8.2 | |
record_coverage: true | |
concurrency: | |
group: laravel-sentry-handler-test-${{ github.workflow }}-${{ github.ref }}-${{ matrix.php_version }} | |
cancel-in-progress: true | |
steps: | |
- name: Checkout project | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 2 | |
- name: Initialize PHP ${{ matrix.php_version }} | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php_version }} | |
coverage: pcov | |
- name: Configure Composer cache | |
id: composer-cache | |
uses: actions/cache@v3 | |
with: | |
path: laravel-sentry-handler/vendor | |
key: ${{ runner.os }}-node-php_${{ matrix.php_version }}-${{ hashFiles('**/composer.json') }} | |
restore-keys: | | |
${{ runner.os }}-node-php_${{ matrix.php_version }}- | |
- name: Validate Composer.json | |
run: composer validate --strict | |
- name: Composer install | |
if: steps.composer-cache.outputs.cache-hit != 'true' | |
run: composer install -o --no-interaction --prefer-dist | |
- name: Smelly Code Detector | |
if: github.event_name == 'pull_request' && matrix.record_coverage | |
run: | | |
vendor/bin/smelly-code-detector inspect src | sed -r "s/\x1B\[([0-9]{1,3}(;[0-9]{1,2};?)?)?[mGK]//g" > tmp.txt | |
sed '$d' tmp.txt > tmp2.txt | |
sed '$d' tmp2.txt > tmp.txt | |
sed '2d' tmp.txt > tmp2.txt | |
sed '2d' tmp2.txt > tmp.txt | |
sed '2d' tmp.txt > tmp2.txt | |
sed 's/+/|/g' tmp2.txt > ../.github/workflows/smelly-code-detector.txt | |
- uses: NejcZdovc/comment-pr@v2 | |
if: github.event_name == 'pull_request' && matrix.record_coverage | |
with: | |
file: smelly-code-detector.txt | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Test | |
run: vendor/bin/phpunit | |
- name: Send coverage | |
if: ${{ matrix.record_coverage }} | |
run: bash <(curl -s https://codecov.io/bash) -f coverage/clover.xml -F laravel-sentry-handler | |
env: | |
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} |