-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
83211a4
commit af6789f
Showing
8 changed files
with
170 additions
and
53 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
name: Codecov | ||
|
||
on: | ||
push: | ||
branches: [ "main" ] | ||
paths: | ||
- 'src/**.php' | ||
- '.github/workflows/codecov.yml' | ||
pull_request: | ||
branches: [ "main" ] | ||
paths: | ||
- 'src/**.php' | ||
- '.github/workflows/codecov.yml' | ||
|
||
defaults: | ||
run: | ||
working-directory: src | ||
|
||
concurrency: | ||
group: "${{ github.workflow_ref }}-${{ github.ref }}" | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
codecov: | ||
strategy: | ||
matrix: | ||
php-version: [8.3] | ||
os: [ubuntu-latest] | ||
runs-on: {{ matrix.os }} | ||
|
||
steps: | ||
- uses: shivammathur/setup-php@9e72090525849c5e82e596468b86eb55e9cc5401 | ||
with: | ||
php-version: ${{ matrix.php-version }} | ||
|
||
- name: Checkout | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Get Composer cache directory | ||
id: composer-cache | ||
run: | | ||
composer validate --strict | ||
echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT | ||
- name: Cache dependencies | ||
uses: actions/[email protected] | ||
with: | ||
path: | | ||
${{ steps.composer-cache.outputs.dir }} | ||
src/vendor | ||
src/node_modules | ||
key: vl-${{ matrix.os }}-php${{ matrix.php-version }}-${{ hashFiles('composer.json', 'composer.lock', 'package.json', 'package.lock') }} | ||
|
||
- name: Prepare Env. | ||
run: | | ||
# Copy .env, Generate key, Set directory permissions, Create empty SQLite DB | ||
php -r "file_exists('.env') || copy('.env.example', '.env');" | ||
php artisan key:generate | ||
chmod -R 777 storage storage/database bootstrap/cache | ||
mkdir -p storage/database | ||
rm -f storage/database/visual-laravel.sqlite | ||
touch storage/database/visual-laravel.sqlite | ||
- name: Install Dependencies | ||
run: | | ||
composer self-update && composer install --no-interaction --no-progress --prefer-dist | ||
npm run build | ||
- name: Run coverage tests | ||
env: | ||
DB_CONNECTION: sqlite | ||
run: vendor/bin/phpunit --coverage-clover coverage.xml . | ||
|
||
- name: Upload coverage to Codecov | ||
uses: codecov/codecov-action@v5 | ||
env: | ||
CODECOV_TOKEN: ${{ secrets.CODECOV_ORG_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,48 +1,72 @@ | ||
name: Laravel-Tests | ||
name: Run Tests | ||
|
||
on: | ||
push: | ||
branches: [ "main" ] | ||
paths: | ||
- 'src/**.php' | ||
- '.github/workflows/laravel-tests.yml' | ||
pull_request: | ||
branches: [ "main" ] | ||
paths: | ||
- 'src/**.php' | ||
- '.github/workflows/laravel-tests.yml' | ||
|
||
defaults: | ||
run: | ||
working-directory: src | ||
|
||
concurrency: | ||
group: "${{ github.workflow_ref }}-${{ github.ref }}" | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
laravel-tests: | ||
runs-on: ubuntu-latest | ||
tests: | ||
strategy: | ||
matrix: | ||
php-version: [8.2, 8.3, 8.4] | ||
os: [ubuntu-latest] | ||
runs-on: {{ matrix.os }} | ||
|
||
steps: | ||
- uses: shivammathur/setup-php@15c43e89cdef867065b0213be354c2841860869e | ||
with: | ||
php-version: '8.3' | ||
|
||
- name: Checkout | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Cache composer and npm | ||
uses: actions/[email protected] | ||
with: | ||
path: | | ||
vendor | ||
node_modules | ||
key: vl-${{ runner.os }}-${{ hashFiles('composer.json', 'composer.lock', 'package.json', 'package.lock') }} | ||
|
||
- 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 empty database | ||
run: | | ||
mkdir -p storage | ||
touch database/database.sqlite | ||
- name: Execute tests (Unit and Feature tests) via PHPUnit/Pest | ||
env: | ||
DB_CONNECTION: sqlite | ||
DB_DATABASE: storage/database/tests.sqlite | ||
run: php artisan test | ||
- uses: shivammathur/setup-php@9e72090525849c5e82e596468b86eb55e9cc5401 | ||
with: | ||
php-version: ${{ matrix.php-version }} | ||
|
||
- name: Checkout | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Get Composer cache directory | ||
id: composer-cache | ||
run: | | ||
composer validate --strict | ||
echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT | ||
- name: Cache dependencies | ||
uses: actions/[email protected] | ||
with: | ||
path: | | ||
${{ steps.composer-cache.outputs.dir }} | ||
src/vendor | ||
src/node_modules | ||
key: vl-${{ matrix.os }}-php${{ matrix.php-version }}-${{ hashFiles('composer.json', 'composer.lock', 'package.json', 'package.lock') }} | ||
|
||
- name: Prepare Env. | ||
run: | | ||
# Copy .env, Generate key, Set directory permissions, Create empty SQLite DB | ||
php -r "file_exists('.env') || copy('.env.example', '.env');" | ||
php artisan key:generate | ||
chmod -R 777 storage storage/database bootstrap/cache | ||
mkdir -p storage/database | ||
rm -f storage/database/visual-laravel.sqlite | ||
touch storage/database/visual-laravel.sqlite | ||
- name: Install Dependencies | ||
run: | | ||
composer self-update && composer install --no-interaction --no-progress --prefer-dist | ||
npm run build | ||
- name: Run PHPUnit/Pest tests | ||
env: | ||
DB_CONNECTION: sqlite | ||
run: php artisan test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
/.fleet | ||
/.idea | ||
/.nova | ||
/.vscode | ||
/.zed |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,3 +21,6 @@ yarn-error.log | |
/.nova | ||
/.vscode | ||
/.zed | ||
|
||
/composer.lock | ||
/package-lock.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,26 @@ | ||
import { defineConfig } from 'vite' | ||
import { codecovVitePlugin } from "@codecov/vite-plugin"; | ||
import laravel, { refreshPaths } from 'laravel-vite-plugin' | ||
|
||
export default defineConfig({ | ||
plugins: [ | ||
laravel({ | ||
input: ['resources/css/app.css', 'resources/js/app.js'], | ||
input: ['VisualLaravel/Core/resources/css/app.css', 'VisualLaravel/Core/resources/js/app.js'], | ||
refresh: [ | ||
...refreshPaths, | ||
'VisualLaravel/core/Filament/**', | ||
'VisualLaravel/core/Forms/Components/**', | ||
'VisualLaravel/core/Livewire/**', | ||
'VisualLaravel/core/Infolists/Components/**', | ||
'VisualLaravel/core/Providers/Filament/**', | ||
'VisualLaravel/core/Tables/Columns/**', | ||
'VisualLaravel/Base/Filament/**', | ||
'VisualLaravel/Base/Providers/Filament/**', | ||
'VisualLaravel/Core/Forms/Components/**', | ||
'VisualLaravel/Core/Livewire/**', | ||
'VisualLaravel/Core/Infolists/Components/**', | ||
'VisualLaravel/Core/Tables/Columns/**', | ||
], | ||
}), | ||
// Put the Codecov vite plugin after all other plugins | ||
codecovVitePlugin({ | ||
enableBundleAnalysis: process.env.CODECOV_TOKEN !== undefined, | ||
bundleName: "Visual-Laravel-Vite-Bundle", | ||
uploadToken: process.env.CODECOV_TOKEN, | ||
}), | ||
], | ||
}) |