Skip to content

Commit 5aac298

Browse files
committed
feat(*) separated worklows
1 parent a013061 commit 5aac298

File tree

4 files changed

+64
-20
lines changed

4 files changed

+64
-20
lines changed

.github/workflows/deploy.yml

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,26 @@ jobs:
2727
script: |
2828
cd $SSH_BUILD_DIRECTORY
2929
30+
echo "Enabling maintenance mode"
31+
php artisan down
32+
3033
echo "Pulling latest code"
31-
sudo git checkout -f
32-
sudo git pull origin main
33-
sudo /usr/bin/php82 artisan migrate
34+
git checkout -f
35+
git pull origin master
36+
php artisan migrate
3437
3538
echo "Running composer"
36-
sudo /usr/bin/php82 /usr/bin/composer install --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist --optimize-autoloader
37-
sudo /usr/bin/php82 /usr/bin/composer dump-autoload
39+
composer install --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist --optimize-autoloader
40+
composer dump-autoload
41+
42+
echo "Running npm"
43+
npm install
44+
npm run production
3845
3946
echo "Optimizing Laravel app"
40-
sudo /usr/bin/php82 optimize
47+
php artisan config:cache
48+
php artisan route:cache
49+
php artisan view:cache
4150
42-
echo "Deployment to production completed"
51+
echo "Disabling maintenance mode"
52+
php artisan up

.github/workflows/phpfmt.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: PHP Code Formatting
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
phpfmt:
7+
runs-on: ubuntu-latest
8+
9+
steps:
10+
- name: Checkout Code
11+
uses: actions/checkout@v4
12+
13+
- name: Set up PHP
14+
uses: shivammathur/setup-php@v2
15+
with:
16+
php-version: 8.2
17+
18+
- name: Install Composer Dependencies
19+
run: composer install --no-progress --prefer-dist --optimize-autoloader
20+
21+
- name: Run PHPFMT
22+
run: ./vendor/bin/phpmd app,routes text codesize,controversial,design,naming,unusedcode

.github/workflows/ci.yml renamed to .github/workflows/phpunit.yml

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Laravel CI Test
1+
name: Laravel Feature Tests
22

33
on: [push, pull_request]
44

@@ -31,7 +31,6 @@ jobs:
3131
with:
3232
php-version: 8.2
3333
extensions: mbstring, bcmath, pdo, pdo_mysql
34-
coverage: none
3534

3635
- name: Install Composer Dependencies
3736
run: composer install --no-progress --prefer-dist --optimize-autoloader
@@ -50,16 +49,7 @@ jobs:
5049
DB_HOST: 127.0.0.1
5150
run: php artisan migrate --force
5251

53-
# Check PHP code formatting with PHPFMT
54-
- name: Run PHPFMT
55-
run: ./vendor/bin/phpmd app,routes text codesize,controversial,design,naming,unusedcode
56-
57-
# Static analysis using Larastan
58-
- name: Run Larastan
59-
run: ./vendor/bin/phpstan analyse app routes --memory-limit=2G
60-
61-
# Run PHPUnit Tests
62-
- name: Run PHPUnit Tests
52+
- name: Run Feature Tests
6353
env:
6454
DB_CONNECTION: mysql
6555
DB_DATABASE: testing_db
@@ -69,4 +59,4 @@ jobs:
6959
run: |
7060
php artisan config:clear
7161
php artisan cache:clear
72-
php artisan test --testsuite=Feature --stop-on-failure
62+
php artisan test --testsuite=Feature --stop-on-failure
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Static Analysis (Larastan)
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
larastan:
7+
runs-on: ubuntu-latest
8+
9+
steps:
10+
- name: Checkout Code
11+
uses: actions/checkout@v4
12+
13+
- name: Set up PHP
14+
uses: shivammathur/setup-php@v2
15+
with:
16+
php-version: 8.2
17+
18+
- name: Install Composer Dependencies
19+
run: composer install --no-progress --prefer-dist --optimize-autoloader
20+
21+
- name: Run Larastan
22+
run: ./vendor/bin/phpstan analyse app routes --memory-limit=2G

0 commit comments

Comments
 (0)