Skip to content

Commit 0b39b62

Browse files
committed
feat: Remove CircleCI and replace with GH workflow
1 parent 8b71a48 commit 0b39b62

File tree

4 files changed

+87
-38
lines changed

4 files changed

+87
-38
lines changed

.circleci/config.yml

Lines changed: 0 additions & 37 deletions
This file was deleted.
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: build_and_test
2+
on:
3+
push:
4+
branches: [ main, develop, feature/pre-new-admin ]
5+
pull_request:
6+
branches: [ main, develop, feature/pre-new-admin ]
7+
8+
jobs:
9+
test:
10+
name: PHP ${{ matrix.php-version }} Test
11+
runs-on: ubuntu-latest
12+
strategy:
13+
matrix:
14+
php-version: [ '8.1', '8.2', '8.3', '8.4' ]
15+
fail-fast: false # Continue with other versions even if one fails
16+
17+
steps:
18+
- name: Checkout code
19+
uses: actions/checkout@v2
20+
21+
- name: Setup PHP ${{ matrix.php-version }}
22+
uses: shivammathur/setup-php@v2
23+
with:
24+
php-version: ${{ matrix.php-version }}
25+
26+
- name: Cache Composer dependencies
27+
uses: actions/cache@v4
28+
with:
29+
path: vendor
30+
key: ${{ runner.os }}-php-${{ matrix.php-version }}-composer-${{ hashFiles('**/composer.json') }}
31+
restore-keys: |
32+
${{ runner.os }}-php-${{ matrix.php-version }}-composer-
33+
34+
- name: Install Composer dependencies
35+
run: composer update
36+
37+
- name: Run tests
38+
run: composer test
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: static_analysis
2+
on:
3+
pull_request:
4+
# Run on push, but only if PHP files have changed
5+
push:
6+
branches: [ main, develop, feature/pre-new-admin ]
7+
paths:
8+
- '**.php'
9+
- 'composer.json'
10+
- 'composer.lock'
11+
- 'phpstan.neon'
12+
- '.github/workflows/static_analysis.yml'
13+
14+
env:
15+
GITHUB_ACTIONS_NOTIFY_ON_FAILURE: false
16+
17+
jobs:
18+
phpstan:
19+
name: Static Analysis
20+
runs-on: ubuntu-latest
21+
steps:
22+
- name: Checkout code
23+
uses: actions/checkout@v2
24+
25+
- name: Setup PHP
26+
uses: shivammathur/setup-php@v2
27+
with:
28+
php-version: '8.4'
29+
30+
- name: Cache Composer dependencies
31+
uses: actions/cache@v4
32+
with:
33+
path: vendor
34+
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
35+
restore-keys: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
36+
37+
- name: Install Composer dependencies
38+
run: composer update --no-interaction --prefer-dist
39+
40+
- name: Run PHPStan
41+
run: composer analyse
42+
continue-on-error: true

composer.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,13 @@
3535
},
3636
"require-dev":
3737
{
38-
"phpunit/phpunit": "9.*"
38+
"phpunit/phpunit": "9.*",
39+
"phpstan/phpstan": "1.*"
40+
},
41+
"scripts":
42+
{
43+
"test": "./vendor/bin/phpunit",
44+
"analyse": "./vendor/bin/phpstan analyse -c .phpstan/config.neon"
3945
},
4046
"autoload":
4147
{

0 commit comments

Comments
 (0)