forked from bagisto/bagisto
-
Notifications
You must be signed in to change notification settings - Fork 0
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
Showing
3 changed files
with
153 additions
and
60 deletions.
There are no files selected for viewing
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,93 @@ | ||
name: Playwright Tests | ||
|
||
on: [push, pull_request] | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
playwright_test: | ||
runs-on: ${{ matrix.operating-systems }} | ||
|
||
strategy: | ||
matrix: | ||
operating-systems: [ubuntu-latest] | ||
php-versions: ['8.2', '8.3'] | ||
|
||
name: PHP ${{ matrix.php-versions }} test on ${{ matrix.operating-systems }} | ||
|
||
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: Install System Dependencies | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install -y mysql-client netcat-openbsd net-tools | ||
- 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: lts/* | ||
|
||
- name: Install Node.js Dependencies | ||
run: npm install | ||
|
||
- name: Install Playwright Browsers | ||
run: npx playwright install --with-deps | ||
|
||
- 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: nohup php artisan serve --host=0.0.0.0 --port=8000 > /dev/null 2>&1 & | ||
|
||
- name: Run All Playwright Tests | ||
env: | ||
BASE_URL: 'http://127.0.0.1:8000' | ||
run: | | ||
npx playwright test tests --workers=1 --project=chromium --retries=0 || echo "Continue" | ||
- name: Upload Playwright Report for All Tests | ||
uses: actions/upload-artifact@v4 | ||
if: always() | ||
with: | ||
name: playwright-report-All-Tests | ||
path: playwright-report/ | ||
retention-days: 30 |
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