|
8 | 8 | - cron: '0 16 * * 0' # sunday 16:00 |
9 | 9 |
|
10 | 10 | jobs: |
11 | | - |
12 | | - ci: # this job runs all the development tools and upload code coverage to scrutinizer |
13 | | - |
14 | | - name: Continuous Integration |
| 11 | + phpcs: |
| 12 | + name: Code Style (phpcs) |
15 | 13 | runs-on: "ubuntu-latest" |
16 | | - |
17 | 14 | steps: |
18 | | - |
19 | 15 | - name: Checkout |
20 | | - uses: actions/checkout@v2 |
| 16 | + uses: actions/checkout@v3 |
| 17 | + - name: Setup PHP |
| 18 | + uses: shivammathur/setup-php@v2 |
| 19 | + with: |
| 20 | + php-version: '8.1' |
| 21 | + coverage: none |
| 22 | + tools: phpcs, cs2pr |
| 23 | + - name: phpcs |
| 24 | + run: phpcs -q --report=checkstyle | cs2pr |
21 | 25 |
|
22 | | - # see https://github.com/marketplace/actions/setup-php-action |
| 26 | + php-cs-fixer: |
| 27 | + name: Code Style (php-cs-fixer) |
| 28 | + runs-on: "ubuntu-latest" |
| 29 | + steps: |
| 30 | + - name: Checkout |
| 31 | + uses: actions/checkout@v3 |
23 | 32 | - name: Setup PHP |
24 | 33 | uses: shivammathur/setup-php@v2 |
25 | 34 | with: |
26 | | - php-version: '8.0' |
27 | | - coverage: xdebug |
28 | | - tools: composer:v2, phpcs, php-cs-fixer, phpstan, cs2pr |
29 | | - env: |
30 | | - fail-fast: true |
| 35 | + php-version: '8.1' |
| 36 | + coverage: none |
| 37 | + tools: php-cs-fixer, cs2pr |
| 38 | + - name: php-cs-fixer |
| 39 | + run: php-cs-fixer fix --dry-run --format=checkstyle | cs2pr |
31 | 40 |
|
| 41 | + phpstan: |
| 42 | + name: Code analysis (phpstan) |
| 43 | + runs-on: "ubuntu-latest" |
| 44 | + steps: |
| 45 | + - name: Checkout |
| 46 | + uses: actions/checkout@v3 |
| 47 | + - name: Setup PHP |
| 48 | + uses: shivammathur/setup-php@v2 |
| 49 | + with: |
| 50 | + php-version: '8.1' |
| 51 | + coverage: none |
| 52 | + tools: composer:v2, phpstan, cs2pr |
32 | 53 | - name: Get composer cache directory |
33 | 54 | id: composer-cache |
34 | 55 | run: echo "::set-output name=dir::$(composer config cache-files-dir)" |
35 | | - |
36 | 56 | - name: Cache dependencies |
37 | | - uses: actions/cache@v2 |
| 57 | + uses: actions/cache@v3 |
38 | 58 | with: |
39 | 59 | path: ${{ steps.composer-cache.outputs.dir }} |
40 | 60 | key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} |
41 | 61 | restore-keys: ${{ runner.os }}-composer- |
42 | | - |
43 | 62 | - name: Install project dependencies |
44 | 63 | run: composer upgrade --no-interaction --no-progress --prefer-dist |
45 | | - |
46 | | - - name: Code style (phpcs) |
47 | | - run: phpcs -q --report=checkstyle | cs2pr |
48 | | - |
49 | | - - name: Code style (php-cs-fixer) |
50 | | - run: php-cs-fixer fix --dry-run --format=checkstyle | cs2pr |
51 | | - |
52 | | - - name: Tests (phpunit with code coverage) |
53 | | - run: vendor/bin/phpunit --testdox --verbose --coverage-clover=build/coverage-clover.xml |
54 | | - |
55 | | - - name: Code analysis (phpstan) |
| 64 | + - name: phpstan |
56 | 65 | run: phpstan analyse --no-progress --verbose |
57 | 66 |
|
58 | | - # see https://github.com/marketplace/actions/action-scrutinizer |
59 | | - - name: Upload code coverage to scrutinizer |
60 | | - uses: sudo-bot/action-scrutinizer@latest |
| 67 | + psalm: |
| 68 | + name: Code analysis (psalm) |
| 69 | + runs-on: "ubuntu-latest" |
| 70 | + steps: |
| 71 | + - name: Checkout |
| 72 | + uses: actions/checkout@v3 |
| 73 | + - name: Setup PHP |
| 74 | + uses: shivammathur/setup-php@v2 |
61 | 75 | with: |
62 | | - cli-args: "--format=php-clover build/coverage-clover.xml" |
63 | | - continue-on-error: true |
64 | | - |
65 | | - build: # this job runs tests on all php supported versions |
| 76 | + php-version: '8.1' |
| 77 | + coverage: none |
| 78 | + tools: psalm, cs2pr |
| 79 | + - name: Get composer cache directory |
| 80 | + id: composer-cache |
| 81 | + run: echo "::set-output name=dir::$(composer config cache-files-dir)" |
| 82 | + - name: Cache dependencies |
| 83 | + uses: actions/cache@v3 |
| 84 | + with: |
| 85 | + path: ${{ steps.composer-cache.outputs.dir }} |
| 86 | + key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} |
| 87 | + restore-keys: ${{ runner.os }}-composer- |
| 88 | + - name: Install project dependencies |
| 89 | + run: composer upgrade --no-interaction --no-progress --prefer-dist |
| 90 | + - name: psalm |
| 91 | + run: psalm --no-progress --output-format=github |
66 | 92 |
|
67 | | - name: PHP ${{ matrix.php-versions }} |
| 93 | + tests: |
| 94 | + name: Tests PHP ${{ matrix.php-versions }} (phpunit) |
68 | 95 | runs-on: "ubuntu-latest" |
69 | | - |
70 | 96 | strategy: |
71 | 97 | matrix: |
72 | | - php-versions: ['7.3', '7.4', '8.0'] |
73 | | - |
| 98 | + php-versions: ['7.3', '7.4', '8.0', '8.1'] |
74 | 99 | steps: |
75 | | - |
76 | 100 | - name: Checkout |
77 | | - uses: actions/checkout@v2 |
78 | | - |
79 | | - # see https://github.com/marketplace/actions/setup-php-action |
| 101 | + uses: actions/checkout@v3 |
80 | 102 | - name: Setup PHP |
81 | | - uses: shivammathur/setup-php@v2 |
| 103 | + uses: shivammathur/setup-php@v2 # see https://github.com/marketplace/actions/setup-php-action |
82 | 104 | with: |
83 | 105 | php-version: ${{ matrix.php-versions }} |
84 | 106 | coverage: none |
85 | 107 | tools: composer:v2, cs2pr |
86 | 108 | env: |
87 | 109 | fail-fast: true |
88 | | - |
89 | 110 | - name: Get composer cache directory |
90 | 111 | id: composer-cache |
91 | 112 | run: echo "::set-output name=dir::$(composer config cache-files-dir)" |
92 | | - |
93 | 113 | - name: Cache dependencies |
94 | | - uses: actions/cache@v2 |
| 114 | + uses: actions/cache@v3 |
95 | 115 | with: |
96 | 116 | path: ${{ steps.composer-cache.outputs.dir }} |
97 | 117 | key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} |
98 | 118 | restore-keys: ${{ runner.os }}-composer- |
99 | | - |
100 | 119 | - name: Install project dependencies |
101 | 120 | run: composer upgrade --no-interaction --no-progress --prefer-dist |
102 | | - |
103 | 121 | - name: Tests |
104 | 122 | run: vendor/bin/phpunit --testdox --verbose |
| 123 | + |
| 124 | + infection: |
| 125 | + name: Mutation testing analysis |
| 126 | + runs-on: "ubuntu-latest" |
| 127 | + steps: |
| 128 | + - name: Checkout |
| 129 | + uses: actions/checkout@v3 |
| 130 | + - name: Setup PHP |
| 131 | + uses: shivammathur/setup-php@v2 |
| 132 | + with: |
| 133 | + php-version: '8.1' |
| 134 | + coverage: xdebug |
| 135 | + tools: composer:v2, infection |
| 136 | + - name: Get composer cache directory |
| 137 | + id: composer-cache |
| 138 | + run: echo "::set-output name=dir::$(composer config cache-files-dir)" |
| 139 | + - name: Cache dependencies |
| 140 | + uses: actions/cache@v3 |
| 141 | + with: |
| 142 | + path: ${{ steps.composer-cache.outputs.dir }} |
| 143 | + key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} |
| 144 | + restore-keys: ${{ runner.os }}-composer- |
| 145 | + - name: Install project dependencies |
| 146 | + run: composer upgrade --no-interaction --no-progress --prefer-dist |
| 147 | + - name: Create code coverage |
| 148 | + run: vendor/bin/phpunit --testdox --verbose --coverage-xml=build/coverage --coverage-clover=build/coverage/clover.xml --log-junit=build/coverage/junit.xml |
| 149 | + - name: infection |
| 150 | + run: infection --skip-initial-tests --coverage=build/coverage --no-progress --no-interaction --logger-github |
0 commit comments