Skip to content

Commit

Permalink
NEXT-0000 - Add acceptance workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
pweyck committed Mar 19, 2024
1 parent de31375 commit 288b4d5
Show file tree
Hide file tree
Showing 2 changed files with 76 additions and 2 deletions.
74 changes: 74 additions & 0 deletions .github/workflows/02-acceptance.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: Playwright Tests
on:
push:
branches: [ main, master ]
pull_request:

permissions:
packages: write

jobs:
docker:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v4
-
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=90'
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
4 changes: 2 additions & 2 deletions .gitlab/docker/dev/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ RUN echo ${COMPOSER_CACHE_DIR} && ls -las ${COMPOSER_CACHE_DIR} \

FROM base-image

COPY --chown=www-data:www-data .gitlab/docker/entrypoint.sh /entrypoint
COPY --chown=82:82 .gitlab/docker/entrypoint.sh /entrypoint

COPY --from=build --link --chown=www-data:www-data /app /var/www/html
COPY --from=build --link --chown=82:82 /app /var/www/html

ENTRYPOINT [ "/entrypoint" ]

0 comments on commit 288b4d5

Please sign in to comment.