From 7655898b4ac81743eb5126cc6fe2ec4bea8da0d0 Mon Sep 17 00:00:00 2001 From: "M. D" Date: Sat, 15 Jun 2024 19:42:05 +0200 Subject: [PATCH 1/7] Create ci --- .github/workflows/ci | 45 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 .github/workflows/ci diff --git a/.github/workflows/ci b/.github/workflows/ci new file mode 100644 index 00000000..ed499059 --- /dev/null +++ b/.github/workflows/ci @@ -0,0 +1,45 @@ +name: CI + +on: + push: + branches: + - main + pull_request: + branches: + - main + +jobs: + run-tests: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Set up PHP + uses: shivammathur/setup-php@v2 + with: + php-version: '8.2' + + - name: Install dependencies + run: composer install --prefer-dist --no-progress --no-suggest --no-interaction + + - name: Copy .env file + run: cp .env.example .env + + - name: Generate application key + run: php artisan key:generate + + - name: Configure database + run: | + php artisan config:clear + php artisan config:cache + touch database/database.sqlite + + - name: Run migrations + run: | + php artisan migrate --force + php artisan db:seed + + - name: Run tests + run: vendor/bin/phpunit From 2fb8e4351a0c1fb54a2aeb9e5943a371af3c05c8 Mon Sep 17 00:00:00 2001 From: "M. D" Date: Sat, 15 Jun 2024 19:44:08 +0200 Subject: [PATCH 2/7] Update ci --- .github/workflows/ci | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/workflows/ci b/.github/workflows/ci index ed499059..7fc998ad 100644 --- a/.github/workflows/ci +++ b/.github/workflows/ci @@ -2,11 +2,6 @@ name: CI on: push: - branches: - - main - pull_request: - branches: - - main jobs: run-tests: From 1ecf864f1ccd6b68dcf2c1d0a95d7bc1af0dcebe Mon Sep 17 00:00:00 2001 From: "M. D" Date: Sat, 15 Jun 2024 19:46:10 +0200 Subject: [PATCH 3/7] Rename ci to ci.yml --- .github/workflows/{ci => ci.yml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{ci => ci.yml} (100%) diff --git a/.github/workflows/ci b/.github/workflows/ci.yml similarity index 100% rename from .github/workflows/ci rename to .github/workflows/ci.yml From bc75102c4f545a4774d47b70cea66b31fe046d00 Mon Sep 17 00:00:00 2001 From: "M. D" Date: Sat, 15 Jun 2024 19:48:40 +0200 Subject: [PATCH 4/7] Update ci.yml --- .github/workflows/ci.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7fc998ad..045b404a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,9 +19,6 @@ jobs: - name: Install dependencies run: composer install --prefer-dist --no-progress --no-suggest --no-interaction - - name: Copy .env file - run: cp .env.example .env - - name: Generate application key run: php artisan key:generate From 4dee616ec547343eb9cad9f67582789360482105 Mon Sep 17 00:00:00 2001 From: "M. D" Date: Sat, 15 Jun 2024 20:01:38 +0200 Subject: [PATCH 5/7] Update ci.yml --- .github/workflows/ci.yml | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 045b404a..b60ab0a8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,22 +16,19 @@ jobs: with: php-version: '8.2' - - name: Install dependencies + - name: Clone Filament project + run: git clone https://github.com/dissto/filament-resource-tests.git filament-project + + - name: Install Filament project dependencies run: composer install --prefer-dist --no-progress --no-suggest --no-interaction - - - name: Generate application key - run: php artisan key:generate - - - name: Configure database + working-directory: ./filament-project + + - name: Link package run: | - php artisan config:clear - php artisan config:cache - touch database/database.sqlite - - - name: Run migrations - run: | - php artisan migrate --force - php artisan db:seed - + composer config repositories.filament-resource-tests path ../ + composer require dissto/filament-resource-tests:dev-main + working-directory: ./filament-project + - name: Run tests run: vendor/bin/phpunit + working-directory: ./filament-project From 602b4705fc288967d765a810617f23d2fef4bcb4 Mon Sep 17 00:00:00 2001 From: "M. D" Date: Sat, 15 Jun 2024 20:05:15 +0200 Subject: [PATCH 6/7] Update ci.yml --- .github/workflows/ci.yml | 73 ++++++++++++++++++++++++++-------------- 1 file changed, 48 insertions(+), 25 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b60ab0a8..f70548e1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,33 +2,56 @@ name: CI on: push: + branches: + - main + pull_request: + branches: + - main jobs: run-tests: runs-on: ubuntu-latest - + steps: - - name: Checkout code - uses: actions/checkout@v2 - - - name: Set up PHP - uses: shivammathur/setup-php@v2 - with: - php-version: '8.2' - - - name: Clone Filament project - run: git clone https://github.com/dissto/filament-resource-tests.git filament-project - - - name: Install Filament project dependencies - run: composer install --prefer-dist --no-progress --no-suggest --no-interaction - working-directory: ./filament-project - - - name: Link package - run: | - composer config repositories.filament-resource-tests path ../ - composer require dissto/filament-resource-tests:dev-main - working-directory: ./filament-project - - - name: Run tests - run: vendor/bin/phpunit - working-directory: ./filament-project + - name: Checkout code + uses: actions/checkout@v2 + + - name: Set up PHP + uses: shivammathur/setup-php@v2 + with: + php-version: '8.2' + + - name: Install Composer + run: sudo apt-get update && sudo apt-get install -y composer + + - name: Clone test project + run: git clone https://github.com/dissto/filament-tests-test-project.git test-project + + - name: Install test project dependencies + run: composer install --prefer-dist --no-progress --no-suggest --no-interaction + working-directory: ./test-project + + - name: Copy .env file + run: cp .env.example .env || touch .env + working-directory: ./test-project + + - name: Generate application key + run: php artisan key:generate + working-directory: ./test-project + + - name: Configure database + run: | + php artisan config:clear + php artisan config:cache + touch database/database.sqlite + working-directory: ./test-project + + - name: Run migrations + run: | + php artisan migrate --force + php artisan db:seed + working-directory: ./test-project + + - name: Run tests + run: vendor/bin/phpunit + working-directory: ./test-project From 441290312b3091bd0ae69e2c8a41d744f9388f78 Mon Sep 17 00:00:00 2001 From: "M. D" Date: Sat, 15 Jun 2024 20:07:42 +0200 Subject: [PATCH 7/7] Update ci.yml --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f70548e1..7adea3b4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -53,5 +53,5 @@ jobs: working-directory: ./test-project - name: Run tests - run: vendor/bin/phpunit + run: ./vendor/bin/pest working-directory: ./test-project