|
| 1 | +name: Continuous Integration |
| 2 | +on: [push] |
| 3 | + |
| 4 | +jobs: |
| 5 | + linter: |
| 6 | + name: Code Style |
| 7 | + runs-on: ubuntu-latest |
| 8 | + steps: |
| 9 | + - name: Checkout |
| 10 | + uses: actions/checkout@v2 |
| 11 | + - name: Setup PHP |
| 12 | + uses: shivammathur/setup-php@v2 |
| 13 | + with: |
| 14 | + php-version: 8.1 |
| 15 | + coverage: xdebug |
| 16 | + - name: Get Composer Cache Directory |
| 17 | + id: composer-cache |
| 18 | + run: echo "::set-output name=dir::$(composer config cache-files-dir)" |
| 19 | + - name: Cache dependencies |
| 20 | + uses: actions/cache@v2 |
| 21 | + with: |
| 22 | + path: ${{ steps.composer-cache.outputs.dir }} |
| 23 | + key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} |
| 24 | + restore-keys: ${{ runner.os }}-composer- |
| 25 | + - name: Install Dependencies |
| 26 | + run: composer install --no-progress |
| 27 | + - name: Run php-cs-fixture |
| 28 | + run: vendor/bin/php-cs-fixer fix -v --dry-run |
| 29 | + |
| 30 | + phpstan: |
| 31 | + name: Static analysis |
| 32 | + runs-on: ubuntu-latest |
| 33 | + steps: |
| 34 | + - name: Checkout |
| 35 | + uses: actions/checkout@v2 |
| 36 | + - name: Setup PHP |
| 37 | + uses: shivammathur/setup-php@v2 |
| 38 | + with: |
| 39 | + php-version: 8.1 |
| 40 | + coverage: xdebug |
| 41 | + - name: Get Composer Cache Directory |
| 42 | + id: composer-cache |
| 43 | + run: echo "::set-output name=dir::$(composer config cache-files-dir)" |
| 44 | + - name: Cache dependencies |
| 45 | + uses: actions/cache@v2 |
| 46 | + with: |
| 47 | + path: ${{ steps.composer-cache.outputs.dir }} |
| 48 | + key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} |
| 49 | + restore-keys: ${{ runner.os }}-composer- |
| 50 | + - name: Install Dependencies |
| 51 | + run: composer install --no-progress |
| 52 | + - name: Run phpstan |
| 53 | + run: vendor/bin/phpstan |
| 54 | + |
| 55 | + phpunit: |
| 56 | + name: Unit Tests |
| 57 | + runs-on: ubuntu-latest |
| 58 | + strategy: |
| 59 | + matrix: |
| 60 | + php: ['8.1', '8.2', '8.3'] |
| 61 | + flags: ['', '--prefer-lowest', '--prefer-stable'] |
| 62 | + steps: |
| 63 | + - name: Checkout |
| 64 | + uses: actions/checkout@v2 |
| 65 | + - name: Setup PHP |
| 66 | + uses: shivammathur/setup-php@v2 |
| 67 | + with: |
| 68 | + php-version: ${{ matrix.php }} |
| 69 | + coverage: xdebug |
| 70 | + - name: Get Composer Cache Directory |
| 71 | + id: composer-cache |
| 72 | + run: echo "::set-output name=dir::$(composer config cache-files-dir)" |
| 73 | + - name: Cache dependencies |
| 74 | + uses: actions/cache@v2 |
| 75 | + with: |
| 76 | + path: ${{ steps.composer-cache.outputs.dir }} |
| 77 | + key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} |
| 78 | + restore-keys: ${{ runner.os }}-composer- |
| 79 | + - name: Install Dependencies |
| 80 | + run: composer update --prefer-dist --no-interaction --optimize-autoloader --prefer-stable --no-progress $COMPOSER_FLAGS |
| 81 | + env: |
| 82 | + COMPOSER_FLAGS: ${{ matrix.flags }} |
| 83 | + - name: Run PHPUnit |
| 84 | + run: vendor/bin/phpunit |
0 commit comments