Skip to content

Commit fa35c30

Browse files
author
farhadzand
committed
chore: add Dependabot configuration and update GitHub Actions workflows
- Introduced a new Dependabot configuration for daily updates on Composer dependencies. - Renamed the code style workflow to "Coding Standards" and updated branch patterns for push and pull requests. - Refactored the code style workflow to include PHP linting using Laravel Pint and automated commit of changes. - Added a new workflow for local testing with RabbitMQ integration and PHP 8.3 support.
1 parent ef0d90e commit fa35c30

File tree

3 files changed

+119
-48
lines changed

3 files changed

+119
-48
lines changed

.github/dependabot.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: composer
4+
directory: "/"
5+
schedule:
6+
interval: daily
7+
open-pull-requests-limit: 10

.github/workflows/code-style.yml

Lines changed: 28 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,32 @@
1-
name: Code Style
1+
name: Coding Standards
22

33
on:
4-
push:
5-
branches: [ master, develop ]
6-
pull_request:
7-
branches: [ master, develop ]
4+
push:
5+
branches:
6+
- '*'
7+
pull_request:
8+
branches:
9+
- '*'
10+
11+
env:
12+
COMPOSER_PROCESS_TIMEOUT: 0
13+
COMPOSER_NO_INTERACTION: 1
14+
COMPOSER_NO_AUDIT: 1
815

916
jobs:
10-
code-style:
11-
runs-on: ubuntu-latest
12-
13-
name: Code Style Check
14-
15-
steps:
16-
- name: Checkout code
17-
uses: actions/checkout@v4
18-
19-
- name: Setup PHP
20-
uses: shivammathur/setup-php@v2
21-
with:
22-
php-version: 8.3
23-
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick
24-
coverage: none
25-
26-
- name: Install dependencies
27-
run: composer install --prefer-dist --no-interaction --no-progress
28-
29-
- name: Check code style
30-
run: vendor/bin/pint --test
31-
32-
static-analysis:
33-
runs-on: ubuntu-latest
34-
35-
name: Static Analysis
36-
37-
steps:
38-
- name: Checkout code
39-
uses: actions/checkout@v4
40-
41-
- name: Setup PHP
42-
uses: shivammathur/setup-php@v2
43-
with:
44-
php-version: 8.3
45-
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick
46-
coverage: none
47-
48-
- name: Install dependencies
49-
run: composer install --prefer-dist --no-interaction --no-progress
50-
51-
- name: Run PHPStan
52-
run: vendor/bin/phpstan analyse --memory-limit=2G --no-progress
17+
phplint:
18+
permissions:
19+
contents: write
20+
runs-on: ubuntu-latest
21+
steps:
22+
- uses: actions/checkout@v3
23+
- name: "laravel-pint"
24+
uses: aglipanci/laravel-pint-action@latest
25+
with:
26+
configPath: './pint.json'
27+
28+
- name: Commit changes
29+
uses: stefanzweifel/git-auto-commit-action@v4
30+
with:
31+
commit_message: PHP Linting (Pint)
32+
skip_fetch: true

.github/workflows/test-local.yml

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
name: Local Tests
2+
3+
on:
4+
push:
5+
branches: [ master, develop ]
6+
pull_request:
7+
branches: [ master, develop ]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
13+
strategy:
14+
fail-fast: false
15+
matrix:
16+
php: [8.3]
17+
laravel: [12.*]
18+
stability: [prefer-stable]
19+
include:
20+
- laravel: 12.*
21+
testbench: 10.*
22+
23+
name: PHP ${{ matrix.php }} - Laravel ${{ matrix.laravel }} - ${{ matrix.stability }}
24+
25+
services:
26+
rabbitmq:
27+
image: rabbitmq:3-management
28+
env:
29+
RABBITMQ_DEFAULT_USER: laravel
30+
RABBITMQ_DEFAULT_PASS: secret
31+
RABBITMQ_DEFAULT_VHOST: b2b-field
32+
ports:
33+
- 5673:5672
34+
- 15673:15672
35+
options: >-
36+
--health-cmd "rabbitmq-diagnostics -q ping"
37+
--health-interval 10s
38+
--health-timeout 5s
39+
--health-retries 10
40+
--health-start-period 30s
41+
42+
steps:
43+
- name: Checkout code
44+
uses: actions/checkout@v4
45+
46+
- name: Setup PHP
47+
uses: shivammathur/setup-php@v2
48+
with:
49+
php-version: ${{ matrix.php }}
50+
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, fileinfo, amqp
51+
coverage: none
52+
53+
- name: Install dependencies
54+
run: |
55+
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update
56+
composer update --${{ matrix.stability }} --prefer-dist --no-interaction
57+
58+
- name: Wait for RabbitMQ
59+
run: |
60+
echo "Waiting for RabbitMQ to be ready..."
61+
for i in {1..30}; do
62+
if curl -f http://localhost:15673/api/overview -u laravel:secret >/dev/null 2>&1; then
63+
echo "RabbitMQ is ready!"
64+
break
65+
fi
66+
echo "Attempt $i/30: RabbitMQ not ready yet, waiting..."
67+
sleep 2
68+
done
69+
70+
- name: Verify RabbitMQ
71+
run: |
72+
echo "RabbitMQ Status:"
73+
curl -u laravel:secret http://localhost:15673/api/overview 2>/dev/null | jq -r '.rabbitmq_version // "Unable to get version"'
74+
echo "Available vhosts:"
75+
curl -u laravel:secret http://localhost:15673/api/vhosts 2>/dev/null | jq -r '.[].name // "Unable to get vhosts"'
76+
77+
- name: Run tests
78+
env:
79+
RABBITMQ_HOST: 127.0.0.1
80+
RABBITMQ_PORT: 5673
81+
RABBITMQ_USER: laravel
82+
RABBITMQ_PASSWORD: secret
83+
RABBITMQ_VHOST: b2b-field
84+
run: ./vendor/bin/pest

0 commit comments

Comments
 (0)