|
1 | 1 | # https://help.github.com/en/categories/automating-your-workflow-with-github-actions
|
2 | 2 |
|
3 | 3 | on:
|
4 |
| - push: |
5 |
| - branches: |
6 |
| - - main |
7 |
| - pull_request: |
8 |
| - schedule: |
9 |
| - - cron: '3 3 * * 1' |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - main |
| 7 | + pull_request: |
| 8 | + schedule: |
| 9 | + - cron: '3 3 * * 1' |
10 | 10 |
|
11 | 11 | name: CI
|
12 | 12 |
|
13 | 13 | jobs:
|
14 |
| - php-lint: |
15 |
| - name: PHP Lint |
16 |
| - runs-on: ubuntu-22.04 |
17 |
| - strategy: |
18 |
| - matrix: |
19 |
| - php-version: [ '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3' ] |
20 |
| - |
21 |
| - steps: |
22 |
| - - name: Checkout |
23 |
| - uses: actions/checkout@v4 |
24 |
| - |
25 |
| - - name: Install PHP |
26 |
| - uses: shivammathur/setup-php@v2 |
27 |
| - with: |
28 |
| - php-version: ${{ matrix.php-version }} |
29 |
| - ini-file: development |
30 |
| - coverage: none |
31 |
| - |
32 |
| - - name: PHP Lint |
33 |
| - run: find src tests -name '*.php' -print0 | xargs -0 -n 1 -P 4 php -l |
34 |
| - |
35 |
| - unit-tests: |
36 |
| - name: Unit tests |
37 |
| - |
38 |
| - runs-on: ubuntu-22.04 |
39 |
| - |
40 |
| - needs: [ php-lint ] |
41 |
| - |
42 |
| - strategy: |
43 |
| - fail-fast: false |
44 |
| - matrix: |
45 |
| - php-version: [ '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3' ] |
46 |
| - |
47 |
| - steps: |
48 |
| - - name: Checkout |
49 |
| - uses: actions/checkout@v4 |
50 |
| - |
51 |
| - - name: Install PHP |
52 |
| - uses: shivammathur/setup-php@v2 |
53 |
| - with: |
54 |
| - php-version: ${{ matrix.php-version }} |
55 |
| - ini-file: development |
56 |
| - tools: composer:v2 |
57 |
| - coverage: none |
58 |
| - |
59 |
| - - name: Show the Composer configuration |
60 |
| - run: composer config --global --list |
61 |
| - |
62 |
| - - name: Cache dependencies installed with composer |
63 |
| - uses: actions/cache@v4 |
64 |
| - with: |
65 |
| - path: ~/.cache/composer |
66 |
| - key: php${{ matrix.php-version }}-composer-${{ hashFiles('**/composer.json') }} |
67 |
| - restore-keys: | |
68 |
| - php${{ matrix.php-version }}-composer- |
69 |
| -
|
70 |
| - - name: Install Composer dependencies |
71 |
| - run: | |
72 |
| - composer update --with-dependencies --no-progress; |
73 |
| - composer show; |
74 |
| -
|
75 |
| - - name: Run Tests |
76 |
| - run: ./vendor/bin/phpunit |
77 |
| - |
78 |
| - static-analysis: |
79 |
| - name: Static Analysis |
80 |
| - |
81 |
| - runs-on: ubuntu-22.04 |
82 |
| - |
83 |
| - needs: [ php-lint ] |
84 |
| - |
85 |
| - strategy: |
86 |
| - fail-fast: false |
87 |
| - matrix: |
88 |
| - command: |
89 |
| - - fixer |
90 |
| - - stan |
91 |
| - php-version: |
92 |
| - - '8.3' |
93 |
| - |
94 |
| - steps: |
95 |
| - - name: Checkout |
96 |
| - uses: actions/checkout@v4 |
97 |
| - |
98 |
| - - name: Install PHP |
99 |
| - uses: shivammathur/setup-php@v2 |
100 |
| - with: |
101 |
| - php-version: ${{ matrix.php-version }} |
102 |
| - ini-file: development |
103 |
| - tools: "composer:v2, phive" |
104 |
| - coverage: none |
105 |
| - |
106 |
| - - name: Show the Composer configuration |
107 |
| - run: composer config --global --list |
108 |
| - |
109 |
| - - name: Cache dependencies installed with composer |
110 |
| - uses: actions/cache@v4 |
111 |
| - with: |
112 |
| - path: ~/.cache/composer |
113 |
| - key: php${{ matrix.php-version }}-composer-${{ hashFiles('**/composer.json') }} |
114 |
| - restore-keys: | |
115 |
| - php${{ matrix.php-version }}-composer- |
116 |
| -
|
117 |
| - - name: Install Composer dependencies |
118 |
| - run: | |
119 |
| - composer update --with-dependencies --no-progress; |
120 |
| - composer show; |
121 |
| -
|
122 |
| - - name: Install development tools |
123 |
| - run: | |
124 |
| - phive --no-progress install --trust-gpg-keys BBAB5DF0A0D6672989CF1869E82B2FB314E9906E |
125 |
| -
|
126 |
| - - name: Run Command |
127 |
| - run: composer ci:php:${{ matrix.command }} |
| 14 | + php-lint: |
| 15 | + name: PHP Lint |
| 16 | + runs-on: ubuntu-22.04 |
| 17 | + strategy: |
| 18 | + matrix: |
| 19 | + php-version: [ '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3' ] |
| 20 | + |
| 21 | + steps: |
| 22 | + - name: Checkout |
| 23 | + uses: actions/checkout@v4 |
| 24 | + |
| 25 | + - name: Install PHP |
| 26 | + uses: shivammathur/setup-php@v2 |
| 27 | + with: |
| 28 | + php-version: ${{ matrix.php-version }} |
| 29 | + ini-file: development |
| 30 | + coverage: none |
| 31 | + |
| 32 | + - name: PHP Lint |
| 33 | + run: find src tests -name '*.php' -print0 | xargs -0 -n 1 -P 4 php -l |
| 34 | + |
| 35 | + unit-tests: |
| 36 | + name: Unit tests |
| 37 | + |
| 38 | + runs-on: ubuntu-22.04 |
| 39 | + |
| 40 | + needs: [ php-lint ] |
| 41 | + |
| 42 | + strategy: |
| 43 | + fail-fast: false |
| 44 | + matrix: |
| 45 | + php-version: [ '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3' ] |
| 46 | + |
| 47 | + steps: |
| 48 | + - name: Checkout |
| 49 | + uses: actions/checkout@v4 |
| 50 | + |
| 51 | + - name: Install PHP |
| 52 | + uses: shivammathur/setup-php@v2 |
| 53 | + with: |
| 54 | + php-version: ${{ matrix.php-version }} |
| 55 | + ini-file: development |
| 56 | + tools: composer:v2 |
| 57 | + coverage: none |
| 58 | + |
| 59 | + - name: Show the Composer configuration |
| 60 | + run: composer config --global --list |
| 61 | + |
| 62 | + - name: Cache dependencies installed with composer |
| 63 | + uses: actions/cache@v4 |
| 64 | + with: |
| 65 | + path: ~/.cache/composer |
| 66 | + key: php${{ matrix.php-version }}-composer-${{ hashFiles('**/composer.json') }} |
| 67 | + restore-keys: | |
| 68 | + php${{ matrix.php-version }}-composer- |
| 69 | +
|
| 70 | + - name: Install Composer dependencies |
| 71 | + run: | |
| 72 | + composer update --with-dependencies --no-progress; |
| 73 | + composer show; |
| 74 | +
|
| 75 | + - name: Run Tests |
| 76 | + run: ./vendor/bin/phpunit |
| 77 | + |
| 78 | + static-analysis: |
| 79 | + name: Static Analysis |
| 80 | + |
| 81 | + runs-on: ubuntu-22.04 |
| 82 | + |
| 83 | + needs: [ php-lint ] |
| 84 | + |
| 85 | + strategy: |
| 86 | + fail-fast: false |
| 87 | + matrix: |
| 88 | + command: |
| 89 | + - fixer |
| 90 | + - stan |
| 91 | + php-version: |
| 92 | + - '8.3' |
| 93 | + |
| 94 | + steps: |
| 95 | + - name: Checkout |
| 96 | + uses: actions/checkout@v4 |
| 97 | + |
| 98 | + - name: Install PHP |
| 99 | + uses: shivammathur/setup-php@v2 |
| 100 | + with: |
| 101 | + php-version: ${{ matrix.php-version }} |
| 102 | + ini-file: development |
| 103 | + tools: "composer:v2, phive" |
| 104 | + coverage: none |
| 105 | + |
| 106 | + - name: Show the Composer configuration |
| 107 | + run: composer config --global --list |
| 108 | + |
| 109 | + - name: Cache dependencies installed with composer |
| 110 | + uses: actions/cache@v4 |
| 111 | + with: |
| 112 | + path: ~/.cache/composer |
| 113 | + key: php${{ matrix.php-version }}-composer-${{ hashFiles('**/composer.json') }} |
| 114 | + restore-keys: | |
| 115 | + php${{ matrix.php-version }}-composer- |
| 116 | +
|
| 117 | + - name: Install Composer dependencies |
| 118 | + run: | |
| 119 | + composer update --with-dependencies --no-progress; |
| 120 | + composer show; |
| 121 | +
|
| 122 | + - name: Install development tools |
| 123 | + run: | |
| 124 | + phive --no-progress install --trust-gpg-keys BBAB5DF0A0D6672989CF1869E82B2FB314E9906E |
| 125 | +
|
| 126 | + - name: Run Command |
| 127 | + run: composer ci:php:${{ matrix.command }} |
0 commit comments