Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 53 additions & 0 deletions .github/workflows/fresh-install-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Laravel Test Fresh Install

on: workflow_dispatch

jobs:
laravel-tests-fresh-install:

runs-on: ubuntu-latest
services:
mysql:
image: mysql:8.0
env:
MYSQL_DATABASE: testing_db
MYSQL_ROOT_PASSWORD: secret
ports:
- 3306:3306
options: >-
--health-cmd="mysqladmin ping --silent"
--health-interval=10s
--health-timeout=5s
--health-retries=3

steps:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, tidy
coverage: none

- uses: actions/checkout@v4
- name: Copy .env
run: php -r "file_exists('.env') || copy('.env.example', '.env');"

- name: Install Dependencies
run: composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist

- name: Generate key
run: php artisan key:generate

- name: Directory Permissions
run: chmod -R 777 storage bootstrap/cache

- name: Wait for MySQL
run: sleep 15

- name: Execute tests (Unit and Feature tests) via PHPUnit/Pest
env:
DB_CONNECTION: mysql
DB_DATABASE: testing_db
DB_USERNAME: root
DB_PASSWORD: secret
run: php artisan migrate --seed && php artisan test
59 changes: 59 additions & 0 deletions .github/workflows/update-versi-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Laravel Update Versi Test

on: workflow_dispatch

jobs:
laravel-tests-update-versi:
runs-on: ubuntu-latest
services:
mysql:
image: mysql:8.0
env:
MYSQL_DATABASE: testing_db
MYSQL_ROOT_PASSWORD: secret
ports:
- 3306:3306
options: >-
--health-cmd="mysqladmin ping --silent"
--health-interval=10s
--health-timeout=5s
--health-retries=3

steps:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, tidy
coverage: none

- uses: actions/checkout@v4

- name: Copy .env
run: php -r "file_exists('.env') || copy('.env.example', '.env');"

- name: Install Dependencies
run: composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist

- name: Directory Permissions
run: chmod -R 777 storage bootstrap/cache

- name: Extract database testing
run: |
tar -xzf database/database_test.sql.tar.gz -C database

- name: Wait for MySQL
run: sleep 15

- name: Import SQL file into MySQL
run: |
mysql -h 127.0.0.1 -P 3306 -u root -psecret testing_db < ./database/database_test.sql

- name: Execute tests (Unit and Feature tests) via PHPUnit/Pest
env:
DB_CONNECTION: mysql
DB_DATABASE: testing_db
DB_USERNAME: root
DB_PASSWORD: secret

run: php artisan migrate && php artisan test