|
1 | 1 | name: "CI" |
2 | 2 |
|
3 | 3 | on: |
4 | | - push: |
5 | | - branches: [ main ] |
6 | | - pull_request: |
7 | | - branches: [ main ] |
8 | | - workflow_dispatch: |
| 4 | + push: |
| 5 | + branches: [ main ] |
| 6 | + pull_request: |
| 7 | + branches: [ main ] |
| 8 | + workflow_dispatch: |
9 | 9 |
|
10 | 10 | permissions: |
11 | | - contents: read |
| 11 | + contents: read |
12 | 12 |
|
13 | 13 | jobs: |
| 14 | + |
| 15 | + dep: |
| 16 | + name: "Dependencies" |
| 17 | + runs-on: ubuntu-latest |
| 18 | + steps: |
| 19 | + - name: "Git: checkout" |
| 20 | + uses: actions/checkout@v4 |
| 21 | + - name: "PHP: setup 8.3 " |
| 22 | + uses: shivammathur/setup-php@v2 |
| 23 | + with: |
| 24 | + php-version: '8.3' |
| 25 | + coverage: none |
| 26 | + tools: composer |
| 27 | + - name: "Composer: cache config" |
| 28 | + id: composer-cache |
| 29 | + run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT |
| 30 | + - name: "Composer: cache restore" |
| 31 | + uses: actions/cache@v4 |
| 32 | + with: |
| 33 | + path: ${{ steps.composer-cache.outputs.dir }} |
| 34 | + key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} |
| 35 | + restore-keys: ${{ runner.os }}-composer- |
| 36 | + - name: "Composer: validate" |
| 37 | + run: composer validate --strict |
| 38 | + - name: "Composer: install" |
| 39 | + run: composer install --prefer-dist --no-progress --no-suggest |
| 40 | + - name: "Composer: audit" |
| 41 | + run: composer audit |
| 42 | + |
| 43 | + cs: |
| 44 | + name: "Code style" |
| 45 | + runs-on: ubuntu-latest |
| 46 | + steps: |
| 47 | + - name: "Git: checkout" |
| 48 | + uses: actions/checkout@v4 |
| 49 | + - name: "PHP: setup 8.3" |
| 50 | + uses: shivammathur/setup-php@v2 |
| 51 | + with: |
| 52 | + php-version: '8.3' |
| 53 | + coverage: none |
| 54 | + tools: php-cs-fixer |
| 55 | + - name: "Php-CS-Fixer: version" |
| 56 | + run: php-cs-fixer -V |
| 57 | + - name: "Php-CS-Fixer: check" |
| 58 | + run: php-cs-fixer check --diff |
| 59 | + |
| 60 | + sa: |
| 61 | + name: "Static Analysis" |
| 62 | + runs-on: ubuntu-latest |
| 63 | + steps: |
| 64 | + - name: "Git: checkout" |
| 65 | + uses: actions/checkout@v4 |
| 66 | + - name: "PHP: setup ${{ matrix.php-version }}" |
| 67 | + uses: shivammathur/setup-php@v2 |
| 68 | + with: |
| 69 | + php-version: '8.3' |
| 70 | + coverage: none |
| 71 | + tools: phpstan |
| 72 | + - name: "Composer: cache config" |
| 73 | + id: composer-cache |
| 74 | + run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT |
| 75 | + - name: "Composer: cache restore" |
| 76 | + uses: actions/cache@v4 |
| 77 | + with: |
| 78 | + path: ${{ steps.composer-cache.outputs.dir }} |
| 79 | + key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} |
| 80 | + restore-keys: ${{ runner.os }}-composer- |
| 81 | + - name: "Composer: validate" |
| 82 | + run: composer validate --strict |
| 83 | + - name: "Composer: install" |
| 84 | + run: composer install --prefer-dist --no-progress --no-suggest |
| 85 | + - name: "PHPStan: version" |
| 86 | + run: phpstan --version |
| 87 | + - name: "PHPStan: analyse" |
| 88 | + run: phpstan analyse src/ |
| 89 | + |
| 90 | + tests: |
| 91 | + name: "Tests (PHP ${{ matrix.php-version }} ${{ matrix.dependencies }})" |
| 92 | + runs-on: ubuntu-latest |
| 93 | + strategy: |
| 94 | + matrix: |
| 95 | + php-version: |
| 96 | + - '8.2' |
| 97 | + - '8.3' |
| 98 | + dependencies: |
| 99 | + - 'low' |
| 100 | + - 'high' |
| 101 | + fail-fast: false |
| 102 | + steps: |
| 103 | + - name: "Git: Checkout" |
| 104 | + uses: actions/checkout@v4 |
| 105 | + - name: "PHP: setup ${{ matrix.php-version }}" |
| 106 | + uses: shivammathur/setup-php@v2 |
| 107 | + with: |
| 108 | + php-version: ${{ matrix.php-version }} |
| 109 | + coverage: xdebug |
| 110 | + ini-values: xdebug.mode=coverage |
| 111 | + - name: "PHP: php matcher" |
| 112 | + run: | |
| 113 | + echo "::add-matcher::${{ runner.tool_cache }}/php.json" |
| 114 | + - name: "Composer: cache config" |
| 115 | + id: composer-cache |
| 116 | + run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT |
| 117 | + - name: "Composer: cache restore" |
| 118 | + uses: actions/cache@v4 |
| 119 | + with: |
| 120 | + path: ${{ steps.composer-cache.outputs.dir }} |
| 121 | + key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}-${{ matrix.php-version }}-${{ matrix.dependencies }} |
| 122 | + restore-keys: ${{ runner.os }}-composer- |
| 123 | + - name: "Composer: validate" |
| 124 | + run: composer validate --strict |
| 125 | + - name: "Composer: install ${{ matrix.dependencies }} deps" |
| 126 | + run: | |
| 127 | + if [ "${{ matrix.dependencies }}" == "low" ]; then |
| 128 | + composer update --prefer-lowest --prefer-dist --no-progress --no-suggest; |
| 129 | + else |
| 130 | + composer install --prefer-dist --no-progress --no-suggest; |
| 131 | + fi |
| 132 | + - name: "PHPUnit: version" |
| 133 | + run: php vendor/bin/phpunit --version |
| 134 | + - name: "PHPUnit: tests" |
| 135 | + run: php vendor/bin/phpunit |
14 | 136 |
|
15 | | - dep: |
16 | | - name: "Dependencies" |
17 | | - runs-on: ubuntu-latest |
18 | | - steps: |
19 | | - - name: "Git: checkout" |
20 | | - uses: actions/checkout@v4 |
21 | | - - name: "PHP: setup 8.3 " |
22 | | - uses: shivammathur/setup-php@v2 |
23 | | - with: |
24 | | - php-version: '8.3' |
25 | | - coverage: none |
26 | | - tools: composer |
27 | | - - name: "Composer: cache config" |
28 | | - id: composer-cache |
29 | | - run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT |
30 | | - - name: "Composer: cache restore" |
31 | | - uses: actions/cache@v4 |
32 | | - with: |
33 | | - path: ${{ steps.composer-cache.outputs.dir }} |
34 | | - key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} |
35 | | - restore-keys: ${{ runner.os }}-composer- |
36 | | - - name: "Composer: validate" |
37 | | - run: composer validate --strict |
38 | | - - name: "Composer: install" |
39 | | - run: composer install --prefer-dist --no-progress --no-suggest |
40 | | - - name: "Composer: audit" |
41 | | - run: composer audit |
42 | | - |
43 | | - cs: |
44 | | - name: "Code style" |
45 | | - runs-on: ubuntu-latest |
46 | | - steps: |
47 | | - - name: "Git: checkout" |
48 | | - uses: actions/checkout@v4 |
49 | | - - name: "PHP: setup 8.3" |
50 | | - uses: shivammathur/setup-php@v2 |
51 | | - with: |
52 | | - php-version: '8.3' |
53 | | - coverage: none |
54 | | - tools: php-cs-fixer |
55 | | - - name: "Php-CS-Fixer: version" |
56 | | - run: php-cs-fixer -V |
57 | | - - name: "Php-CS-Fixer: check" |
58 | | - run: php-cs-fixer check --diff |
59 | | - |
60 | | - sa: |
61 | | - name: "Static Analysis" |
62 | | - runs-on: ubuntu-latest |
63 | | - steps: |
64 | | - - name: "Git: checkout" |
65 | | - uses: actions/checkout@v4 |
66 | | - - name: "PHP: setup ${{ matrix.php-version }}" |
67 | | - uses: shivammathur/setup-php@v2 |
68 | | - with: |
69 | | - php-version: '8.3' |
70 | | - coverage: none |
71 | | - tools: phpstan |
72 | | - - name: "Composer: cache config" |
73 | | - id: composer-cache |
74 | | - run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT |
75 | | - - name: "Composer: cache restore" |
76 | | - uses: actions/cache@v4 |
77 | | - with: |
78 | | - path: ${{ steps.composer-cache.outputs.dir }} |
79 | | - key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} |
80 | | - restore-keys: ${{ runner.os }}-composer- |
81 | | - - name: "Composer: validate" |
82 | | - run: composer validate --strict |
83 | | - - name: "Composer: install" |
84 | | - run: composer install --prefer-dist --no-progress --no-suggest |
85 | | - - name: "PHPStan: version" |
86 | | - run: phpstan --version |
87 | | - - name: "PHPStan: analyse" |
88 | | - run: phpstan analyse src/ |
89 | | - |
90 | | - tests: |
91 | | - name: "Tests (PHP ${{ matrix.php-version }})" |
92 | | - runs-on: ubuntu-latest |
93 | | - strategy: |
94 | | - matrix: |
95 | | - php-version: |
96 | | - - '8.2' |
97 | | - - '8.3' |
98 | | - fail-fast: false |
99 | | - steps: |
100 | | - - name: "Git: Checkout" |
101 | | - uses: actions/checkout@v4 |
102 | | - - name: "PHP: setup ${{ matrix.php-version }}" |
103 | | - uses: shivammathur/setup-php@v2 |
104 | | - with: |
105 | | - php-version: ${{ matrix.php-version }} |
106 | | - coverage: xdebug |
107 | | - ini-values: xdebug.mode=coverage |
108 | | - - name: "PHP: php matcher" |
109 | | - run: | |
110 | | - echo "::add-matcher::${{ runner.tool_cache }}/php.json" |
111 | | - - name: "Composer: cache config" |
112 | | - id: composer-cache |
113 | | - run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT |
114 | | - - name: "Composer: cache restore" |
115 | | - uses: actions/cache@v4 |
116 | | - with: |
117 | | - path: ${{ steps.composer-cache.outputs.dir }} |
118 | | - key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} |
119 | | - restore-keys: ${{ runner.os }}-composer- |
120 | | - - name: "Composer: validate" |
121 | | - run: composer validate --strict |
122 | | - - name: "Composer: install" |
123 | | - run: composer install --prefer-dist --no-progress --no-suggest |
124 | | - - name: "PHPUnit: version" |
125 | | - run: php vendor/bin/phpunit --version |
126 | | - - name: "PHPUnit: tests" |
127 | | - run: php vendor/bin/phpunit |
128 | 137 | # - name: "Codecov: upload" |
129 | 138 | # uses: codecov/codecov-action@v4.0.1 |
130 | 139 | # with: |
|
0 commit comments