From 091e25b80878f14808b6183344c2f5a753b5290a Mon Sep 17 00:00:00 2001 From: Michael Telgmann Date: Mon, 21 Aug 2023 10:53:23 +0200 Subject: [PATCH] fix: Unify code style of YAML files --- .editorconfig | 9 ++ .github/workflows/test_bluegreen.yml | 209 +++++++++++++-------------- .github/workflows/test_general.yml | 55 ++++--- .github/workflows/test_installer.yml | 161 ++++++++++----------- .github/workflows/test_update.yml | 153 ++++++++++---------- 5 files changed, 296 insertions(+), 291 deletions(-) create mode 100644 .editorconfig diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..2ff010f --- /dev/null +++ b/.editorconfig @@ -0,0 +1,9 @@ +root = true + +[*] +end_of_line = lf +indent_style = space +indent_size = 4 +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true diff --git a/.github/workflows/test_bluegreen.yml b/.github/workflows/test_bluegreen.yml index 20df233..9284155 100644 --- a/.github/workflows/test_bluegreen.yml +++ b/.github/workflows/test_bluegreen.yml @@ -1,108 +1,107 @@ on: - push: + push: jobs: - setup-shopware: - name: Blue Green Shopware - runs-on: ubuntu-latest - - container: - image: ghcr.io/shopware5/docker-images-testing/zip:shopware_5.6.10_install_5.6.10_b9471cf7c3f30dfc05d7c959f555c2a8d1c24420_5.7_7.4_none - credentials: - username: ${{ github.actor }} - password: ${{ secrets.github_token }} - - steps: - - run: | - apt-get update - apt-get install -y ca-certificates curl gnupg lsb-release - mkdir -m 0755 -p /etc/apt/keyrings - curl -fsSL https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg - echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/$(lsb_release -i | awk '{ print tolower($3) }') $(lsb_release -cs) stable" > /etc/apt/sources.list.d/docker.list - apt-get update - apt-get install -y docker-ce-cli docker-buildx-plugin docker-compose-plugin - - - run: apt-get install -y unzip - - - uses: actions/checkout@v3 - - - run: docker run -d --network=container:$(docker ps -q) --name chrome -e LANGUAGE=de --shm-size 3g selenium/standalone-chrome:94.0 - - - name: Exnable extra services - run: | - cp -r ./www/assetgenerator /var/www/assetgenerator - cp -r ./www/updates /var/www/updates - cp .github/sites-enabled/* /etc/nginx/sites-enabled - echo "127.0.0.1 assetgenerator.example" >> /etc/hosts - echo "127.0.0.1 mysql" >> /etc/hosts - echo "127.0.0.1 updates.example" >> /etc/hosts - echo "127.0.0.1 cdn.example" >> /etc/hosts - echo "127.0.0.1 shopware.test" >> /etc/hosts - echo "127.0.0.1 shopware-subshop-01.test" >> /etc/hosts - - - run: | - /usr/bin/supervisord -c /etc/supervisord.conf & - bash .github/wait-for-mysql.sh - - - name: Download latest Shopware - id: download-artifact - uses: dawidd6/action-download-artifact@v2 - with: - github_token: ${{secrets.GITHUB_TOKEN}} - workflow: create-release.yml - workflow_conclusion: success - branch: 5.7 - repo: shopware5/shopware - - - name: Unzip artifacts - run: | - cd artifact && mv install*.zip ../update.zip && cd .. - unzip update.zip -d newInstallation - - - name: Install database - run: | - mysql -u root -proot -e 'DROP DATABASE shopware; CREATE DATABASE shopware' - mysql -u root -proot shopware --default-character-set=utf8 < ./newInstallation/recovery/install/data/sql/install.sql - mysql -u root -proot shopware -e 'TRUNCATE s_core_snippets' - mysql -u root -proot shopware --default-character-set=utf8 < /shopware/recovery/install/data/sql/snippets.sql - mysql -u root -proot shopware -e 'UPDATE s_core_shops SET name = "Demo shop" WHERE id = 1' - - - name: Setup shop - run: | - /shopware/bin/console sw:theme:initialize - /shopware/bin/console sw:admin:create --name="Demo" --email="demo@demo.de" --username="demo" --password="demo" --locale=de_DE -n - - - run: mysql -u root -proot shopware -e 'UPDATE s_core_shops SET host = "shopware.test" WHERE id = 1;' - - - name: Configure Shopware - run: bash ./.github/configure-sw-installation.sh - - - name: Copy files - run: | - cp ./tests/.env.dist ./tests/.env - cp ./tests/behat.yml.dist ./tests/behat.yml - shell: bash - - - name: Adjust config all files - run: | - cp ./.github/php/config_testing.php /shopware/config_testing.php - - - run: | - mysqldump -u root -proot shopware > clean_db.sql - - - name: Chmod all files - run: | - chmod -R 777 /shopware - - - name: Run Mink - run: | - cd tests - composer install - vendor/bin/behat -vv --format=pretty --out=std --tags '~@updater&&~@installer&&~@knownFailing&&~@shopware52' - - - name: Archive results - if: always() - uses: actions/upload-artifact@v3 - with: - name: build data - path: tests/logs/mink + setup-shopware: + name: Blue Green Shopware + runs-on: ubuntu-latest + container: + image: ghcr.io/shopware5/docker-images-testing/zip:shopware_5.6.10_install_5.6.10_b9471cf7c3f30dfc05d7c959f555c2a8d1c24420_5.7_7.4_none + credentials: + username: ${{ github.actor }} + password: ${{ secrets.github_token }} + + steps: + - run: | + apt-get update + apt-get install -y ca-certificates curl gnupg lsb-release + mkdir -m 0755 -p /etc/apt/keyrings + curl -fsSL https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg + echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/$(lsb_release -i | awk '{ print tolower($3) }') $(lsb_release -cs) stable" > /etc/apt/sources.list.d/docker.list + apt-get update + apt-get install -y docker-ce-cli docker-buildx-plugin docker-compose-plugin + + - run: apt-get install -y unzip + + - uses: actions/checkout@v3 + + - run: docker run -d --network=container:$(docker ps -q) --name chrome -e LANGUAGE=de --shm-size 3g selenium/standalone-chrome:94.0 + + - name: Exnable extra services + run: | + cp -r ./www/assetgenerator /var/www/assetgenerator + cp -r ./www/updates /var/www/updates + cp .github/sites-enabled/* /etc/nginx/sites-enabled + echo "127.0.0.1 assetgenerator.example" >> /etc/hosts + echo "127.0.0.1 mysql" >> /etc/hosts + echo "127.0.0.1 updates.example" >> /etc/hosts + echo "127.0.0.1 cdn.example" >> /etc/hosts + echo "127.0.0.1 shopware.test" >> /etc/hosts + echo "127.0.0.1 shopware-subshop-01.test" >> /etc/hosts + + - run: | + /usr/bin/supervisord -c /etc/supervisord.conf & + bash .github/wait-for-mysql.sh + + - name: Download latest Shopware + id: download-artifact + uses: dawidd6/action-download-artifact@v2 + with: + github_token: ${{secrets.GITHUB_TOKEN}} + workflow: create-release.yml + workflow_conclusion: success + branch: 5.7 + repo: shopware5/shopware + + - name: Unzip artifacts + run: | + cd artifact && mv install*.zip ../update.zip && cd .. + unzip update.zip -d newInstallation + + - name: Install database + run: | + mysql -u root -proot -e 'DROP DATABASE shopware; CREATE DATABASE shopware' + mysql -u root -proot shopware --default-character-set=utf8 < ./newInstallation/recovery/install/data/sql/install.sql + mysql -u root -proot shopware -e 'TRUNCATE s_core_snippets' + mysql -u root -proot shopware --default-character-set=utf8 < /shopware/recovery/install/data/sql/snippets.sql + mysql -u root -proot shopware -e 'UPDATE s_core_shops SET name = "Demo shop" WHERE id = 1' + + - name: Setup shop + run: | + /shopware/bin/console sw:theme:initialize + /shopware/bin/console sw:admin:create --name="Demo" --email="demo@demo.de" --username="demo" --password="demo" --locale=de_DE -n + + - run: mysql -u root -proot shopware -e 'UPDATE s_core_shops SET host = "shopware.test" WHERE id = 1;' + + - name: Configure Shopware + run: bash ./.github/configure-sw-installation.sh + + - name: Copy files + run: | + cp ./tests/.env.dist ./tests/.env + cp ./tests/behat.yml.dist ./tests/behat.yml + shell: bash + + - name: Adjust config all files + run: | + cp ./.github/php/config_testing.php /shopware/config_testing.php + + - run: | + mysqldump -u root -proot shopware > clean_db.sql + + - name: Chmod all files + run: | + chmod -R 777 /shopware + + - name: Run Mink + run: | + cd tests + composer install + vendor/bin/behat -vv --format=pretty --out=std --tags '~@updater&&~@installer&&~@knownFailing&&~@shopware52' + + - name: Archive results + if: always() + uses: actions/upload-artifact@v3 + with: + name: build data + path: tests/logs/mink diff --git a/.github/workflows/test_general.yml b/.github/workflows/test_general.yml index 35c8f84..3a62cb3 100644 --- a/.github/workflows/test_general.yml +++ b/.github/workflows/test_general.yml @@ -31,15 +31,15 @@ jobs: id: download-artifact uses: dawidd6/action-download-artifact@v2 with: - github_token: ${{secrets.GITHUB_TOKEN}} - workflow: create-release.yml - workflow_conclusion: success - branch: 5.7 - repo: shopware5/shopware + github_token: ${{secrets.GITHUB_TOKEN}} + workflow: create-release.yml + workflow_conclusion: success + branch: 5.7 + repo: shopware5/shopware - name: Unzip artifacts run: | - cd artifact && mv install*.zip ../update.zip + cd artifact && mv install*.zip ../update.zip - name: Download last update package and unzip it run: | @@ -49,17 +49,17 @@ jobs: run: | cp ./.github/php/config_testing.php /shopware/config_testing.php - - name: Exnable extra services - run: | - cp -r ./www/assetgenerator /var/www/assetgenerator - cp -r ./www/updates /var/www/updates - cp .github/sites-enabled/* /etc/nginx/sites-enabled - echo "127.0.0.1 assetgenerator.example" >> /etc/hosts - echo "127.0.0.1 mysql" >> /etc/hosts - echo "127.0.0.1 updates.example" >> /etc/hosts - echo "127.0.0.1 cdn.example" >> /etc/hosts - echo "127.0.0.1 shopware.test" >> /etc/hosts - echo "127.0.0.1 shopware-subshop-01.test" >> /etc/hosts + - name: Exnable extra services + run: | + cp -r ./www/assetgenerator /var/www/assetgenerator + cp -r ./www/updates /var/www/updates + cp .github/sites-enabled/* /etc/nginx/sites-enabled + echo "127.0.0.1 assetgenerator.example" >> /etc/hosts + echo "127.0.0.1 mysql" >> /etc/hosts + echo "127.0.0.1 updates.example" >> /etc/hosts + echo "127.0.0.1 cdn.example" >> /etc/hosts + echo "127.0.0.1 shopware.test" >> /etc/hosts + echo "127.0.0.1 shopware-subshop-01.test" >> /etc/hosts - run: | /usr/bin/supervisord -c /etc/supervisord.conf & @@ -68,29 +68,28 @@ jobs: - run: mysql -u root -proot -e "CREATE DATABASE shopware" - run: mysqladmin --user=root password 'root' - - name: Install shopware - run: | - php -d memory_limit=3G /shopware/recovery/install/index.php --no-interaction --db-name="shopware" --db-user="root" --db-password="root" --shop-locale="de_DE" --shop-host="shopware.test" --shop-currency="EUR" --admin-username="demo" --admin-password="demo" --admin-email="demo@demo.demo" --admin-locale="de_DE" --admin-name="Demouser" + - name: Install shopware + run: | + php -d memory_limit=3G /shopware/recovery/install/index.php --no-interaction --db-name="shopware" --db-user="root" --db-password="root" --shop-locale="de_DE" --shop-host="shopware.test" --shop-currency="EUR" --admin-username="demo" --admin-password="demo" --admin-email="demo@demo.demo" --admin-locale="de_DE" --admin-name="Demouser" - name: Chmod all files run: | - chmod -R 777 /shopware/var /shopware/web/cache /shopware/files + chmod -R 777 /shopware/var /shopware/web/cache /shopware/files - - name: Copy files - run: | - cp ./tests/.env.dist ./tests/.env - cp ./tests/behat.yml.dist ./tests/behat.yml - shell: bash + - name: Copy files + run: | + cp ./tests/.env.dist ./tests/.env + cp ./tests/behat.yml.dist ./tests/behat.yml + shell: bash - name: Configure Shopware run: bash ./.github/configure-sw-installation.sh - run: | - mysqldump -u root -proot shopware > clean_db.sql + mysqldump -u root -proot shopware > clean_db.sql - name: Run Mink run: | cd tests composer install vendor/bin/behat -vv --format=pretty --out=std --tags '~@updater&&~@installer&&~@knownFailing' - diff --git a/.github/workflows/test_installer.yml b/.github/workflows/test_installer.yml index 7092079..277d25e 100644 --- a/.github/workflows/test_installer.yml +++ b/.github/workflows/test_installer.yml @@ -3,9 +3,8 @@ on: jobs: setup-shopware: - name: Setup Shopware + name: General Shopware Tests runs-on: ubuntu-latest - container: image: ghcr.io/shopware5/docker-images-testing/running:shopware_5.7_8.0_7.4 credentials: @@ -13,82 +12,82 @@ jobs: password: ${{ secrets.github_token }} steps: - - run: | - apt-get update - apt-get install -y ca-certificates curl gnupg lsb-release - mkdir -m 0755 -p /etc/apt/keyrings - curl -fsSL https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg - echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/$(lsb_release -i | awk '{ print tolower($3) }') $(lsb_release -cs) stable" > /etc/apt/sources.list.d/docker.list - apt-get update - apt-get install -y docker-ce-cli docker-buildx-plugin docker-compose-plugin - - - run: apt-get install -y unzip - - - uses: actions/checkout@v3 - - - run: docker run -d --network=container:$(docker ps -q) --name chrome -e LANGUAGE=de --shm-size 3g selenium/standalone-chrome:94.0 - - - name: Download latest Shopware - id: download-artifact - uses: dawidd6/action-download-artifact@v2 - with: - github_token: ${{secrets.GITHUB_TOKEN}} - workflow: create-release.yml - workflow_conclusion: success - branch: 5.7 - repo: shopware5/shopware - - - name: Unzip artifacts - run: | - cd artifact && mv install*.zip ../update.zip - - - name: Download last update package and unzip it - run: | - unzip update.zip -d /shopware - - - name: Exnable extra services - run: | - cp -r ./www/assetgenerator /var/www/assetgenerator - cp -r ./www/updates /var/www/updates - cp .github/sites-enabled/* /etc/nginx/sites-enabled - echo "127.0.0.1 assetgenerator.example" >> /etc/hosts - echo "127.0.0.1 mysql" >> /etc/hosts - echo "127.0.0.1 updates.example" >> /etc/hosts - echo "127.0.0.1 cdn.example" >> /etc/hosts - echo "127.0.0.1 shopware.test" >> /etc/hosts - echo "127.0.0.1 shopware-subshop-01.test" >> /etc/hosts - - - run: | - /usr/bin/supervisord -c /etc/supervisord.conf & - bash .github/wait-for-mysql.sh - - - run: mysqladmin --user=root password 'root' - - run: mysql -u root -proot -e "CREATE DATABASE shopware" - - - name: Adjust config all files - run: | - cp ./.github/php/config_testing.php /shopware/config_testing.php - cp ./.github/php/config.php /shopware/config.php - - - name: Copy files - run: | - cp ./tests/.env.dist ./tests/.env - cp ./tests/behat.yml.dist ./tests/behat.yml - shell: bash - - - name: Chmod all files - run: | - chmod -R 777 /shopware/ - - - name: Run Mink - run: | - cd tests - composer install - vendor/bin/behat -vv --format=pretty --out=std --tags '@installer&&~@knownFailing' - - - name: Archive results - if: always() - uses: actions/upload-artifact@v3 - with: - name: build data - path: tests/logs/mink + - run: | + apt-get update + apt-get install -y ca-certificates curl gnupg lsb-release + mkdir -m 0755 -p /etc/apt/keyrings + curl -fsSL https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg + echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/$(lsb_release -i | awk '{ print tolower($3) }') $(lsb_release -cs) stable" > /etc/apt/sources.list.d/docker.list + apt-get update + apt-get install -y docker-ce-cli docker-buildx-plugin docker-compose-plugin + + - run: apt-get install -y unzip + + - uses: actions/checkout@v3 + + - run: docker run -d --network=container:$(docker ps -q) --name chrome -e LANGUAGE=de --shm-size 3g selenium/standalone-chrome:94.0 + + - name: Download latest Shopware + id: download-artifact + uses: dawidd6/action-download-artifact@v2 + with: + github_token: ${{secrets.GITHUB_TOKEN}} + workflow: create-release.yml + workflow_conclusion: success + branch: 5.7 + repo: shopware5/shopware + + - name: Unzip artifacts + run: | + cd artifact && mv install*.zip ../update.zip + + - name: Download last update package and unzip it + run: | + unzip update.zip -d /shopware + + - name: Exnable extra services + run: | + cp -r ./www/assetgenerator /var/www/assetgenerator + cp -r ./www/updates /var/www/updates + cp .github/sites-enabled/* /etc/nginx/sites-enabled + echo "127.0.0.1 assetgenerator.example" >> /etc/hosts + echo "127.0.0.1 mysql" >> /etc/hosts + echo "127.0.0.1 updates.example" >> /etc/hosts + echo "127.0.0.1 cdn.example" >> /etc/hosts + echo "127.0.0.1 shopware.test" >> /etc/hosts + echo "127.0.0.1 shopware-subshop-01.test" >> /etc/hosts + + - run: | + /usr/bin/supervisord -c /etc/supervisord.conf & + bash .github/wait-for-mysql.sh + + - run: mysqladmin --user=root password 'root' + - run: mysql -u root -proot -e "CREATE DATABASE shopware" + + - name: Adjust config all files + run: | + cp ./.github/php/config_testing.php /shopware/config_testing.php + cp ./.github/php/config.php /shopware/config.php + + - name: Copy files + run: | + cp ./tests/.env.dist ./tests/.env + cp ./tests/behat.yml.dist ./tests/behat.yml + shell: bash + + - name: Chmod all files + run: | + chmod -R 777 /shopware/ + + - name: Run Mink + run: | + cd tests + composer install + vendor/bin/behat -vv --format=pretty --out=std --tags '@installer&&~@knownFailing' + + - name: Archive results + if: always() + uses: actions/upload-artifact@v3 + with: + name: build data + path: tests/logs/mink diff --git a/.github/workflows/test_update.yml b/.github/workflows/test_update.yml index 6e2ff63..7925f09 100644 --- a/.github/workflows/test_update.yml +++ b/.github/workflows/test_update.yml @@ -5,7 +5,6 @@ jobs: setup-shopware: name: Update Shopware runs-on: ubuntu-latest - container: image: ghcr.io/shopware5/docker-images-testing/zip:shopware_5.6.10_install_5.6.10_b9471cf7c3f30dfc05d7c959f555c2a8d1c24420_5.7_7.4_none credentials: @@ -13,79 +12,79 @@ jobs: password: ${{ secrets.github_token }} steps: - - run: | - apt-get update - apt-get install -y ca-certificates curl gnupg lsb-release - mkdir -m 0755 -p /etc/apt/keyrings - curl -fsSL https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg - echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/$(lsb_release -i | awk '{ print tolower($3) }') $(lsb_release -cs) stable" > /etc/apt/sources.list.d/docker.list - apt-get update - apt-get install -y docker-ce-cli docker-buildx-plugin docker-compose-plugin - - - run: apt-get install -y unzip - - - uses: actions/checkout@v3 - - - run: docker run -d --network=container:$(docker ps -q) --name chrome -e LANGUAGE=de --shm-size 3g selenium/standalone-chrome:94.0 - - - name: Exnable extra services - run: | - cp -r ./www/assetgenerator /var/www/assetgenerator - cp -r ./www/updates /var/www/updates - cp .github/sites-enabled/* /etc/nginx/sites-enabled - echo "127.0.0.1 assetgenerator.example" >> /etc/hosts - echo "127.0.0.1 mysql" >> /etc/hosts - echo "127.0.0.1 updates.example" >> /etc/hosts - echo "127.0.0.1 cdn.example" >> /etc/hosts - echo "127.0.0.1 shopware.test" >> /etc/hosts - echo "127.0.0.1 shopware-subshop-01.test" >> /etc/hosts - - - name: Download last update package and unzip it - run: | - mkdir ./output - LATEST_RELEASE=$(curl -L -s -H 'Accept: application/json' https://github.com/shopware5/shopware/releases/latest) - LATEST_VERSION_ID=$(echo $LATEST_RELEASE | sed -e 's/.*"id":\([^",]*\).*/\1/') - ASSETS=$(curl -L -s -H 'Accept: application/json' https://api.github.com/repos/shopware5/shopware/releases/$LATEST_VERSION_ID/assets) - ARTIFACT_URL=$(echo $ASSETS | sed -e 's/.*"browser_download_url": "\([^",]*update[^",]*\)".*/\1/') - wget -O update.zip $ARTIFACT_URL - unzip -o update.zip -d /shopware - - - run: | - /usr/bin/supervisord -c /etc/supervisord.conf & - bash .github/wait-for-mysql.sh - - - run: mysql -u root -proot shopware -e 'UPDATE s_core_shops SET host = "shopware.test" WHERE id = 1;' - - - name: Copy files - run: | - cp ./tests/.env.dist ./tests/.env - cp ./tests/behat.yml.dist ./tests/behat.yml - shell: bash - - - name: Chmod all files - run: | - chmod -R 777 /shopware/var /shopware/web/cache /shopware/files - - - name: Adjust config all files - run: | - cp ./.github/php/config_testing.php /shopware/config_testing.php - - - run: | - mysqldump -u root -proot shopware > clean_db.sql - - - name: Chmod all files - run: | - chmod -R 777 /shopware - - - name: Run Mink - run: | - cd tests - composer install - vendor/bin/behat -vv --format=pretty --out=std --tags '@updater&&~@knownFailing' - - - name: Archive results - if: always() - uses: actions/upload-artifact@v3 - with: - name: build data - path: tests/logs/mink + - run: | + apt-get update + apt-get install -y ca-certificates curl gnupg lsb-release + mkdir -m 0755 -p /etc/apt/keyrings + curl -fsSL https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg + echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/$(lsb_release -i | awk '{ print tolower($3) }') $(lsb_release -cs) stable" > /etc/apt/sources.list.d/docker.list + apt-get update + apt-get install -y docker-ce-cli docker-buildx-plugin docker-compose-plugin + + - run: apt-get install -y unzip + + - uses: actions/checkout@v3 + + - run: docker run -d --network=container:$(docker ps -q) --name chrome -e LANGUAGE=de --shm-size 3g selenium/standalone-chrome:94.0 + + - name: Exnable extra services + run: | + cp -r ./www/assetgenerator /var/www/assetgenerator + cp -r ./www/updates /var/www/updates + cp .github/sites-enabled/* /etc/nginx/sites-enabled + echo "127.0.0.1 assetgenerator.example" >> /etc/hosts + echo "127.0.0.1 mysql" >> /etc/hosts + echo "127.0.0.1 updates.example" >> /etc/hosts + echo "127.0.0.1 cdn.example" >> /etc/hosts + echo "127.0.0.1 shopware.test" >> /etc/hosts + echo "127.0.0.1 shopware-subshop-01.test" >> /etc/hosts + + - name: Download last update package and unzip it + run: | + mkdir ./output + LATEST_RELEASE=$(curl -L -s -H 'Accept: application/json' https://github.com/shopware5/shopware/releases/latest) + LATEST_VERSION_ID=$(echo $LATEST_RELEASE | sed -e 's/.*"id":\([^",]*\).*/\1/') + ASSETS=$(curl -L -s -H 'Accept: application/json' https://api.github.com/repos/shopware5/shopware/releases/$LATEST_VERSION_ID/assets) + ARTIFACT_URL=$(echo $ASSETS | sed -e 's/.*"browser_download_url": "\([^",]*update[^",]*\)".*/\1/') + wget -O update.zip $ARTIFACT_URL + unzip -o update.zip -d /shopware + + - run: | + /usr/bin/supervisord -c /etc/supervisord.conf & + bash .github/wait-for-mysql.sh + + - run: mysql -u root -proot shopware -e 'UPDATE s_core_shops SET host = "shopware.test" WHERE id = 1;' + + - name: Copy files + run: | + cp ./tests/.env.dist ./tests/.env + cp ./tests/behat.yml.dist ./tests/behat.yml + shell: bash + + - name: Chmod all files + run: | + chmod -R 777 /shopware/var /shopware/web/cache /shopware/files + + - name: Adjust config all files + run: | + cp ./.github/php/config_testing.php /shopware/config_testing.php + + - run: | + mysqldump -u root -proot shopware > clean_db.sql + + - name: Chmod all files + run: | + chmod -R 777 /shopware + + - name: Run Mink + run: | + cd tests + composer install + vendor/bin/behat -vv --format=pretty --out=std --tags '@updater&&~@knownFailing' + + - name: Archive results + if: always() + uses: actions/upload-artifact@v3 + with: + name: build data + path: tests/logs/mink