@@ -2,64 +2,142 @@ name: Continuous Integration
22
33on :
44 push :
5- branches : [main]
5+ branches :
6+ - main
7+ paths-ignore :
8+ - " **.md"
9+ - " renovate.json"
10+ - " .github/ISSUE_TEMPLATE/**"
11+ - " .github/workflows/release.yml"
12+
613 pull_request :
14+ paths-ignore :
15+ - " **.md"
16+ - " renovate.json"
17+ - " .github/ISSUE_TEMPLATE/**"
18+ - " .github/workflows/release.yml"
719
820concurrency :
921 group : ${{ github.workflow }}-${{ github.ref }}
1022 cancel-in-progress : true
1123
1224jobs :
13- static-analysis :
25+ coding-standards :
26+ name : Coding Standards
1427 runs-on : ubuntu-latest
28+
1529 steps :
16- - uses : actions/checkout@v6
30+ - name : Checkout
31+ uses : actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
1732 with :
1833 fetch-depth : 0
1934 show-progress : false
20- - uses : shivammathur/setup-php@44454db4f0199b8b9685a5d763dc37cbf79108e1
35+
36+ - name : Setup PHP
37+ uses : shivammathur/setup-php@44454db4f0199b8b9685a5d763dc37cbf79108e1 # 2.36.0
2138 with :
22- php-version : ' 8.4 '
39+ php-version : ' latest '
2340 tools : composer
24- extensions : xdebug
25- - uses : actions/cache@v4
41+ coverage : none
42+
43+ - name : Composer Install
44+ uses : ramsey/composer-install@3cf229dc2919194e9e36783941438d17239e8520 # v3.1.1
45+
46+ - name : Check Syntax
47+ run : composer dev:lint:syntax
48+
49+ - name : Check Code Style
50+ run : composer dev:lint:style
51+
52+ static-analysis :
53+ name : Static Analysis
54+ runs-on : ubuntu-latest
55+
56+ steps :
57+ - name : Checkout
58+ uses : actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
2659 with :
27- path : |
28- vendor
29- ~/.composer/cache
30- key : composer-${{ runner.os }}-${{ hashFiles('**/composer.lock') }}
31- restore-keys : composer-${{ runner.os }}-
32- - run : composer install --quiet --no-ansi --no-interaction --no-progress --prefer-dist
33- - run : composer normalize --dry-run
34- - run : composer validate
35- - run : composer phpstan -- --ansi
36- - run : composer psalm
60+ fetch-depth : 0
61+ show-progress : false
3762
38- unit-tests :
39- needs : [static-analysis]
63+ - name : Setup PHP
64+ uses : shivammathur/setup-php@44454db4f0199b8b9685a5d763dc37cbf79108e1 # 2.36.0
65+ with :
66+ php-version : ' latest'
67+ tools : composer
68+ coverage : none
69+
70+ - name : Composer Install
71+ uses : ramsey/composer-install@3cf229dc2919194e9e36783941438d17239e8520 # v3.1.1
72+
73+ - name : Run Static Analysis
74+ run : composer dev:analyze:phpstan
75+
76+ code-coverage :
77+ name : Code Coverage
78+ needs : [coding-standards, static-analysis]
4079 runs-on : ubuntu-latest
80+
4181 steps :
42- - uses : actions/checkout@v6
82+ - name : Checkout
83+ uses : actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
4384 with :
4485 fetch-depth : 0
4586 show-progress : false
46- - uses : shivammathur/setup-php@44454db4f0199b8b9685a5d763dc37cbf79108e1
87+
88+ - name : Setup PHP
89+ uses : shivammathur/setup-php@44454db4f0199b8b9685a5d763dc37cbf79108e1 # 2.36.0
4790 with :
48- php-version : ' 8.4 '
91+ php-version : ' latest '
4992 tools : composer
93+ extensions : gmp
5094 coverage : xdebug
51- - uses : actions/cache@v4
52- with :
53- path : |
54- vendor
55- ~/.composer/cache
56- key : composer-${{ runner.os }}-${{ hashFiles('**/composer.lock') }}
57- restore-keys : composer-${{ runner.os }}-
58- - run : composer install --quiet --no-ansi --no-interaction --no-progress --prefer-dist
59- - run : composer normalize --dry-run
60- - run : composer validate
61- - run : vendor/bin/phpunit || true
62- - uses : SonarSource/sonarqube-scan-action@a31c9398be7ace6bbfaf30c0bd5d415f843d45e9
95+
96+ - name : Composer Install
97+ uses : ramsey/composer-install@3cf229dc2919194e9e36783941438d17239e8520 # v3.1.1
98+
99+ - name : Run Tests with Coverage
100+ run : composer dev:test:coverage:ci
101+
102+ - name : Upload to SonarCloud
103+ uses : SonarSource/sonarqube-scan-action@a31c9398be7ace6bbfaf30c0bd5d415f843d45e9 # 7.0.0
63104 env :
64- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
65- SONAR_TOKEN : ${{ secrets.SONAR_TOKEN }}
105+ SONAR_TOKEN : ${{ secrets.SONAR_TOKEN }}
106+
107+ unit-tests :
108+ name : Unit Tests
109+ needs : [coding-standards, static-analysis]
110+ runs-on : ${{ matrix.os }}
111+
112+ strategy :
113+ fail-fast : false
114+ matrix :
115+ php-version : ['8.2', '8.3', '8.4', '8.5']
116+ os : [ubuntu-latest, windows-latest]
117+
118+ steps :
119+ - name : Configure Git for Windows
120+ if : ${{ matrix.os == 'windows-latest' }}
121+ run : |
122+ git config --system core.autocrlf false
123+ git config --system core.eol lf
124+
125+ - name : Checkout
126+ uses : actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
127+ with :
128+ fetch-depth : 0
129+ show-progress : false
130+
131+ - name : Setup PHP
132+ uses : shivammathur/setup-php@44454db4f0199b8b9685a5d763dc37cbf79108e1 # 2.36.0
133+ with :
134+ php-version : ${{ matrix.php-version }}
135+ tools : composer
136+ extensions : gmp
137+ coverage : none
138+
139+ - name : Composer Install
140+ uses : ramsey/composer-install@3cf229dc2919194e9e36783941438d17239e8520 # v3.1.1
141+
142+ - name : Run Unit Tests
143+ run : composer dev:test:unit
0 commit comments