|
| 1 | +name: Validations |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + tags-ignore: |
| 6 | + - '**' |
| 7 | + branches: |
| 8 | + - master |
| 9 | + pull_request: |
| 10 | + types: |
| 11 | + - synchronize |
| 12 | + - opened |
| 13 | + |
| 14 | +jobs: |
| 15 | + security: |
| 16 | + runs-on: ubuntu-latest |
| 17 | + steps: |
| 18 | + - uses: actions/checkout@v3 |
| 19 | + - uses: symfonycorp/security-checker-action@v2 |
| 20 | + |
| 21 | + composer: |
| 22 | + runs-on: ubuntu-latest |
| 23 | + steps: |
| 24 | + - uses: actions/checkout@v3 |
| 25 | + - name: Setup PHP |
| 26 | + uses: shivammathur/setup-php@v2 |
| 27 | + with: |
| 28 | + php-version: '8.1' |
| 29 | + tools: composer:v2 |
| 30 | + - name: Composer cache |
| 31 | + uses: actions/cache@v2 |
| 32 | + with: |
| 33 | + key: composer-${{ hashFiles('**/composer.lock') }} |
| 34 | + path: ${{ github.workspace }}/.cache |
| 35 | + - name: Vendor cache |
| 36 | + uses: actions/cache@v2 |
| 37 | + with: |
| 38 | + key: vendor-${{ hashFiles('**/composer.lock') }} |
| 39 | + path: ${{ github.workspace }}/vendor |
| 40 | + - name: Tools cache |
| 41 | + uses: actions/cache@v2 |
| 42 | + with: |
| 43 | + key: tools |
| 44 | + path: ${{ github.workspace }}/.cache |
| 45 | + |
| 46 | + - name: Install dependencies |
| 47 | + env: |
| 48 | + COMPOSER_CACHE_DIR: ${{ github.workspace }}/.cache |
| 49 | + run: |- |
| 50 | + composer install --no-progress --no-interaction --prefer-dist --optimize-autoloader |
| 51 | +
|
| 52 | + - name: Validate composer |
| 53 | + env: |
| 54 | + COMPOSER_CACHE_DIR: ${{ github.workspace }}/.cache |
| 55 | + run: composer validate |
| 56 | + |
| 57 | + - name: Normalize composer |
| 58 | + env: |
| 59 | + COMPOSER_CACHE_DIR: ${{ github.workspace }}/.cache |
| 60 | + run: composer normalize --dry-run |
| 61 | + |
| 62 | + phpstan: |
| 63 | + runs-on: ubuntu-latest |
| 64 | + steps: |
| 65 | + - uses: actions/checkout@v3 |
| 66 | + - name: Setup PHP |
| 67 | + uses: shivammathur/setup-php@v2 |
| 68 | + with: |
| 69 | + php-version: '8.1' |
| 70 | + tools: composer:v2 |
| 71 | + - name: Composer cache |
| 72 | + uses: actions/cache@v2 |
| 73 | + with: |
| 74 | + key: composer-${{ hashFiles('**/composer.lock') }} |
| 75 | + path: ${{ github.workspace }}/.cache |
| 76 | + - name: Vendor cache |
| 77 | + uses: actions/cache@v2 |
| 78 | + with: |
| 79 | + key: vendor-${{ hashFiles('**/composer.lock') }} |
| 80 | + path: ${{ github.workspace }}/vendor |
| 81 | + - name: Tools cache |
| 82 | + uses: actions/cache@v2 |
| 83 | + with: |
| 84 | + key: tools |
| 85 | + path: ${{ github.workspace }}/.cache |
| 86 | + |
| 87 | + - name: Install dependencies |
| 88 | + env: |
| 89 | + COMPOSER_CACHE_DIR: ${{ github.workspace }}/.cache |
| 90 | + run: |- |
| 91 | + composer install --no-progress --no-interaction --prefer-dist --optimize-autoloader |
| 92 | +
|
| 93 | + - name: phpstan |
| 94 | + run: ./vendor/bin/phpstan analyse -l max --memory-limit=1G |
| 95 | + |
| 96 | + phpcs: |
| 97 | + runs-on: ubuntu-latest |
| 98 | + steps: |
| 99 | + - uses: actions/checkout@v3 |
| 100 | + - name: Setup PHP |
| 101 | + uses: shivammathur/setup-php@v2 |
| 102 | + with: |
| 103 | + php-version: '8.1' |
| 104 | + tools: composer:v2 |
| 105 | + - name: Composer cache |
| 106 | + uses: actions/cache@v2 |
| 107 | + with: |
| 108 | + key: composer-${{ hashFiles('**/composer.lock') }} |
| 109 | + path: ${{ github.workspace }}/.cache |
| 110 | + - name: Vendor cache |
| 111 | + uses: actions/cache@v2 |
| 112 | + with: |
| 113 | + key: vendor-${{ hashFiles('**/composer.lock') }} |
| 114 | + path: ${{ github.workspace }}/vendor |
| 115 | + - name: Tools cache |
| 116 | + uses: actions/cache@v2 |
| 117 | + with: |
| 118 | + key: tools |
| 119 | + path: ${{ github.workspace }}/.cache |
| 120 | + |
| 121 | + - name: Install dependencies |
| 122 | + env: |
| 123 | + COMPOSER_CACHE_DIR: ${{ github.workspace }}/.cache |
| 124 | + run: |- |
| 125 | + composer install --no-progress --no-interaction --prefer-dist --optimize-autoloader |
| 126 | +
|
| 127 | + - name: phpcs |
| 128 | + run: ./vendor/bin/phpcs -d memory_limit=1G |
0 commit comments