From 022491543fb4b394a02bb15e669c70d3d7049967 Mon Sep 17 00:00:00 2001 From: Muhammad Syaiful Anwar <51133847+asiifdev@users.noreply.github.com> Date: Sat, 24 Jun 2023 09:54:25 +0700 Subject: [PATCH 1/4] Create laravel.yml --- .github/workflows/laravel.yml | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 .github/workflows/laravel.yml diff --git a/.github/workflows/laravel.yml b/.github/workflows/laravel.yml new file mode 100644 index 0000000..407dc3d --- /dev/null +++ b/.github/workflows/laravel.yml @@ -0,0 +1,35 @@ +name: Laravel + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +jobs: + laravel-tests: + + runs-on: ubuntu-latest + + steps: + - uses: shivammathur/setup-php@15c43e89cdef867065b0213be354c2841860869e + with: + php-version: '8.0' + - uses: actions/checkout@v3 + - 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: Create Database + run: | + mkdir -p database + touch database/database.sqlite + - name: Execute tests (Unit and Feature tests) via PHPUnit + env: + DB_CONNECTION: sqlite + DB_DATABASE: database/database.sqlite + run: vendor/bin/phpunit From 3dcc9ae63688563e4d18c7910df2fc77023a4617 Mon Sep 17 00:00:00 2001 From: Muhammad Syaiful Anwar <51133847+asiifdev@users.noreply.github.com> Date: Sat, 24 Jun 2023 11:21:27 +0700 Subject: [PATCH 2/4] Create fix-php-code-style-issues.yml --- .../workflows/fix-php-code-style-issues.yml | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 .github/workflows/fix-php-code-style-issues.yml diff --git a/.github/workflows/fix-php-code-style-issues.yml b/.github/workflows/fix-php-code-style-issues.yml new file mode 100644 index 0000000..097689b --- /dev/null +++ b/.github/workflows/fix-php-code-style-issues.yml @@ -0,0 +1,27 @@ +name: Fix PHP code style issues + +on: + push: + paths: + - '**.php' + +permissions: + contents: write + +jobs: + php-code-styling: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v3 + with: + ref: ${{ github.head_ref }} + + - name: Fix PHP code style issues + uses: aglipanci/laravel-pint-action@2.2.0 + + - name: Commit changes + uses: stefanzweifel/git-auto-commit-action@v4 + with: + commit_message: Fix styling From 0761fc84b1d8db3716f0d5dc66c9f393b52ba718 Mon Sep 17 00:00:00 2001 From: Muhammad Syaiful Anwar <51133847+asiifdev@users.noreply.github.com> Date: Sat, 24 Jun 2023 11:22:45 +0700 Subject: [PATCH 3/4] Update laravel.yml --- .github/workflows/laravel.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/laravel.yml b/.github/workflows/laravel.yml index 407dc3d..234c2b9 100644 --- a/.github/workflows/laravel.yml +++ b/.github/workflows/laravel.yml @@ -19,7 +19,7 @@ jobs: - 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 + run: composer install - name: Generate key run: php artisan key:generate - name: Directory Permissions From 1d0bd164b3602bfb9fcda2e362901ee1e926108d Mon Sep 17 00:00:00 2001 From: Muhammad Syaiful Anwar <51133847+asiifdev@users.noreply.github.com> Date: Sat, 24 Jun 2023 11:23:44 +0700 Subject: [PATCH 4/4] Update laravel.yml --- .github/workflows/laravel.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/laravel.yml b/.github/workflows/laravel.yml index 234c2b9..c4ca7d5 100644 --- a/.github/workflows/laravel.yml +++ b/.github/workflows/laravel.yml @@ -14,7 +14,7 @@ jobs: steps: - uses: shivammathur/setup-php@15c43e89cdef867065b0213be354c2841860869e with: - php-version: '8.0' + php-version: '8.1' - uses: actions/checkout@v3 - name: Copy .env run: php -r "file_exists('.env') || copy('.env.example', '.env');"