Skip to content

Commit

Permalink
feat: add github workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
jspekken committed Aug 3, 2024
1 parent 06403b5 commit 9a17aba
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 0 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/phpstan.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: PHPStan

on: [push, pull_request]

jobs:
phpstan:
name: phpstan
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.3'
coverage: none

- name: Install composer dependencies
uses: ramsey/composer-install@v2

- name: Run PHPStan
run: ./vendor/bin/phpstan --error-format=github
38 changes: 38 additions & 0 deletions .github/workflows/phpunit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: phpunit

on: [push, pull_request]

jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
os: [ubuntu-latest]
php: [8.3]
dependency-version: [prefer-lowest, prefer-stable]

name: P${{ matrix.php }} - ${{ matrix.dependency-version }} - ${{ matrix.os }}

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

- name: Cache dependencies
uses: actions/cache@v3
with:
path: ~/.composer/cache/files
key: dependencies-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }}

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick
coverage: none

- name: Install dependencies
run: composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction

- name: Execute tests
run: vendor/bin/phpunit

0 comments on commit 9a17aba

Please sign in to comment.