@@ -2,29 +2,49 @@ name: Build
22
33on :
44 push :
5- paths-ignore : ["*.md"]
5+ paths-ignore :
6+ - *.md
67 pull_request :
7- paths-ignore : ["*.md"]
8- branches : [main]
8+ paths-ignore :
9+ - *.md
10+ branches :
11+ - main
912
1013jobs :
1114 analysis :
15+
16+
1217 runs-on : ubuntu-latest
18+
19+
20+
1321 strategy :
1422 matrix :
15- php : [8.3]
23+ php : ['8.2', 8.3, '8.3', '8.4']
24+
25+
26+
1627 steps :
1728 - uses : actions/checkout@v4
29+
30+
31+
1832 - name : Setup PHP
1933 uses : shivammathur/setup-php@v2
2034 with :
2135 php-version : ${{ matrix.php }}
2236 extensions : dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, intl, gd, exif, iconv
2337 coverage : none
38+
39+
40+
2441 - name : Get Composer Cache Directory
2542 id : composer-cache
2643 run : |
2744 echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
45+
46+
47+
2848 - name : Cache composer dependencies
2949 uses : actions/cache@v4
3050 env :
@@ -34,32 +54,62 @@ jobs:
3454 key : php-${{ matrix.php }}-build-${{ env.cache-name }}-${{ hashFiles('**/composer.json') }}
3555 restore-keys : |
3656 php-${{ matrix.php }}-build-${{ env.cache-name }}-
57+
58+
59+
3760 - name : Install composer dependencies
3861 run : composer install --prefer-dist
62+
63+
64+
3965 - name : Run phpstan analysis
4066 run : composer phpstan-analysis
67+
68+
69+
4170 - name : Run phpmd analysis
4271 run : composer phpmd-analysis
72+
4373 test :
4474 name : Test (PHP ${{ matrix.php }})
45- needs : [analysis]
75+
76+
77+ needs :
78+ - analysis
79+
80+
4681 runs-on : ubuntu-latest
82+
83+
84+
4785 strategy :
4886 matrix :
4987 php : [8.0, 8.1, 8.2]
88+
89+
90+
5091 steps :
5192 - name : Checkout repository
5293 uses : actions/checkout@v4
94+
95+
96+
5397 - name : Set up PHP
5498 uses : shivammathur/setup-php@v2
5599 with :
56100 php-version : ${{ matrix.php }}
57101 extensions : dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, intl, gd, exif, iconv
58102 coverage : none
103+
104+
105+
59106 - name : Get Composer Cache Directory
60107 id : composer-cache
61108 run : |
62109 echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
110+
111+
112+
63113 - name : Cache composer dependencies
64114 uses : actions/cache@v4
65115 env :
@@ -69,41 +119,76 @@ jobs:
69119 key : php-${{ matrix.php }}-build-${{ env.cache-name }}-${{ hashFiles('**/composer.json') }}
70120 restore-keys : |
71121 php-${{ matrix.php }}-build-${{ env.cache-name }}-
122+
123+
124+
72125 - name : Install composer dependencies
73126 run : composer install --no-interaction --prefer-dist
127+
128+
129+
74130 - name : Run PHPUnit tests
75131 run : vendor/bin/phpunit
132+
76133 test-coverage :
77134 name : Test (PHP ${{ matrix.php }})
78- needs : [analysis]
135+
136+
137+ needs :
138+ - analysis
139+
140+
79141 runs-on : ubuntu-latest
142+
143+
144+
80145 strategy :
81146 matrix :
82- php : [8.3]
147+ php : ['8.2', 8.3, '8.3', '8.4']
148+
149+
150+
83151 steps :
84152 - name : Checkout repository
85153 uses : actions/checkout@v4
154+
155+
156+
86157 - name : Set up PHP
87158 uses : shivammathur/setup-php@v2
88159 with :
89160 php-version : ${{ matrix.php }}
90161 extensions : dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, intl, gd, exif, iconv
162+
163+
164+
91165 - name : Get Composer Cache Directory
92166 id : composer-cache
93167 run : |
94168 echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
169+
170+
171+
95172 - name : Cache composer dependencies
96173 uses : actions/cache@v4
97174 env :
98175 cache-name : laravel-i18n-test
99176 with :
100177 path : ${{ steps.composer-cache.outputs.dir }}
101178 key : php-${{ matrix.php }}-build-${{ env.cache-name }}-${{ hashFiles('**/composer.json') }}
102- restore-keys : |
103- php-${{ matrix.php }}-build-${{ env.cache-name }}-
179+ restore-keys : php-${{ matrix.php }}-build-${{ env.cache-name }}-
180+
181+
182+
104183 - name : Install composer dependencies
105184 run : composer install --no-interaction --prefer-dist
185+
186+
187+
106188 - name : Run PHPUnit tests and generate code coverage
107189 run : vendor/bin/phpunit --coverage-clover=clover.xml
190+
191+
192+
108193 - name : Upload code coverage results
109194 run : bash <(curl -s https://codecov.io/bash)
0 commit comments