Skip to content

Commit df40934

Browse files
committed
Update CI
1 parent e619639 commit df40934

File tree

1 file changed

+51
-43
lines changed

1 file changed

+51
-43
lines changed

.github/workflows/ci.yml

Lines changed: 51 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -2,37 +2,49 @@ name: CI
22

33
on:
44
push:
5-
branches: [ main, develop ]
5+
branches: [ main, master, develop ]
66
pull_request:
7-
branches: [ main, develop ]
7+
branches: [ main, master, develop ]
88

99
jobs:
1010
test:
11-
name: PHP ${{ matrix.php-version }} - ${{ matrix.os }}
11+
name: PHP Tests - ${{ matrix.os }}
1212
runs-on: ${{ matrix.os }}
1313

1414
strategy:
1515
fail-fast: false
1616
matrix:
1717
os: [ubuntu-latest, windows-latest, macos-latest]
18-
php-version: ['8.0', '8.1', '8.2']
1918

2019
steps:
2120
- uses: actions/checkout@v4
2221

23-
- name: Setup PHP
24-
uses: shivammathur/setup-php@v2
25-
with:
26-
php-version: ${{ matrix.php-version }}
27-
extensions: json
28-
coverage: xdebug
29-
tools: composer:v2
22+
# PHP installation and setup using built-in tools
23+
- name: Setup PHP (Ubuntu/macOS)
24+
if: matrix.os != 'windows-latest'
25+
run: |
26+
sudo apt-get update || brew install [email protected]
27+
sudo apt-get install -y php8.2-cli php8.2-xml php8.2-curl || true
28+
php -v
29+
30+
- name: Setup PHP (Windows)
31+
if: matrix.os == 'windows-latest'
32+
run: |
33+
choco install php --version=8.2
34+
php -v
35+
36+
- name: Install Composer
37+
run: |
38+
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
39+
php composer-setup.php --install-dir=/usr/local/bin --filename=composer
40+
php -r "unlink('composer-setup.php');"
41+
shell: bash
3042

3143
- name: Validate composer.json
3244
run: composer validate --strict
45+
shell: bash
3346

3447
- name: Cache Composer packages
35-
id: composer-cache
3648
uses: actions/cache@v3
3749
with:
3850
path: vendor
@@ -42,13 +54,26 @@ jobs:
4254
4355
- name: Install dependencies
4456
run: composer install --prefer-dist --no-progress
57+
shell: bash
4558

4659
- name: Run test suite
4760
run: vendor/bin/phpunit --coverage-text
61+
shell: bash
4862

4963
- name: Verify binary installation
5064
run: |
5165
php -r "require 'vendor/autoload.php'; new VoltTest\Platform();"
66+
shell: bash
67+
68+
- name: Upload test artifacts
69+
if: always()
70+
uses: actions/upload-artifact@v3
71+
with:
72+
name: test-results-${{ matrix.os }}
73+
path: |
74+
./build/logs
75+
./phpunit.xml
76+
./coverage.xml
5277
5378
static-analysis:
5479
name: Static Analysis
@@ -57,17 +82,18 @@ jobs:
5782
steps:
5883
- uses: actions/checkout@v4
5984

60-
- name: Setup PHP
61-
uses: shivammathur/setup-php@v2
62-
with:
63-
php-version: '8.2'
64-
tools: composer:v2, phpstan
85+
- name: Setup PHP and tools
86+
run: |
87+
sudo apt-get update
88+
sudo apt-get install -y php8.2-cli php8.2-xml
89+
curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
90+
composer global require phpstan/phpstan
6591
6692
- name: Install dependencies
6793
run: composer install --prefer-dist --no-progress
6894

6995
- name: Run PHPStan
70-
run: phpstan analyse src tests --level=5
96+
run: ~/.composer/vendor/bin/phpstan analyse src tests --level=5
7197

7298
code-style:
7399
name: Code Style
@@ -76,30 +102,12 @@ jobs:
76102
steps:
77103
- uses: actions/checkout@v4
78104

79-
- name: Setup PHP
80-
uses: shivammathur/setup-php@v2
81-
with:
82-
php-version: '8.2'
83-
tools: composer:v2, php-cs-fixer
105+
- name: Setup PHP and tools
106+
run: |
107+
sudo apt-get update
108+
sudo apt-get install -y php8.2-cli php8.2-xml
109+
curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
110+
composer global require friendsofphp/php-cs-fixer
84111
85112
- name: Check coding standards
86-
run: php-cs-fixer fix --dry-run --diff
87-
88-
security-check:
89-
name: Security Check
90-
runs-on: ubuntu-latest
91-
92-
steps:
93-
- uses: actions/checkout@v4
94-
95-
- name: Setup PHP
96-
uses: shivammathur/setup-php@v2
97-
with:
98-
php-version: '8.2'
99-
tools: composer:v2
100-
101-
- name: Install dependencies
102-
run: composer install --prefer-dist --no-progress
103-
104-
- name: Security check
105-
uses: symfonycorp/security-checker-action@v4
113+
run: ~/.composer/vendor/bin/php-cs-fixer fix --dry-run --diff

0 commit comments

Comments
 (0)