Skip to content

Commit

Permalink
fix: allow to use composer bin
Browse files Browse the repository at this point in the history
  • Loading branch information
brokeyourbike committed May 14, 2023
1 parent abd8919 commit d399507
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 29 deletions.
7 changes: 7 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/php
{
"name": "uba-api-client-php",
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
"image": "mcr.microsoft.com/devcontainers/php:0-8.1"
}
20 changes: 5 additions & 15 deletions .github/workflows/static.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,30 +8,20 @@ on:

jobs:
phpstan:
name: PHPStan
runs-on: ubuntu-latest
timeout-minutes: 5
strategy:
matrix:
php-version: [8.1]

steps:
- name: Checkout code
uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Setup PHP
uses: shivammathur/setup-php@v2
- uses: shivammathur/setup-php@v2
with:
php-version: "${{ matrix.php-version }}"
coverage: none
extensions: mbstring
tools: composer

- name: Download dependencies
run: composer update --no-interaction --no-progress

- name: Download PHPStan
run: composer bin phpstan require phpstan/phpstan

- name: Execute PHPStan
run: vendor/bin/phpstan analyze --no-progress
- run: composer update --no-interaction --no-progress
- run: composer bin phpstan require phpstan/phpstan
- run: vendor/bin/phpstan analyze --no-progress
19 changes: 6 additions & 13 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,29 +15,22 @@ jobs:
php-version: [8.1]

steps:
- name: Checkout code
uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Install PHP
uses: shivammathur/setup-php@v2
- uses: shivammathur/setup-php@v2
with:
php-version: "${{ matrix.php-version }}"
coverage: pcov

- name: Install PHP dependencies
run: composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist
- run: composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist
- run: vendor/bin/phpunit --coverage-clover=coverage.xml

- name: Run PHPUnit
run: vendor/bin/phpunit --coverage-clover=coverage.xml

- name: Upload coverage to codecov
uses: codecov/codecov-action@v2
- uses: codecov/codecov-action@v3
continue-on-error: true
with:
files: ./coverage.xml

- name: Upload coverage to codeclimate
uses: paambaati/[email protected]
- uses: paambaati/codeclimate-action@v4
continue-on-error: true
env:
CC_TEST_REPORTER_ID: ${{ secrets.CODECLIMATE_TOKEN }}
Expand Down
7 changes: 6 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,10 @@
"phpunit/phpunit": "^9",
"mockery/mockery": "^1.4"
},
"version": "0.3.1"
"version": "0.3.1",
"config": {
"allow-plugins": {
"bamarni/composer-bin-plugin": true
}
}
}

0 comments on commit d399507

Please sign in to comment.