|
| 1 | +name: Code Quality Diagnostics |
| 2 | + |
| 3 | +on: |
| 4 | + pull_request: |
| 5 | + push: |
| 6 | + branches: |
| 7 | + - master |
| 8 | + |
| 9 | +jobs: |
| 10 | + build: |
| 11 | + runs-on: ubuntu-latest |
| 12 | + |
| 13 | + name: PHP ${{ matrix.php }} |
| 14 | + |
| 15 | + strategy: |
| 16 | + fail-fast: false |
| 17 | + matrix: |
| 18 | + include: |
| 19 | + - php: 7.4 |
| 20 | + output: '-o github-action -o default' |
| 21 | + phpcq_install: 'update' |
| 22 | + - php: 8.0 |
| 23 | + output: '-o github-action -o default' |
| 24 | + phpcq_install: 'update' |
| 25 | + - php: 8.1 |
| 26 | + output: '-o github-action -o default' |
| 27 | + phpcq_install: 'update' |
| 28 | + - php: 8.2 |
| 29 | + output: '-o github-action -o default' |
| 30 | + phpcq_install: 'update' |
| 31 | + - php: 8.3 |
| 32 | + output: '-o github-action -o default' |
| 33 | + phpcq_install: 'update' |
| 34 | + steps: |
| 35 | + - name: Pull source |
| 36 | + uses: actions/checkout@v2 |
| 37 | + |
| 38 | + - name: Setup PHP with PECL extension |
| 39 | + uses: shivammathur/setup-php@v2 |
| 40 | + with: |
| 41 | + php-version: ${{ matrix.php }} |
| 42 | + |
| 43 | + - name: Cache composer cache directory |
| 44 | + uses: actions/cache@v1 |
| 45 | + env: |
| 46 | + cache-name: composer-cache-dir-${{ matrix.php }} |
| 47 | + with: |
| 48 | + path: ~/.cache/composer |
| 49 | + key: ${{ runner.os }}-build-${{ env.cache-name }} |
| 50 | + |
| 51 | + - name: Cache vendor directory |
| 52 | + uses: actions/cache@v1 |
| 53 | + env: |
| 54 | + cache-name: vendor-${{ matrix.php }} |
| 55 | + with: |
| 56 | + path: vendor |
| 57 | + key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/composer.lock') }} |
| 58 | + restore-keys: | |
| 59 | + ${{ runner.os }}-build-${{ env.cache-name }}- |
| 60 | +
|
| 61 | + - name: Cache phpcq directory |
| 62 | + uses: actions/cache@v1 |
| 63 | + env: |
| 64 | + cache-name: phpcq-${{ matrix.php }} |
| 65 | + with: |
| 66 | + path: .phpcq |
| 67 | + key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/.phpcq.lock') }} |
| 68 | + restore-keys: | |
| 69 | + ${{ runner.os }}-build-${{ env.cache-name }}- |
| 70 | +
|
| 71 | + - name: Install composer dependencies |
| 72 | + run: composer install |
| 73 | + |
| 74 | + - name: Install phpcq toolchain |
| 75 | + run: ./vendor/bin/phpcq ${{ matrix.phpcq_install }} -v |
| 76 | + |
| 77 | + - name: Run tests |
| 78 | + run: ./vendor/bin/phpcq run -v ${{ matrix.output }} |
| 79 | + |
| 80 | + - name: Upload build directory to artifact |
| 81 | + uses: actions/upload-artifact@v2 |
| 82 | + if: ${{ success() }} || ${{ failure() }} |
| 83 | + with: |
| 84 | + name: phpcq-builds-php-${{ matrix.php }} |
| 85 | + path: .phpcq/build/ |
0 commit comments