name: E2E Tests | Shopware ${{ matrix.shopware }}, PHP ${{ matrix.php }}
docker pull dockware/dev:${{ matrix.shopware }}
docker run --rm -p 80:80 -p 443:443 --name shop --env PHP_VERSION=${{ matrix.php }} -d dockware/dev:${{ matrix.shopware }}
# now change the domain of our shop if required
sudo echo "127.0.0.1 local.shopware.shop" | sudo tee -a /etc/hosts
docker exec shop bash -c "mysql -u root -proot shopware -e \"UPDATE sales_channel_domain SET url='https://local.shopware.shop' WHERE url NOT LIKE 'default.%';\""
- name: Upload into Docker
docker cp $(pwd)/. shop:/var/www/html/custom/plugins/MyPlugin
docker exec shop bash -c 'sudo chown www-data:www-data /var/www/html/custom/plugins -R'
- name: Install and Build Artifacts
docker exec shop bash -c 'cd /var/www/html/custom/plugins/MyPlugin && make install -B'
docker exec shop bash -c 'cd /var/www/html/custom/plugins/MyPlugin && make build -B'
- name: Install/Configure Plugin
docker exec shop bash -c 'php bin/console plugin:refresh'
docker exec shop bash -c 'php bin/console plugin:install MyPlugin --activate'
docker exec shop bash -c 'php bin/console system:config:set MyPlugin.config.MyKey ${{ secrets.MYKEY_TEST }}'
docker exec shop bash -c 'php bin/console cache:clear'
run: cd tests/Cypress && make install -B
run: cd tests/Cypress && CYPRESS_BASE_URL=http://local.shopware.shop CYPRESS_SHOPWARE=${{ matrix.shopware }} ./node_modules/.bin/cypress run --headless
mkdir -p $(pwd)/Tests/Cypress/cypress/logs/shopware
mkdir -p $(pwd)/Tests/Cypress/cypress/logs/apache
docker cp shop:/var/www/html/var/log/. $(pwd)/Tests/Cypress/cypress/logs/shopware
docker cp shop:/var/log/php/. $(pwd)/Tests/Cypress/cypress/logs/apache
- name: Store Cypress Results
name: cypress_results_sw_v${{ matrix.shopware }}
Tests/Cypress/cypress/logs
Tests/Cypress/cypress/videos
Tests/Cypress/cypress/screenshots