forked from shopware/shopware
-
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
2 changed files
with
109 additions
and
2 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,107 @@ | ||
name: Playwright Tests | ||
on: | ||
push: | ||
branches: [ main, master ] | ||
pull_request: | ||
|
||
permissions: | ||
packages: write | ||
|
||
jobs: | ||
docker: | ||
runs-on: ubuntu-latest | ||
env: | ||
SHOPWARE_ADMIN_SKIP_SOURCEMAP_GENERATION: "1" | ||
DATABASE_URL: mysql://root:[email protected]:3306/root | ||
services: | ||
database: | ||
image: mysql:8.0 | ||
env: | ||
MYSQL_ROOT_PASSWORD: root | ||
MYSQL_DATABASE: root | ||
options: '--mount="type=tmpfs,destination=/var/lib/mysql" --health-cmd="mysqladmin ping -h 127.0.0.1" --health-interval=5s --health-timeout=2s --health-retries=3' | ||
ports: | ||
- "3306:3306" | ||
steps: | ||
- | ||
name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Setup PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: 8.2 | ||
coverage: none | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20 | ||
- | ||
name: build shopware | ||
run: | | ||
composer install -o -n --no-scripts | ||
bin/console debug:container --parameter 'kernel.shopware_version' | ||
mkdir -p config/jwt custom/plugins || true | ||
composer run init:db | ||
NODE_ENV=production npm --no-audit --prefer-offline --prefix src/Administration/Resources/app/administration/ ci | ||
NODE_ENV=production npm --no-audit --prefer-offline --prefix src/Storefront/Resources/app/storefront/ ci | ||
composer run build:js | ||
bin/console theme:compile | ||
bin/console theme:change --all Storefront | ||
echo '**/node_modules' >> .dockerignore | ||
- | ||
name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
- | ||
name: Login into Github Docker Registery | ||
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin | ||
- | ||
name: Build and push | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: . | ||
push: true | ||
tags: ghcr.io/${{ github.repository }}:${{ github.run_id }} | ||
file: .gitlab/docker/dev/Dockerfile | ||
|
||
acceptance_tests: | ||
name: 'Playwright Tests' | ||
runs-on: ubuntu-latest | ||
container: | ||
image: mcr.microsoft.com/playwright:v1.39.0-jammy | ||
needs: docker | ||
env: | ||
APP_URL: http://shopware:8000 | ||
services: | ||
# Label used to access the service container | ||
database: | ||
image: mysql:8.0 | ||
env: | ||
MYSQL_ROOT_PASSWORD: root | ||
MYSQL_DATABASE: root | ||
options: '--mount="type=tmpfs,destination=/var/lib/mysql" --health-cmd="mysqladmin ping -h 127.0.0.1" --health-interval=5s --health-timeout=2s --health-retries=3' | ||
ports: | ||
- "3306:3306" | ||
shopware: | ||
image: ghcr.io/${{ github.repository }}:${{ github.run_id }} | ||
options: '--health-cmd=="curl--fail http://shopware:8000" --health-interval=2s --health-timeout=1s --health-retries=180' | ||
env: | ||
APP_ENV: prod | ||
SHOPWARE_HTTP_CACHE_ENABLED: 0 | ||
SHOPWARE_DISABLE_UPDATE_CHECK: "true" | ||
PROJECT_ROOT: /var/www/html | ||
DATABASE_URL: mysql://root:root@database:3306/root | ||
DATABASE_HOST: database | ||
APP_SECRET: def00000bb5acb32b54ff8ee130270586eec0e878f7337dc7a837acc31d3ff00f93a56b595448b4b29664847dd51991b3314ff65aeeeb761a133b0ec0e070433bff08e48 | ||
BLUE_GREEN_DEPLOYMENT: 1 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: 18 | ||
- name: Install dependencies | ||
working-directory: tests/acceptance | ||
run: npm ci | ||
- name: Run your tests | ||
working-directory: tests/acceptance | ||
run: npx playwright test | ||
env: | ||
HOME: /root |
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