Skip to content

Commit

Permalink
Merge pull request #23 from RoussKS/update-github-actions
Browse files Browse the repository at this point in the history
Update Github Actions
  • Loading branch information
aashwin-rvvup authored Apr 25, 2024
2 parents b4c6977 + bef616f commit 95073ce
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 19 deletions.
40 changes: 35 additions & 5 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,32 +11,62 @@ jobs:
php-stan:
name: PHP Stan
runs-on: ubuntu-latest
strategy:
matrix:
php: [ 7.3, 7.4, 8.1, 8.2 ]
steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 7.4
php-version: "${{ matrix.php }}"
tools: composer, phpstan

- name: Get composer cache directory
id: composer-cache
run: 'echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT'

- name: Cache dependencies
uses: actions/cache@v4
with:
path: "${{ steps.composer-cache.outputs.dir }}"
key: "${{ runner.os }}-php-${{ matrix.php}}-composer-${{ hashFiles('**/composer.json') }}"
restore-keys: "${{ runner.os }}-php-${{ matrix.php}}-composer-"

- name: Install dependencies
run: composer install --no-ansi --no-interaction --no-progress --no-scripts

- name: Run PHPStan
run: ./vendor/bin/phpstan
run: phpstan

php-unit:
name: PHP Unit
runs-on: ubuntu-latest
strategy:
matrix:
php: [ 7.3, 7.4, 8.1, 8.2 ]
steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4

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

- name: Get composer cache directory
id: composer-cache
run: 'echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT'

- name: Cache dependencies
uses: actions/cache@v4
with:
path: "${{ steps.composer-cache.outputs.dir }}"
key: "${{ runner.os }}-php-${{ matrix.php}}-composer-${{ hashFiles('**/composer.json') }}"
restore-keys: "${{ runner.os }}-php-${{ matrix.php}}-composer-"

- name: Install dependencies
run: composer install --no-ansi --no-interaction --no-progress --no-scripts
Expand Down
28 changes: 14 additions & 14 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,18 @@
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false">
<coverage processUncoveredFiles="true">
<include>
<directory suffix=".php">./src</directory>
</include>
<report>
<clover outputFile="clover.xml"/>
</report>
</coverage>
<testsuites>
<testsuite name="Unit">
<directory suffix="Test.php">./tests/Unit</directory>
</testsuite>
</testsuites>
<logging/>
<coverage processUncoveredFiles="true">
<include>
<directory suffix=".php">./src</directory>
</include>
<report>
<clover outputFile="clover.xml"/>
</report>
</coverage>
<testsuites>
<testsuite name="Unit">
<directory suffix="Test.php">./tests/Unit</directory>
</testsuite>
</testsuites>
<logging/>
</phpunit>

0 comments on commit 95073ce

Please sign in to comment.