|
1 | 1 | name: PHP Quality Assurance |
2 | | -on: [push] |
| 2 | +on: [push, pull_request] |
3 | 3 | jobs: |
4 | | - build: |
| 4 | + tests: |
5 | 5 | runs-on: ubuntu-latest |
6 | 6 | if: "!contains(github.event.head_commit.message, 'ci skip')" |
7 | 7 | strategy: |
| 8 | + fail-fast: true |
8 | 9 | matrix: |
9 | | - php-versions: ['7.1', '7.2', '7.3', '7.4'] |
| 10 | + php-versions: ['7.1', '7.2', '7.3', '7.4', '8.0'] |
10 | 11 | steps: |
11 | | - - uses: actions/checkout@v2 |
| 12 | + - uses: actions/checkout@v2 |
| 13 | + |
| 14 | + - name: Setup PHP |
| 15 | + uses: shivammathur/setup-php@v2 |
| 16 | + with: |
| 17 | + php-version: ${{ matrix.php-versions }} |
| 18 | + |
| 19 | + - name: Check syntax error in sources |
| 20 | + run: find ./src/ ./tests/ -type f -name '*.php' -print0 | xargs -0 -L 1 -P 4 -- php -l |
| 21 | + |
| 22 | + - name: Install dependencies |
| 23 | + uses: "ramsey/composer-install@v1" |
| 24 | + |
| 25 | + - name: Run unit tests |
| 26 | + run: composer tests:no-cov |
| 27 | + |
| 28 | + static: |
| 29 | + runs-on: ubuntu-latest |
| 30 | + if: "!contains(github.event.head_commit.message, 'ci skip')" |
| 31 | + steps: |
| 32 | + - name: Checkout |
| 33 | + uses: actions/checkout@v2 |
12 | 34 |
|
13 | 35 | - name: Setup PHP |
14 | 36 | uses: shivammathur/setup-php@v2 |
15 | 37 | with: |
16 | | - php-version: ${{ matrix.php-versions }} |
17 | | - |
18 | | - - name: Check syntax error in sources |
19 | | - run: find ./src/ ./tests/ -type f -name '*.php' -print0 | xargs -0 -L 1 -P 4 -- php -l |
| 38 | + php-version: 7.4 |
20 | 39 |
|
21 | 40 | - name: Install dependencies |
22 | | - run: composer install -q -n -a --no-progress --prefer-dist |
23 | | - |
24 | | - - name: Run unit tests |
25 | | - run: ./vendor/bin/phpunit --no-coverage |
| 41 | + uses: "ramsey/composer-install@v1" |
26 | 42 |
|
27 | 43 | - name: Check code styles |
28 | | - run: ./vendor/bin/phpcs |
| 44 | + run: composer cs |
29 | 45 |
|
30 | 46 | - name: Check Psalm |
31 | | - run: ./vendor/bin/psalm --show-info=false --no-progress --output-format=compact |
| 47 | + run: composer psalm |
| 48 | + |
| 49 | + - name: Check cross-version PHP compatibility |
| 50 | + run: composer phpcompat |
0 commit comments