|
1 | | -name: CI |
| 1 | +name: 'CI' |
2 | 2 |
|
3 | | -on: ['push', 'pull_request'] |
| 3 | +on: |
| 4 | + push: |
| 5 | + paths-ignore: |
| 6 | + - 'LICENSE' |
| 7 | + - 'README.md' |
| 8 | + pull_request: |
| 9 | + paths-ignore: |
| 10 | + - 'LICENSE' |
| 11 | + - 'README.md' |
4 | 12 |
|
5 | 13 | jobs: |
6 | | - phpunit: |
7 | | - name: PHPUnit |
| 14 | + php-parallel-lint: |
| 15 | + name: 'PHPParallelLint' |
8 | 16 | runs-on: 'ubuntu-latest' |
| 17 | + |
| 18 | + steps: |
| 19 | + - name: Checkout repository |
| 20 | + uses: actions/checkout@v3 |
| 21 | + |
| 22 | + - name: Setup PHP |
| 23 | + uses: shivammathur/setup-php@v2 |
| 24 | + with: |
| 25 | + php-version: latest |
| 26 | + coverage: none |
| 27 | + |
| 28 | + - name: Install dependencies |
| 29 | + uses: ramsey/composer-install@v2 |
| 30 | + |
| 31 | + - name: Run PHPParallelLint |
| 32 | + run: composer php-parallel-lint -- --no-progress --ignore-fails |
| 33 | + |
| 34 | + psalm: |
| 35 | + name: 'Psalm' |
| 36 | + runs-on: 'ubuntu-latest' |
| 37 | + |
| 38 | + steps: |
| 39 | + - name: Checkout repository |
| 40 | + uses: actions/checkout@v3 |
| 41 | + |
| 42 | + - name: Setup PHP |
| 43 | + uses: shivammathur/setup-php@v2 |
| 44 | + with: |
| 45 | + php-version: latest |
| 46 | + coverage: none |
| 47 | + |
| 48 | + - name: Install dependencies |
| 49 | + uses: ramsey/composer-install@v2 |
| 50 | + |
| 51 | + - name: Run Psalm |
| 52 | + run: composer psalm -- --no-progress --no-cache --output-format=github |
| 53 | + |
| 54 | + php-cs-fixer: |
| 55 | + name: 'PHPCsFixer' |
| 56 | + runs-on: 'ubuntu-latest' |
| 57 | + |
| 58 | + steps: |
| 59 | + - name: Checkout repository |
| 60 | + uses: actions/checkout@v3 |
| 61 | + |
| 62 | + - name: Setup PHP |
| 63 | + uses: shivammathur/setup-php@v2 |
| 64 | + with: |
| 65 | + php-version: latest |
| 66 | + coverage: none |
| 67 | + |
| 68 | + - name: Install dependencies |
| 69 | + uses: ramsey/composer-install@v2 |
| 70 | + |
| 71 | + - name: Run PHPCsFixer |
| 72 | + run: composer php-cs-fixer:diff -- --no-interaction --using-cache=no |
| 73 | + |
| 74 | + phpunit: |
| 75 | + name: 'PHPUnit' |
| 76 | + needs: ['php-parallel-lint', 'psalm', 'php-cs-fixer'] |
| 77 | + runs-on: ${{ matrix.operating-system }} |
| 78 | + |
9 | 79 | strategy: |
10 | 80 | fail-fast: false |
11 | 81 | matrix: |
12 | | - php-versions: ['8.0', '8.1'] |
13 | | - stability: ['prefer-lowest', 'prefer-stable'] |
| 82 | + operating-system: |
| 83 | + - 'ubuntu-latest' |
| 84 | + - 'windows-latest' |
| 85 | + php-version: |
| 86 | + - '8.0' |
| 87 | + - '8.1' |
| 88 | + composer-dependency: |
| 89 | + - 'lowest' |
| 90 | + - 'highest' |
14 | 91 |
|
15 | 92 | steps: |
16 | | - - name: Checkout |
17 | | - uses: actions/checkout@v2 |
18 | | - |
19 | | - - name: Cache Composer |
20 | | - id: composer-cache |
21 | | - run: | |
22 | | - echo "::set-output name=dir::$(composer config cache-files-dir)" |
23 | | - - uses: actions/cache@v2 |
24 | | - with: |
25 | | - path: ${{ steps.composer-cache.outputs.dir }} |
26 | | - key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} |
27 | | - restore-keys: | |
28 | | - ${{ runner.os }}-composer- |
| 93 | + - name: Checkout repository |
| 94 | + uses: actions/checkout@v3 |
29 | 95 |
|
30 | 96 | - name: Setup PHP |
31 | 97 | uses: shivammathur/setup-php@v2 |
32 | 98 | with: |
33 | | - php-version: ${{ matrix.php-versions }} |
34 | | - tools: composer:v2 |
| 99 | + php-version: ${{ matrix.php-version }} |
35 | 100 | coverage: none |
36 | 101 |
|
37 | | - - name: Update Composer |
38 | | - run: composer update --${{ matrix.stability }} --prefer-dist --no-interaction --no-progress |
| 102 | + - name: Install dependencies |
| 103 | + uses: ramsey/composer-install@v2 |
| 104 | + with: |
| 105 | + dependency-versions: ${{ matrix.composer-dependency }} |
39 | 106 |
|
40 | 107 | - name: Run PHPUnit |
41 | | - run: vendor/bin/phpunit --verbose --no-interaction |
| 108 | + run: composer phpunit -- --no-interaction --do-not-cache-result |
0 commit comments