|
| 1 | +name: Quality and Assurance |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + pull_request: |
| 6 | + |
| 7 | +jobs: |
| 8 | + build: |
| 9 | + name: Build |
| 10 | + runs-on: ubuntu-latest |
| 11 | + strategy: |
| 12 | + fail-fast: true |
| 13 | + matrix: |
| 14 | + php-versions: ['7.1', '8.1'] |
| 15 | + |
| 16 | + steps: |
| 17 | + - name: Checkout |
| 18 | + uses: actions/checkout@v2 |
| 19 | + |
| 20 | + - name: Setup PHP, extensions and composer with shivammathur/setup-php |
| 21 | + uses: shivammathur/setup-php@v2 |
| 22 | + with: |
| 23 | + php-version: ${{ matrix.php-versions }} |
| 24 | + extensions: mbstring, xml, ctype, iconv, intl, pdo, pdo_mysql, dom, filter, gd, iconv, json, mbstring, pdo |
| 25 | + env: |
| 26 | + update: true |
| 27 | + |
| 28 | + - name: Validate composer.json |
| 29 | + run: composer validate --strict |
| 30 | + |
| 31 | + - name: Get composer cache directory |
| 32 | + id: composer-cache |
| 33 | + run: echo "::set-output name=dir::$(composer config cache-files-dir)" |
| 34 | + |
| 35 | + - name: Install Composer dependencies |
| 36 | + run: composer install --no-progress --prefer-dist --optimize-autoloader |
| 37 | + |
| 38 | + - name: Install Lowest Composer dependencies |
| 39 | + if: "matrix.php-versions < '8.1'" |
| 40 | + run: composer update --prefer-lowest --no-progress --prefer-dist --optimize-autoloader |
| 41 | + |
| 42 | + - name: Install PHPUnit |
| 43 | + run: vendor/bin/simple-phpunit install |
| 44 | + |
| 45 | + - name: Cache composer dependencies |
| 46 | + uses: actions/cache@v1 |
| 47 | + with: |
| 48 | + path: ${{ steps.composer-cache.outputs.dir }} |
| 49 | + key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} |
| 50 | + restore-keys: ${{ runner.os }}-composer- |
| 51 | + php-version: ${{ matrix.php-versions }} |
| 52 | + |
| 53 | + qa: |
| 54 | + name: Quality |
| 55 | + needs: build |
| 56 | + runs-on: ubuntu-latest |
| 57 | + strategy: |
| 58 | + fail-fast: true |
| 59 | + matrix: |
| 60 | + php-versions: ['8.1'] |
| 61 | + |
| 62 | + steps: |
| 63 | + - name: Checkout |
| 64 | + uses: actions/checkout@v2 |
| 65 | + |
| 66 | + - name: Setup PHP, extensions and composer with shivammathur/setup-php |
| 67 | + uses: shivammathur/setup-php@v2 |
| 68 | + with: |
| 69 | + php-version: ${{ matrix.php-versions }} |
| 70 | + extensions: mbstring, xml, ctype, intl, dom, filter |
| 71 | + tools: symfony |
| 72 | + env: |
| 73 | + update: true |
| 74 | + |
| 75 | + - name: Get composer cache directory |
| 76 | + id: composer-cache |
| 77 | + run: echo "::set-output name=dir::$(composer config cache-files-dir)" |
| 78 | + |
| 79 | + - name: Install Composer dependencies |
| 80 | + run: composer install --no-progress --prefer-dist --optimize-autoloader |
| 81 | + |
| 82 | + - name: PHP-CS-Fixer |
| 83 | + run: symfony php ./vendor/bin/php-cs-fixer fix --dry-run --using-cache=no --verbose --diff |
| 84 | + |
| 85 | + test: |
| 86 | + name: Tests |
| 87 | + needs: build |
| 88 | + runs-on: ubuntu-latest |
| 89 | + strategy: |
| 90 | + fail-fast: true |
| 91 | + matrix: |
| 92 | + php-versions: ['7.1', '8.1'] |
| 93 | + |
| 94 | + steps: |
| 95 | + - name: Checkout |
| 96 | + uses: actions/checkout@v2 |
| 97 | + |
| 98 | + - name: Setup PHP, extensions and composer with shivammathur/setup-php |
| 99 | + uses: shivammathur/setup-php@v2 |
| 100 | + with: |
| 101 | + php-version: ${{ matrix.php-versions }} |
| 102 | + extensions: mbstring, xml, ctype, intl, dom, filter |
| 103 | + tools: symfony |
| 104 | + env: |
| 105 | + update: true |
| 106 | + |
| 107 | + - name: Get composer cache directory |
| 108 | + id: composer-cache |
| 109 | + run: echo "::set-output name=dir::$(composer config cache-files-dir)" |
| 110 | + |
| 111 | + - name: Install Composer dependencies |
| 112 | + run: composer install --no-progress --prefer-dist --optimize-autoloader |
| 113 | + |
| 114 | + - name: Install Lowest Composer dependencies |
| 115 | + if: "matrix.php-versions < '8.1'" |
| 116 | + run: composer install --no-progress --prefer-dist --optimize-autoloader |
| 117 | + |
| 118 | + - name: Execute unit tests |
| 119 | + run: symfony php ./vendor/bin/simple-phpunit |
0 commit comments