|
4 | 4 | push: |
5 | 5 | branches: |
6 | 6 | - master |
| 7 | + - cake5 |
7 | 8 | pull_request: |
8 | 9 | branches: |
9 | 10 | - '*' |
10 | 11 |
|
| 12 | +permissions: |
| 13 | + contents: read |
| 14 | + |
11 | 15 | jobs: |
12 | 16 | testsuite: |
13 | | - runs-on: ubuntu-18.04 |
14 | | - strategy: |
15 | | - fail-fast: false |
16 | | - matrix: |
17 | | - php-version: ['7.2', '7.4', '8.0', '8.1'] |
18 | | - prefer-lowest: [''] |
19 | | - include: |
20 | | - - php-version: '7.2' |
21 | | - prefer-lowest: 'prefer-lowest' |
22 | | - |
23 | | - steps: |
24 | | - - uses: actions/checkout@v3 |
25 | | - |
26 | | - - name: Setup PHP |
27 | | - uses: shivammathur/setup-php@v2 |
28 | | - with: |
29 | | - php-version: ${{ matrix.php-version }} |
30 | | - extensions: mbstring, intl |
31 | | - coverage: pcov |
32 | | - |
33 | | - - name: Get composer cache directory |
34 | | - id: composer-cache |
35 | | - run: echo "::set-output name=dir::$(composer config cache-files-dir)" |
36 | | - |
37 | | - - name: Get date part for cache key |
38 | | - id: key-date |
39 | | - run: echo "::set-output name=date::$(date +'%Y-%m')" |
40 | | - |
41 | | - - name: Cache composer dependencies |
42 | | - uses: actions/cache@v3 |
43 | | - with: |
44 | | - path: ${{ steps.composer-cache.outputs.dir }} |
45 | | - key: ${{ runner.os }}-composer-${{ steps.key-date.outputs.date }}-${{ hashFiles('composer.json') }}-${{ matrix.prefer-lowest }} |
46 | | - |
47 | | - - name: Composer install |
48 | | - run: | |
49 | | - if ${{ matrix.prefer-lowest == 'prefer-lowest' }}; then |
50 | | - composer update --prefer-lowest --prefer-stable |
51 | | - elif ${{ matrix.php-version == '8.1' }}; then |
52 | | - composer update --ignore-platform-reqs |
53 | | - else |
54 | | - composer update |
55 | | - fi |
56 | | -
|
57 | | - - name: Run PHPUnit |
58 | | - run: | |
59 | | - if ${{ matrix.php-version == '7.4'}}; then |
60 | | - vendor/bin/phpunit --coverage-clover=coverage.xml |
61 | | - else |
62 | | - vendor/bin/phpunit |
63 | | - fi |
64 | | -
|
65 | | - - name: Code Coverage Report |
66 | | - if: matrix.php-version == '7.4' |
67 | | - uses: codecov/codecov-action@v3 |
| 17 | + uses: cakephp/.github/.github/workflows/[email protected] |
| 18 | + secrets: inherit |
68 | 19 |
|
69 | 20 | cs-stan: |
70 | | - name: Coding Standard & Static Analysis |
71 | | - runs-on: ubuntu-18.04 |
72 | | - |
73 | | - steps: |
74 | | - - uses: actions/checkout@v3 |
75 | | - |
76 | | - - name: Setup PHP |
77 | | - uses: shivammathur/setup-php@v2 |
78 | | - with: |
79 | | - php-version: '7.4' |
80 | | - extensions: mbstring, intl |
81 | | - coverage: none |
82 | | - tools: cs2pr |
83 | | - |
84 | | - - name: Composer Install |
85 | | - run: composer stan-setup |
86 | | - |
87 | | - - name: Run PHP CodeSniffer |
88 | | - run: vendor/bin/phpcs --report=checkstyle src/ tests/ | cs2pr |
89 | | - |
90 | | - - name: Run psalm |
91 | | - if: success() || failure() |
92 | | - run: vendor/bin/psalm.phar --output-format=github |
93 | | - |
94 | | - - name: Run phpstan |
95 | | - if: success() || failure() |
96 | | - run: vendor/bin/phpstan.phar analyse --error-format=github |
| 21 | + uses: cakephp/.github/.github/workflows/[email protected] |
| 22 | + secrets: inherit |
0 commit comments