Skip to content

Commit

Permalink
Merge branch 'bagisto:2.2' into duplicate-theme
Browse files Browse the repository at this point in the history
  • Loading branch information
ghermans authored Feb 20, 2025
2 parents 95868ad + 8eed5b4 commit 61a51f1
Show file tree
Hide file tree
Showing 124 changed files with 9,252 additions and 421 deletions.
101 changes: 101 additions & 0 deletions .github/workflows/admin_playwright_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
name: Admin | Playwright Tests

on: [push, pull_request]

permissions:
contents: read

env:
FORCE_COLOR: 1

jobs:
admin_playwright_test:
runs-on: ${{ matrix.operating-systems }}

strategy:
fail-fast: false
matrix:
operating-systems: [ubuntu-latest]
php-versions: ['8.3']
node-version: ['22.13.1']
shard-index: [1,2,3,4,5,6]
shard-total: [6]

name: Admin | Playwright Tests | Shard ${{ matrix.shard-index }} Of ${{ matrix.shard-total }}

services:
mysql:
image: mysql:8.0
env:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: bagisto
ports:
- 3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=5

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
extensions: curl, fileinfo, gd, intl, mbstring, openssl, pdo, pdo_mysql, tokenizer, zip
ini-values: error_reporting=E_ALL
tools: composer:v2

- name: Set Up Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}

- name: Install Node.js Dependencies
run: npm install
working-directory: packages/Webkul/Admin

- name: Install Playwright Browsers
run: npx playwright install --with-deps
working-directory: packages/Webkul/Admin

- name: Setting Environment
run: |
cp .env.example .env
sed -i "s|^\(DB_HOST=\s*\).*$|\1127.0.0.1|" .env
sed -i "s|^\(DB_PORT=\s*\).*$|\1${{ job.services.mysql.ports['3306'] }}|" .env
sed -i "s|^\(DB_DATABASE=\s*\).*$|\1bagisto|" .env
sed -i "s|^\(DB_USERNAME=\s*\).*$|\1root|" .env
sed -i "s|^\(DB_PASSWORD=\s*\).*$|\1root|" .env
sed -i "s|^\(APP_DEBUG=\s*\).*$|\1false|" .env
sed -i "s|^\(APP_URL=\s*\).*$|\1http://127.0.0.1:8000|" .env
cat .env
- name: Install Composer Dependencies
run: composer install

- name: Running Bagisto Installer
run: php artisan bagisto:install --skip-env-check --skip-admin-creation

- name: Seed Product Table
run: php artisan db:seed --class="Webkul\\Installer\\Database\\Seeders\\ProductTableSeeder"

- name: Start Laravel server
run: |
php artisan serve --host=0.0.0.0 --port=8000 > server.log 2>&1 &
echo "Waiting for server to start..."
timeout 30 bash -c 'until curl -s http://127.0.0.1:8000 > /dev/null; do sleep 1; done'
- name: Run All Playwright Tests
env:
BASE_URL: 'http://127.0.0.1:8000'
run: |
npx playwright test --reporter=list --config=tests/e2e-pw/playwright.config.ts --shard=${{ matrix.shard-index }}/${{ matrix.shard-total }}
working-directory: packages/Webkul/Admin

- name: Upload Test Results
uses: actions/upload-artifact@v4
if: always()
with:
name: test-results
path: packages/Webkul/Admin/tests/e2e-pw/test-results
retention-days: 1
101 changes: 101 additions & 0 deletions .github/workflows/shop_playwright_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
name: Shop | Playwright Tests

on: [push, pull_request]

permissions:
contents: read

env:
FORCE_COLOR: 1

jobs:
shop_playwright_test:
runs-on: ${{ matrix.operating-systems }}

strategy:
fail-fast: false
matrix:
operating-systems: [ubuntu-latest]
php-versions: ['8.3']
node-version: ['22.13.1']
shard-index: [1]
shard-total: [1]

name: Shop | Playwright Tests | Shard ${{ matrix.shard-index }} Of ${{ matrix.shard-total }}

services:
mysql:
image: mysql:8.0
env:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: bagisto
ports:
- 3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=5

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
extensions: curl, fileinfo, gd, intl, mbstring, openssl, pdo, pdo_mysql, tokenizer, zip
ini-values: error_reporting=E_ALL
tools: composer:v2

- name: Set Up Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}

- name: Install Node.js Dependencies
run: npm install
working-directory: packages/Webkul/Shop

- name: Install Playwright Browsers
run: npx playwright install --with-deps
working-directory: packages/Webkul/Shop

- name: Setting Environment
run: |
cp .env.example .env
sed -i "s|^\(DB_HOST=\s*\).*$|\1127.0.0.1|" .env
sed -i "s|^\(DB_PORT=\s*\).*$|\1${{ job.services.mysql.ports['3306'] }}|" .env
sed -i "s|^\(DB_DATABASE=\s*\).*$|\1bagisto|" .env
sed -i "s|^\(DB_USERNAME=\s*\).*$|\1root|" .env
sed -i "s|^\(DB_PASSWORD=\s*\).*$|\1root|" .env
sed -i "s|^\(APP_DEBUG=\s*\).*$|\1false|" .env
sed -i "s|^\(APP_URL=\s*\).*$|\1http://127.0.0.1:8000|" .env
cat .env
- name: Install Composer Dependencies
run: composer install

- name: Running Bagisto Installer
run: php artisan bagisto:install --skip-env-check --skip-admin-creation

- name: Seed Product Table
run: php artisan db:seed --class="Webkul\\Installer\\Database\\Seeders\\ProductTableSeeder"

- name: Start Laravel server
run: |
php artisan serve --host=0.0.0.0 --port=8000 > server.log 2>&1 &
echo "Waiting for server to start..."
timeout 30 bash -c 'until curl -s http://127.0.0.1:8000 > /dev/null; do sleep 1; done'
- name: Run All Playwright Tests
env:
BASE_URL: 'http://127.0.0.1:8000'
run: |
npx playwright test --reporter=list --config=tests/e2e-pw/playwright.config.ts --shard=${{ matrix.shard-index }}/${{ matrix.shard-total }}
working-directory: packages/Webkul/Shop

- name: Upload Test Results
uses: actions/upload-artifact@v4
if: always()
with:
name: test-results
path: packages/Webkul/Shop/tests/e2e-pw/test-results
retention-days: 1
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,16 @@ Homestead.yaml
/node_modules
npm-debug.log
package-lock.json
/public/css
/playwright-report
/public/css
/public/js
/public/hot
/public/storage
/public/vendor
/lang/vendor
/storage/*.key
/storage/dcc-data/
/test-results
/vendor
yarn.lock
yarn-error.log
Loading

0 comments on commit 61a51f1

Please sign in to comment.