From 17f7f8542f94ed2b019825140d1190050b4ada82 Mon Sep 17 00:00:00 2001 From: Mattias Michaux Date: Fri, 10 Feb 2023 21:12:34 +0100 Subject: [PATCH 01/40] switch to docker image instead of installing Mautic locally --- .github/ci-files/prepare_mautic.sh | 10 +++ .github/workflows/tests.yml | 104 ++++++++++------------------- 2 files changed, 45 insertions(+), 69 deletions(-) create mode 100644 .github/ci-files/prepare_mautic.sh diff --git a/.github/ci-files/prepare_mautic.sh b/.github/ci-files/prepare_mautic.sh new file mode 100644 index 00000000..a73abe7d --- /dev/null +++ b/.github/ci-files/prepare_mautic.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +set -e + +cd /var/www/html +php bin/console mautic:install http://localhost/ \ + --force --mailer_from_name="GitHub Actions" --mailer_from_email="github-actions@mautic.org" --mailer_transport="smtp" --mailer_host="mailhog" --mailer_port="1025" --env=dev +php bin/console cache:warmup --no-interaction --env=dev +mysql -umautic -pmypassword -hmysql -e "USE mautic; INSERT INTO plugin_integration_settings (plugin_id, name, is_published, supported_features, api_keys, feature_settings) VALUES (NULL, 'Twilio', 1, 'a:0:{}', 'a:2:{s:8:\"username\";s:169:\"bzFmNlIydWRSZXlIN2lQVkdpanJ4aTQ2NUh6RVdDbHlLRVhsWGZ4b0kyZVNxLzYrQ1J6V1RvMnlhVEp0c245TEp6eStQekx5ZVhLWjB1YVdoR3RnR2dHQ3k1emVVdGt5NzZKUmtjUnJ3c1E9|L8tbZRIYhwatT7Mq+HAdYA==\";s:8:\"password\";s:169:\"T2d2cFpXQWE5YVZnNFFianJSYURRYUtGRHBNZGZjM1VETXg2Wm5Va3NheW43MjVWUlJhTVlCL2pYMDBpbElONStiVVBNbEM3M3BaeGJMNkFKNUFEN1pTNldSRjc4bUM4SDh1SE9OY1k5MTg9|TeuSvfx4XSUOvp0O7T49Cg==\";}', 'a:4:{s:20:\"sending_phone_number\";N;s:22:\"disable_trackable_urls\";i:0;s:16:\"frequency_number\";N;s:14:\"frequency_time\";N;}');" +php bin/console mautic:plugins:reload --env=dev diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 8e5a4bb1..93530cda 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -27,7 +27,7 @@ jobs: MYSQL_ALLOW_EMPTY_PASSWORD: yes MYSQL_DATABASE: mautictest ports: - - 3306 + - 3306:3306 options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 mailhog: @@ -40,6 +40,21 @@ jobs: ports: - 6379:6379 + mautic: + image: mautic/mautic:v4-apache + env: + MAUTIC_DB_HOST: db + MAUTIC_DB_USER: mautic + MAUTIC_DB_PASSWORD: mypassword + MAUTIC_DB_NAME: mautic + MAUTIC_RUN_CRON_JOBS: "false" + ports: + - 80:80 + options: + --health-cmd="curl --fail http://localhost || exit 1" + --health-interval=10s + --health-timeout=5s + --health-retries=10 steps: - uses: actions/checkout@v3 @@ -57,84 +72,35 @@ jobs: - name: Set SYMFONY_ENV to test run: echo "SYMFONY_ENV=test" >> $GITHUB_ENV - - name: Install Apache - # We need the sed command at the bottom to set the PHP session save path to a directory that's writable for PHP - # NOTE: update the PHP version below as well if you're updating PHP! + - name: Prepare Mautic installation run: | - sudo add-apt-repository ppa:ondrej/php -y - sudo add-apt-repository ppa:ondrej/apache2 -y - sudo apt-get install apache2 libapache2-mod-php8.0 - sudo a2enmod rewrite - sudo sed -i 's,^session.save_handler =.*$,session.save_handler = redis,' /etc/php/8.0/apache2/php.ini - sudo sed -i 's,^;session.save_path =.*$,session.save_path = "tcp://127.0.0.1:6379",' /etc/php/8.0/apache2/php.ini - sudo service apache2 restart - cat /etc/php/8.0/apache2/php.ini | grep session + sudo docker cp /tmp/ci-files/prepare_mautic.sh mautic:/tmp/prepare_mautic.sh + sudo docker exec -it mautic "bash /tmp/prepare_mautic.sh" - name: Install dependencies run: | composer validate --strict composer install --prefer-dist --no-progress - - name: Clone Mautic main branch or specific PR from GitHub - run: | - gh repo clone mautic/mautic -- --single-branch --depth 1 - if [[ "${{ github.event.inputs.pr }}" != "" ]]; then - pushd mautic - gh pr checkout ${{ github.event.inputs.pr }} - popd - fi - env: - GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} - - - name: Move files to web root - run: | - shopt -s dotglob - sudo chmod -R 777 /var/www/html - sudo chown -R www-data:www-data /var/www/html - rm -rf /var/www/html/* - mv $GITHUB_WORKSPACE/mautic/* /var/www/html/ - - - name: Install Mautic - env: - DB_PORT: ${{ job.services.mysql.ports[3306] }} - run: | - composer install --prefer-dist --no-progress - cp $GITHUB_WORKSPACE/.github/ci-files/local.php ./app/config/local.php - php bin/console mautic:install http://localhost/ \ - --force --mailer_from_name="GitHub Actions" --mailer_from_email="github-actions@mautic.org" \ - --mailer_transport="smtp" --mailer_host="localhost" --mailer_port="1025" --env=dev - php bin/console cache:warmup --no-interaction --env=dev - working-directory: /var/www/html/ - - # Enable Twilio plugin with random credentials (needed for MessagesTest to function, doesn't actually contact Twilio API). - - name: Enable Twilio plugin - run: | - mysql -uroot -P${{ job.services.mysql.ports[3306] }} -h127.0.0.1 -e "USE mautictest; INSERT INTO plugin_integration_settings (plugin_id, name, is_published, supported_features, api_keys, feature_settings) VALUES (NULL, 'Twilio', 1, 'a:0:{}', 'a:2:{s:8:\"username\";s:169:\"bzFmNlIydWRSZXlIN2lQVkdpanJ4aTQ2NUh6RVdDbHlLRVhsWGZ4b0kyZVNxLzYrQ1J6V1RvMnlhVEp0c245TEp6eStQekx5ZVhLWjB1YVdoR3RnR2dHQ3k1emVVdGt5NzZKUmtjUnJ3c1E9|L8tbZRIYhwatT7Mq+HAdYA==\";s:8:\"password\";s:169:\"T2d2cFpXQWE5YVZnNFFianJSYURRYUtGRHBNZGZjM1VETXg2Wm5Va3NheW43MjVWUlJhTVlCL2pYMDBpbElONStiVVBNbEM3M3BaeGJMNkFKNUFEN1pTNldSRjc4bUM4SDh1SE9OY1k5MTg9|TeuSvfx4XSUOvp0O7T49Cg==\";}', 'a:4:{s:20:\"sending_phone_number\";N;s:22:\"disable_trackable_urls\";i:0;s:16:\"frequency_number\";N;s:14:\"frequency_time\";N;}');" - php bin/console mautic:plugins:reload --env=dev - working-directory: /var/www/html - - - name: Set correct ownership so Apache can access the files - run: sudo chown -R www-data:www-data /var/www/html - - name: Run tests run: vendor/bin/paratest -p 3 --coverage-clover coverage.xml - - name: Upload code coverage - run: bash <(curl -s https://codecov.io/bash) - - - name: Upload logs as artifacts - uses: actions/upload-artifact@v2 - if: always() - with: - name: mautic-logs - path: /var/www/html/var/logs/ - - - name: Slack Notification if tests fail - uses: rtCamp/action-slack-notify@v2 - if: ${{ failure() && github.event_name == 'schedule' }} - env: - SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} - SLACK_MESSAGE: 'The daily API library tests against mautic/mautic have failed. Most likely a PR was merged recently which introduced a regression of some sort.' +# - name: Upload code coverage +# run: bash <(curl -s https://codecov.io/bash) +# +# - name: Upload logs as artifacts +# uses: actions/upload-artifact@v2 +# if: always() +# with: +# name: mautic-logs +# path: /var/www/html/var/logs/ +# +# - name: Slack Notification if tests fail +# uses: rtCamp/action-slack-notify@v2 +# if: ${{ failure() && github.event_name == 'schedule' }} +# env: +# SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} +# SLACK_MESSAGE: 'The daily API library tests against mautic/mautic have failed. Most likely a PR was merged recently which introduced a regression of some sort.' cs: runs-on: ubuntu-20.04 From f19ec72ae41bd5910f821b43635eb537343f1ce6 Mon Sep 17 00:00:00 2001 From: Mattias Michaux Date: Fri, 10 Feb 2023 21:16:13 +0100 Subject: [PATCH 02/40] correct db name --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 93530cda..e36e5751 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -43,7 +43,7 @@ jobs: mautic: image: mautic/mautic:v4-apache env: - MAUTIC_DB_HOST: db + MAUTIC_DB_HOST: mysql MAUTIC_DB_USER: mautic MAUTIC_DB_PASSWORD: mypassword MAUTIC_DB_NAME: mautic From 9d89fa7229617542b9f08fdf956352a78b1e4b10 Mon Sep 17 00:00:00 2001 From: Mattias Michaux Date: Fri, 10 Feb 2023 21:20:44 +0100 Subject: [PATCH 03/40] other creds --- .github/ci-files/prepare_mautic.sh | 2 +- .github/workflows/tests.yml | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/ci-files/prepare_mautic.sh b/.github/ci-files/prepare_mautic.sh index a73abe7d..46781e52 100644 --- a/.github/ci-files/prepare_mautic.sh +++ b/.github/ci-files/prepare_mautic.sh @@ -6,5 +6,5 @@ cd /var/www/html php bin/console mautic:install http://localhost/ \ --force --mailer_from_name="GitHub Actions" --mailer_from_email="github-actions@mautic.org" --mailer_transport="smtp" --mailer_host="mailhog" --mailer_port="1025" --env=dev php bin/console cache:warmup --no-interaction --env=dev -mysql -umautic -pmypassword -hmysql -e "USE mautic; INSERT INTO plugin_integration_settings (plugin_id, name, is_published, supported_features, api_keys, feature_settings) VALUES (NULL, 'Twilio', 1, 'a:0:{}', 'a:2:{s:8:\"username\";s:169:\"bzFmNlIydWRSZXlIN2lQVkdpanJ4aTQ2NUh6RVdDbHlLRVhsWGZ4b0kyZVNxLzYrQ1J6V1RvMnlhVEp0c245TEp6eStQekx5ZVhLWjB1YVdoR3RnR2dHQ3k1emVVdGt5NzZKUmtjUnJ3c1E9|L8tbZRIYhwatT7Mq+HAdYA==\";s:8:\"password\";s:169:\"T2d2cFpXQWE5YVZnNFFianJSYURRYUtGRHBNZGZjM1VETXg2Wm5Va3NheW43MjVWUlJhTVlCL2pYMDBpbElONStiVVBNbEM3M3BaeGJMNkFKNUFEN1pTNldSRjc4bUM4SDh1SE9OY1k5MTg9|TeuSvfx4XSUOvp0O7T49Cg==\";}', 'a:4:{s:20:\"sending_phone_number\";N;s:22:\"disable_trackable_urls\";i:0;s:16:\"frequency_number\";N;s:14:\"frequency_time\";N;}');" +mysql -uroot -hmysql -e "USE mautictest; INSERT INTO plugin_integration_settings (plugin_id, name, is_published, supported_features, api_keys, feature_settings) VALUES (NULL, 'Twilio', 1, 'a:0:{}', 'a:2:{s:8:\"username\";s:169:\"bzFmNlIydWRSZXlIN2lQVkdpanJ4aTQ2NUh6RVdDbHlLRVhsWGZ4b0kyZVNxLzYrQ1J6V1RvMnlhVEp0c245TEp6eStQekx5ZVhLWjB1YVdoR3RnR2dHQ3k1emVVdGt5NzZKUmtjUnJ3c1E9|L8tbZRIYhwatT7Mq+HAdYA==\";s:8:\"password\";s:169:\"T2d2cFpXQWE5YVZnNFFianJSYURRYUtGRHBNZGZjM1VETXg2Wm5Va3NheW43MjVWUlJhTVlCL2pYMDBpbElONStiVVBNbEM3M3BaeGJMNkFKNUFEN1pTNldSRjc4bUM4SDh1SE9OY1k5MTg9|TeuSvfx4XSUOvp0O7T49Cg==\";}', 'a:4:{s:20:\"sending_phone_number\";N;s:22:\"disable_trackable_urls\";i:0;s:16:\"frequency_number\";N;s:14:\"frequency_time\";N;}');" php bin/console mautic:plugins:reload --env=dev diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index e36e5751..f311be3d 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -44,9 +44,9 @@ jobs: image: mautic/mautic:v4-apache env: MAUTIC_DB_HOST: mysql - MAUTIC_DB_USER: mautic - MAUTIC_DB_PASSWORD: mypassword - MAUTIC_DB_NAME: mautic + MAUTIC_DB_USER: root + MAUTIC_DB_PASSWORD: "" + MAUTIC_DB_NAME: mautictest MAUTIC_RUN_CRON_JOBS: "false" ports: - 80:80 From a8238c53dd66d2cfd48aa1a646a1feffab4a65fa Mon Sep 17 00:00:00 2001 From: Mattias Michaux Date: Fri, 10 Feb 2023 21:24:09 +0100 Subject: [PATCH 04/40] no empty password allowed --- .github/ci-files/prepare_mautic.sh | 2 +- .github/workflows/tests.yml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/ci-files/prepare_mautic.sh b/.github/ci-files/prepare_mautic.sh index 46781e52..751683e3 100644 --- a/.github/ci-files/prepare_mautic.sh +++ b/.github/ci-files/prepare_mautic.sh @@ -6,5 +6,5 @@ cd /var/www/html php bin/console mautic:install http://localhost/ \ --force --mailer_from_name="GitHub Actions" --mailer_from_email="github-actions@mautic.org" --mailer_transport="smtp" --mailer_host="mailhog" --mailer_port="1025" --env=dev php bin/console cache:warmup --no-interaction --env=dev -mysql -uroot -hmysql -e "USE mautictest; INSERT INTO plugin_integration_settings (plugin_id, name, is_published, supported_features, api_keys, feature_settings) VALUES (NULL, 'Twilio', 1, 'a:0:{}', 'a:2:{s:8:\"username\";s:169:\"bzFmNlIydWRSZXlIN2lQVkdpanJ4aTQ2NUh6RVdDbHlLRVhsWGZ4b0kyZVNxLzYrQ1J6V1RvMnlhVEp0c245TEp6eStQekx5ZVhLWjB1YVdoR3RnR2dHQ3k1emVVdGt5NzZKUmtjUnJ3c1E9|L8tbZRIYhwatT7Mq+HAdYA==\";s:8:\"password\";s:169:\"T2d2cFpXQWE5YVZnNFFianJSYURRYUtGRHBNZGZjM1VETXg2Wm5Va3NheW43MjVWUlJhTVlCL2pYMDBpbElONStiVVBNbEM3M3BaeGJMNkFKNUFEN1pTNldSRjc4bUM4SDh1SE9OY1k5MTg9|TeuSvfx4XSUOvp0O7T49Cg==\";}', 'a:4:{s:20:\"sending_phone_number\";N;s:22:\"disable_trackable_urls\";i:0;s:16:\"frequency_number\";N;s:14:\"frequency_time\";N;}');" +mysql -uroot -proot -hmysql -e "USE mautictest; INSERT INTO plugin_integration_settings (plugin_id, name, is_published, supported_features, api_keys, feature_settings) VALUES (NULL, 'Twilio', 1, 'a:0:{}', 'a:2:{s:8:\"username\";s:169:\"bzFmNlIydWRSZXlIN2lQVkdpanJ4aTQ2NUh6RVdDbHlLRVhsWGZ4b0kyZVNxLzYrQ1J6V1RvMnlhVEp0c245TEp6eStQekx5ZVhLWjB1YVdoR3RnR2dHQ3k1emVVdGt5NzZKUmtjUnJ3c1E9|L8tbZRIYhwatT7Mq+HAdYA==\";s:8:\"password\";s:169:\"T2d2cFpXQWE5YVZnNFFianJSYURRYUtGRHBNZGZjM1VETXg2Wm5Va3NheW43MjVWUlJhTVlCL2pYMDBpbElONStiVVBNbEM3M3BaeGJMNkFKNUFEN1pTNldSRjc4bUM4SDh1SE9OY1k5MTg9|TeuSvfx4XSUOvp0O7T49Cg==\";}', 'a:4:{s:20:\"sending_phone_number\";N;s:22:\"disable_trackable_urls\";i:0;s:16:\"frequency_number\";N;s:14:\"frequency_time\";N;}');" php bin/console mautic:plugins:reload --env=dev diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index f311be3d..9e5341ef 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -24,7 +24,7 @@ jobs: mysql: image: mysql:5.7 env: - MYSQL_ALLOW_EMPTY_PASSWORD: yes + MYSQL_ROOT_PASSWORD: root MYSQL_DATABASE: mautictest ports: - 3306:3306 @@ -45,7 +45,7 @@ jobs: env: MAUTIC_DB_HOST: mysql MAUTIC_DB_USER: root - MAUTIC_DB_PASSWORD: "" + MAUTIC_DB_PASSWORD: root MAUTIC_DB_NAME: mautictest MAUTIC_RUN_CRON_JOBS: "false" ports: From 7ec42948e1120531cb0de902a1cad66f824c31dd Mon Sep 17 00:00:00 2001 From: Mattias Michaux Date: Fri, 10 Feb 2023 21:26:50 +0100 Subject: [PATCH 05/40] correct copy --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 9e5341ef..d38d76f3 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -74,7 +74,7 @@ jobs: - name: Prepare Mautic installation run: | - sudo docker cp /tmp/ci-files/prepare_mautic.sh mautic:/tmp/prepare_mautic.sh + sudo docker cp .github/ci-files/prepare_mautic.sh mautic:/tmp/prepare_mautic.sh sudo docker exec -it mautic "bash /tmp/prepare_mautic.sh" - name: Install dependencies From dfb16c98544b60238730fdc8a63e3456794a951b Mon Sep 17 00:00:00 2001 From: Mattias Michaux Date: Fri, 10 Feb 2023 21:32:07 +0100 Subject: [PATCH 06/40] give mautic a name --- .github/workflows/tests.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index d38d76f3..a89c3970 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -55,6 +55,7 @@ jobs: --health-interval=10s --health-timeout=5s --health-retries=10 + --name=mautic steps: - uses: actions/checkout@v3 From 4f76fc318ca5a9d459ca10025bbdad1bf91312d4 Mon Sep 17 00:00:00 2001 From: Mattias Michaux Date: Fri, 10 Feb 2023 21:43:41 +0100 Subject: [PATCH 07/40] does this work? --- .github/workflows/tests.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index a89c3970..727f2e2d 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -76,7 +76,8 @@ jobs: - name: Prepare Mautic installation run: | sudo docker cp .github/ci-files/prepare_mautic.sh mautic:/tmp/prepare_mautic.sh - sudo docker exec -it mautic "bash /tmp/prepare_mautic.sh" + sudo docker exec -it mautic chmod 755 /tmp/prepare_mautic.sh + sudo docker exec -it mautic /tmp/prepare_mautic.sh - name: Install dependencies run: | From 80538a12d9e5e79d63ba894ba5e2fe3a6b6ce886 Mon Sep 17 00:00:00 2001 From: Mattias Michaux Date: Fri, 10 Feb 2023 21:46:22 +0100 Subject: [PATCH 08/40] no tty --- .github/workflows/tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 727f2e2d..81cf7ba5 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -76,8 +76,8 @@ jobs: - name: Prepare Mautic installation run: | sudo docker cp .github/ci-files/prepare_mautic.sh mautic:/tmp/prepare_mautic.sh - sudo docker exec -it mautic chmod 755 /tmp/prepare_mautic.sh - sudo docker exec -it mautic /tmp/prepare_mautic.sh + sudo docker exec mautic chmod 755 /tmp/prepare_mautic.sh + sudo docker exec mautic /tmp/prepare_mautic.sh - name: Install dependencies run: | From 951de60c135faab801ef3381f593703eb62bf6c3 Mon Sep 17 00:00:00 2001 From: Mattias Michaux Date: Fri, 10 Feb 2023 21:50:59 +0100 Subject: [PATCH 09/40] first step --- .github/workflows/tests.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 81cf7ba5..69f497b9 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -57,6 +57,12 @@ jobs: --health-retries=10 --name=mautic steps: + - name: Prepare Mautic installation + run: | + sudo docker cp .github/ci-files/prepare_mautic.sh mautic:/tmp/prepare_mautic.sh + sudo docker exec mautic chmod 755 /tmp/prepare_mautic.sh + sudo docker exec mautic /tmp/prepare_mautic.sh + - uses: actions/checkout@v3 - name: Copy our API library config into the tests/ folder @@ -73,12 +79,6 @@ jobs: - name: Set SYMFONY_ENV to test run: echo "SYMFONY_ENV=test" >> $GITHUB_ENV - - name: Prepare Mautic installation - run: | - sudo docker cp .github/ci-files/prepare_mautic.sh mautic:/tmp/prepare_mautic.sh - sudo docker exec mautic chmod 755 /tmp/prepare_mautic.sh - sudo docker exec mautic /tmp/prepare_mautic.sh - - name: Install dependencies run: | composer validate --strict From 950d6fd15bf1698657e79a0f315e033e7fcd3348 Mon Sep 17 00:00:00 2001 From: Mattias Michaux Date: Fri, 10 Feb 2023 21:53:44 +0100 Subject: [PATCH 10/40] we need the source obviously --- .github/workflows/tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 69f497b9..bfd64666 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -57,13 +57,13 @@ jobs: --health-retries=10 --name=mautic steps: + - uses: actions/checkout@v3 + - name: Prepare Mautic installation run: | sudo docker cp .github/ci-files/prepare_mautic.sh mautic:/tmp/prepare_mautic.sh sudo docker exec mautic chmod 755 /tmp/prepare_mautic.sh sudo docker exec mautic /tmp/prepare_mautic.sh - - - uses: actions/checkout@v3 - name: Copy our API library config into the tests/ folder run: cp -a ./.github/ci-files/local.config.php tests/local.config.php From d47a158360b920bec6e2147535f6576d9e9109f0 Mon Sep 17 00:00:00 2001 From: Mattias Michaux Date: Fri, 10 Feb 2023 21:57:23 +0100 Subject: [PATCH 11/40] no dev env --- .github/ci-files/prepare_mautic.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/ci-files/prepare_mautic.sh b/.github/ci-files/prepare_mautic.sh index 751683e3..f18334a1 100644 --- a/.github/ci-files/prepare_mautic.sh +++ b/.github/ci-files/prepare_mautic.sh @@ -4,7 +4,7 @@ set -e cd /var/www/html php bin/console mautic:install http://localhost/ \ - --force --mailer_from_name="GitHub Actions" --mailer_from_email="github-actions@mautic.org" --mailer_transport="smtp" --mailer_host="mailhog" --mailer_port="1025" --env=dev -php bin/console cache:warmup --no-interaction --env=dev + --force --mailer_from_name="GitHub Actions" --mailer_from_email="github-actions@mautic.org" --mailer_transport="smtp" --mailer_host="mailhog" --mailer_port="1025" +php bin/console cache:warmup --no-interaction mysql -uroot -proot -hmysql -e "USE mautictest; INSERT INTO plugin_integration_settings (plugin_id, name, is_published, supported_features, api_keys, feature_settings) VALUES (NULL, 'Twilio', 1, 'a:0:{}', 'a:2:{s:8:\"username\";s:169:\"bzFmNlIydWRSZXlIN2lQVkdpanJ4aTQ2NUh6RVdDbHlLRVhsWGZ4b0kyZVNxLzYrQ1J6V1RvMnlhVEp0c245TEp6eStQekx5ZVhLWjB1YVdoR3RnR2dHQ3k1emVVdGt5NzZKUmtjUnJ3c1E9|L8tbZRIYhwatT7Mq+HAdYA==\";s:8:\"password\";s:169:\"T2d2cFpXQWE5YVZnNFFianJSYURRYUtGRHBNZGZjM1VETXg2Wm5Va3NheW43MjVWUlJhTVlCL2pYMDBpbElONStiVVBNbEM3M3BaeGJMNkFKNUFEN1pTNldSRjc4bUM4SDh1SE9OY1k5MTg9|TeuSvfx4XSUOvp0O7T49Cg==\";}', 'a:4:{s:20:\"sending_phone_number\";N;s:22:\"disable_trackable_urls\";i:0;s:16:\"frequency_number\";N;s:14:\"frequency_time\";N;}');" -php bin/console mautic:plugins:reload --env=dev +php bin/console mautic:plugins:reload From a5753ee9b56685ac389f43e1ada866cf958c6dd5 Mon Sep 17 00:00:00 2001 From: Mattias Michaux Date: Fri, 10 Feb 2023 22:00:51 +0100 Subject: [PATCH 12/40] more params --- .github/ci-files/prepare_mautic.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/ci-files/prepare_mautic.sh b/.github/ci-files/prepare_mautic.sh index f18334a1..2e9669ff 100644 --- a/.github/ci-files/prepare_mautic.sh +++ b/.github/ci-files/prepare_mautic.sh @@ -3,8 +3,7 @@ set -e cd /var/www/html -php bin/console mautic:install http://localhost/ \ - --force --mailer_from_name="GitHub Actions" --mailer_from_email="github-actions@mautic.org" --mailer_transport="smtp" --mailer_host="mailhog" --mailer_port="1025" +php bin/console mautic:install http://localhost/ --force --mailer_from_name="GitHub Actions" --mailer_from_email="github-actions@mautic.org" --mailer_transport="smtp" --mailer_host="mailhog" --mailer_port="1025" --admin_username=admin --admin_password=mautic --admin_email="bla@bla.be" php bin/console cache:warmup --no-interaction mysql -uroot -proot -hmysql -e "USE mautictest; INSERT INTO plugin_integration_settings (plugin_id, name, is_published, supported_features, api_keys, feature_settings) VALUES (NULL, 'Twilio', 1, 'a:0:{}', 'a:2:{s:8:\"username\";s:169:\"bzFmNlIydWRSZXlIN2lQVkdpanJ4aTQ2NUh6RVdDbHlLRVhsWGZ4b0kyZVNxLzYrQ1J6V1RvMnlhVEp0c245TEp6eStQekx5ZVhLWjB1YVdoR3RnR2dHQ3k1emVVdGt5NzZKUmtjUnJ3c1E9|L8tbZRIYhwatT7Mq+HAdYA==\";s:8:\"password\";s:169:\"T2d2cFpXQWE5YVZnNFFianJSYURRYUtGRHBNZGZjM1VETXg2Wm5Va3NheW43MjVWUlJhTVlCL2pYMDBpbElONStiVVBNbEM3M3BaeGJMNkFKNUFEN1pTNldSRjc4bUM4SDh1SE9OY1k5MTg9|TeuSvfx4XSUOvp0O7T49Cg==\";}', 'a:4:{s:20:\"sending_phone_number\";N;s:22:\"disable_trackable_urls\";i:0;s:16:\"frequency_number\";N;s:14:\"frequency_time\";N;}');" php bin/console mautic:plugins:reload From 1a8a07fefae02f593bcb9eb8d2475cf25f2780b9 Mon Sep 17 00:00:00 2001 From: Mattias Michaux Date: Fri, 10 Feb 2023 22:06:24 +0100 Subject: [PATCH 13/40] more config --- .github/ci-files/local.config.php | 4 ++-- .github/ci-files/prepare_mautic.sh | 14 ++++++++++++++ 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/.github/ci-files/local.config.php b/.github/ci-files/local.config.php index d9213085..c69ba12c 100644 --- a/.github/ci-files/local.config.php +++ b/.github/ci-files/local.config.php @@ -52,10 +52,10 @@ 'version' => 'OAuth1a', // Required for OAuth1a and OAuth2 - 'baseUrl' => 'http://localhost/index_dev.php', + 'baseUrl' => 'http://localhost/', // Required for All tests - 'apiUrl' => 'http://localhost/index_dev.php/api/', + 'apiUrl' => 'http://localhost/api/', // Required for EmailsTest 'testEmail' => 'notexisting@email.com', diff --git a/.github/ci-files/prepare_mautic.sh b/.github/ci-files/prepare_mautic.sh index 2e9669ff..3f27eb23 100644 --- a/.github/ci-files/prepare_mautic.sh +++ b/.github/ci-files/prepare_mautic.sh @@ -7,3 +7,17 @@ php bin/console mautic:install http://localhost/ --force --mailer_from_name="Git php bin/console cache:warmup --no-interaction mysql -uroot -proot -hmysql -e "USE mautictest; INSERT INTO plugin_integration_settings (plugin_id, name, is_published, supported_features, api_keys, feature_settings) VALUES (NULL, 'Twilio', 1, 'a:0:{}', 'a:2:{s:8:\"username\";s:169:\"bzFmNlIydWRSZXlIN2lQVkdpanJ4aTQ2NUh6RVdDbHlLRVhsWGZ4b0kyZVNxLzYrQ1J6V1RvMnlhVEp0c245TEp6eStQekx5ZVhLWjB1YVdoR3RnR2dHQ3k1emVVdGt5NzZKUmtjUnJ3c1E9|L8tbZRIYhwatT7Mq+HAdYA==\";s:8:\"password\";s:169:\"T2d2cFpXQWE5YVZnNFFianJSYURRYUtGRHBNZGZjM1VETXg2Wm5Va3NheW43MjVWUlJhTVlCL2pYMDBpbElONStiVVBNbEM3M3BaeGJMNkFKNUFEN1pTNldSRjc4bUM4SDh1SE9OY1k5MTg9|TeuSvfx4XSUOvp0O7T49Cg==\";}', 'a:4:{s:20:\"sending_phone_number\";N;s:22:\"disable_trackable_urls\";i:0;s:16:\"frequency_number\";N;s:14:\"frequency_time\";N;}');" php bin/console mautic:plugins:reload + +cat << EOF > app/config/parameter_local.php + + true, + 'api_enable_basic_auth' => true, +]; +EOF + + From b4949dba7d9eabb436975e8d11eb54e608cc8de0 Mon Sep 17 00:00:00 2001 From: Mattias Michaux Date: Fri, 10 Feb 2023 22:09:40 +0100 Subject: [PATCH 14/40] reshuffle --- .github/ci-files/prepare_mautic.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/ci-files/prepare_mautic.sh b/.github/ci-files/prepare_mautic.sh index 3f27eb23..8e2a6c46 100644 --- a/.github/ci-files/prepare_mautic.sh +++ b/.github/ci-files/prepare_mautic.sh @@ -4,12 +4,8 @@ set -e cd /var/www/html php bin/console mautic:install http://localhost/ --force --mailer_from_name="GitHub Actions" --mailer_from_email="github-actions@mautic.org" --mailer_transport="smtp" --mailer_host="mailhog" --mailer_port="1025" --admin_username=admin --admin_password=mautic --admin_email="bla@bla.be" -php bin/console cache:warmup --no-interaction -mysql -uroot -proot -hmysql -e "USE mautictest; INSERT INTO plugin_integration_settings (plugin_id, name, is_published, supported_features, api_keys, feature_settings) VALUES (NULL, 'Twilio', 1, 'a:0:{}', 'a:2:{s:8:\"username\";s:169:\"bzFmNlIydWRSZXlIN2lQVkdpanJ4aTQ2NUh6RVdDbHlLRVhsWGZ4b0kyZVNxLzYrQ1J6V1RvMnlhVEp0c245TEp6eStQekx5ZVhLWjB1YVdoR3RnR2dHQ3k1emVVdGt5NzZKUmtjUnJ3c1E9|L8tbZRIYhwatT7Mq+HAdYA==\";s:8:\"password\";s:169:\"T2d2cFpXQWE5YVZnNFFianJSYURRYUtGRHBNZGZjM1VETXg2Wm5Va3NheW43MjVWUlJhTVlCL2pYMDBpbElONStiVVBNbEM3M3BaeGJMNkFKNUFEN1pTNldSRjc4bUM4SDh1SE9OY1k5MTg9|TeuSvfx4XSUOvp0O7T49Cg==\";}', 'a:4:{s:20:\"sending_phone_number\";N;s:22:\"disable_trackable_urls\";i:0;s:16:\"frequency_number\";N;s:14:\"frequency_time\";N;}');" -php bin/console mautic:plugins:reload cat << EOF > app/config/parameter_local.php - Date: Fri, 10 Feb 2023 22:12:04 +0100 Subject: [PATCH 15/40] correct filename --- .github/ci-files/prepare_mautic.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/ci-files/prepare_mautic.sh b/.github/ci-files/prepare_mautic.sh index 8e2a6c46..0aa1a8c5 100644 --- a/.github/ci-files/prepare_mautic.sh +++ b/.github/ci-files/prepare_mautic.sh @@ -5,7 +5,7 @@ set -e cd /var/www/html php bin/console mautic:install http://localhost/ --force --mailer_from_name="GitHub Actions" --mailer_from_email="github-actions@mautic.org" --mailer_transport="smtp" --mailer_host="mailhog" --mailer_port="1025" --admin_username=admin --admin_password=mautic --admin_email="bla@bla.be" -cat << EOF > app/config/parameter_local.php +cat << EOF > app/config/parameters_local.php Date: Fri, 10 Feb 2023 22:15:18 +0100 Subject: [PATCH 16/40] dollars --- .github/ci-files/prepare_mautic.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/ci-files/prepare_mautic.sh b/.github/ci-files/prepare_mautic.sh index 0aa1a8c5..11441b66 100644 --- a/.github/ci-files/prepare_mautic.sh +++ b/.github/ci-files/prepare_mautic.sh @@ -10,7 +10,7 @@ cat << EOF > app/config/parameters_local.php /** * Parameter overrides for GitHub Actions. */ -$parameters = [ +\$parameters = [ 'api_enabled' => true, 'api_enable_basic_auth' => true, ]; From 585ad804d20af1c9bbf0a298219cf29723545cf6 Mon Sep 17 00:00:00 2001 From: Mattias Michaux Date: Fri, 10 Feb 2023 22:27:14 +0100 Subject: [PATCH 17/40] faster tests? + logs --- .github/ci-files/prepare_mautic.sh | 34 ++++++++++++++++++++++++++++-- .github/workflows/tests.yml | 17 +++++++++------ 2 files changed, 43 insertions(+), 8 deletions(-) diff --git a/.github/ci-files/prepare_mautic.sh b/.github/ci-files/prepare_mautic.sh index 11441b66..a11ec479 100644 --- a/.github/ci-files/prepare_mautic.sh +++ b/.github/ci-files/prepare_mautic.sh @@ -5,17 +5,47 @@ set -e cd /var/www/html php bin/console mautic:install http://localhost/ --force --mailer_from_name="GitHub Actions" --mailer_from_email="github-actions@mautic.org" --mailer_transport="smtp" --mailer_host="mailhog" --mailer_port="1025" --admin_username=admin --admin_password=mautic --admin_email="bla@bla.be" -cat << EOF > app/config/parameters_local.php +cat << 'EOF' > app/config/parameters_local.php true, 'api_enable_basic_auth' => true, ]; EOF +cat << 'EOF' > app/config/security_local.php +import('security.php'); + +// Support HTTP basic auth for test logins +$container->loadFromExtension('security', + [ + 'firewalls' => [ + 'main' => [ + // Support HTTP basic auth for test logins + 'http_basic' => true, + ], + ], + 'encoders' => [ + 'Symfony\Component\Security\Core\User\User' => [ + 'algorithm' => 'md5', + 'encode_as_base64' => false, + 'iterations' => 0, + ], + 'Mautic\UserBundle\Entity\User' => [ + 'algorithm' => 'md5', + 'encode_as_base64' => false, + 'iterations' => 0, + ], + ], + ] +); + + php bin/console cache:clear --no-interaction mysql -uroot -proot -hmysql -e "USE mautictest; INSERT INTO plugin_integration_settings (plugin_id, name, is_published, supported_features, api_keys, feature_settings) VALUES (NULL, 'Twilio', 1, 'a:0:{}', 'a:2:{s:8:\"username\";s:169:\"bzFmNlIydWRSZXlIN2lQVkdpanJ4aTQ2NUh6RVdDbHlLRVhsWGZ4b0kyZVNxLzYrQ1J6V1RvMnlhVEp0c245TEp6eStQekx5ZVhLWjB1YVdoR3RnR2dHQ3k1emVVdGt5NzZKUmtjUnJ3c1E9|L8tbZRIYhwatT7Mq+HAdYA==\";s:8:\"password\";s:169:\"T2d2cFpXQWE5YVZnNFFianJSYURRYUtGRHBNZGZjM1VETXg2Wm5Va3NheW43MjVWUlJhTVlCL2pYMDBpbElONStiVVBNbEM3M3BaeGJMNkFKNUFEN1pTNldSRjc4bUM4SDh1SE9OY1k5MTg9|TeuSvfx4XSUOvp0O7T49Cg==\";}', 'a:4:{s:20:\"sending_phone_number\";N;s:22:\"disable_trackable_urls\";i:0;s:16:\"frequency_number\";N;s:14:\"frequency_time\";N;}');" diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index bfd64666..b0549bde 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -90,12 +90,17 @@ jobs: # - name: Upload code coverage # run: bash <(curl -s https://codecov.io/bash) # -# - name: Upload logs as artifacts -# uses: actions/upload-artifact@v2 -# if: always() -# with: -# name: mautic-logs -# path: /var/www/html/var/logs/ + - name: gather logs + if: always() + run: | + sudo docker cp mautic:/var/www/html/var/logs /tmp + + - name: Upload logs as artifacts + uses: actions/upload-artifact@v2 + if: always() + with: + name: mautic-logs + path: /tmp/logs/ # # - name: Slack Notification if tests fail # uses: rtCamp/action-slack-notify@v2 From bb1b684d3e30a658e0f5f21ce3d8767b5b6af2eb Mon Sep 17 00:00:00 2001 From: Mattias Michaux Date: Fri, 10 Feb 2023 22:28:09 +0100 Subject: [PATCH 18/40] install after changing algo --- .github/ci-files/prepare_mautic.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/ci-files/prepare_mautic.sh b/.github/ci-files/prepare_mautic.sh index a11ec479..5965b374 100644 --- a/.github/ci-files/prepare_mautic.sh +++ b/.github/ci-files/prepare_mautic.sh @@ -3,7 +3,6 @@ set -e cd /var/www/html -php bin/console mautic:install http://localhost/ --force --mailer_from_name="GitHub Actions" --mailer_from_email="github-actions@mautic.org" --mailer_transport="smtp" --mailer_host="mailhog" --mailer_port="1025" --admin_username=admin --admin_password=mautic --admin_email="bla@bla.be" cat << 'EOF' > app/config/parameters_local.php loadFromExtension('security', ] ); - +php bin/console mautic:install http://localhost/ --force --mailer_from_name="GitHub Actions" --mailer_from_email="github-actions@mautic.org" --mailer_transport="smtp" --mailer_host="mailhog" --mailer_port="1025" --admin_username=admin --admin_password=mautic --admin_email="bla@bla.be" php bin/console cache:clear --no-interaction mysql -uroot -proot -hmysql -e "USE mautictest; INSERT INTO plugin_integration_settings (plugin_id, name, is_published, supported_features, api_keys, feature_settings) VALUES (NULL, 'Twilio', 1, 'a:0:{}', 'a:2:{s:8:\"username\";s:169:\"bzFmNlIydWRSZXlIN2lQVkdpanJ4aTQ2NUh6RVdDbHlLRVhsWGZ4b0kyZVNxLzYrQ1J6V1RvMnlhVEp0c245TEp6eStQekx5ZVhLWjB1YVdoR3RnR2dHQ3k1emVVdGt5NzZKUmtjUnJ3c1E9|L8tbZRIYhwatT7Mq+HAdYA==\";s:8:\"password\";s:169:\"T2d2cFpXQWE5YVZnNFFianJSYURRYUtGRHBNZGZjM1VETXg2Wm5Va3NheW43MjVWUlJhTVlCL2pYMDBpbElONStiVVBNbEM3M3BaeGJMNkFKNUFEN1pTNldSRjc4bUM4SDh1SE9OY1k5MTg9|TeuSvfx4XSUOvp0O7T49Cg==\";}', 'a:4:{s:20:\"sending_phone_number\";N;s:22:\"disable_trackable_urls\";i:0;s:16:\"frequency_number\";N;s:14:\"frequency_time\";N;}');" From cf2b7a18190f4a7c6aa66f6c3322088a7a97bdef Mon Sep 17 00:00:00 2001 From: Mattias Michaux Date: Fri, 10 Feb 2023 22:36:35 +0100 Subject: [PATCH 19/40] logs --- .github/ci-files/prepare_mautic.sh | 56 +++++++++++++++--------------- .github/workflows/tests.yml | 2 +- 2 files changed, 29 insertions(+), 29 deletions(-) diff --git a/.github/ci-files/prepare_mautic.sh b/.github/ci-files/prepare_mautic.sh index 5965b374..12fcfd18 100644 --- a/.github/ci-files/prepare_mautic.sh +++ b/.github/ci-files/prepare_mautic.sh @@ -15,34 +15,34 @@ $parameters = [ ]; EOF -cat << 'EOF' > app/config/security_local.php -import('security.php'); - -// Support HTTP basic auth for test logins -$container->loadFromExtension('security', - [ - 'firewalls' => [ - 'main' => [ - // Support HTTP basic auth for test logins - 'http_basic' => true, - ], - ], - 'encoders' => [ - 'Symfony\Component\Security\Core\User\User' => [ - 'algorithm' => 'md5', - 'encode_as_base64' => false, - 'iterations' => 0, - ], - 'Mautic\UserBundle\Entity\User' => [ - 'algorithm' => 'md5', - 'encode_as_base64' => false, - 'iterations' => 0, - ], - ], - ] -); +#cat << 'EOF' > app/config/security_local.php +#import('security.php'); +# +#// Support HTTP basic auth for test logins +#$container->loadFromExtension('security', +# [ +# 'firewalls' => [ +# 'main' => [ +# // Support HTTP basic auth for test logins +# 'http_basic' => true, +# ], +# ], +# 'encoders' => [ +# 'Symfony\Component\Security\Core\User\User' => [ +# 'algorithm' => 'md5', +# 'encode_as_base64' => false, +# 'iterations' => 0, +# ], +# 'Mautic\UserBundle\Entity\User' => [ +# 'algorithm' => 'md5', +# 'encode_as_base64' => false, +# 'iterations' => 0, +# ], +# ], +# ] +#); php bin/console mautic:install http://localhost/ --force --mailer_from_name="GitHub Actions" --mailer_from_email="github-actions@mautic.org" --mailer_transport="smtp" --mailer_host="mailhog" --mailer_port="1025" --admin_username=admin --admin_password=mautic --admin_email="bla@bla.be" php bin/console cache:clear --no-interaction diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index b0549bde..51b457a1 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -93,7 +93,7 @@ jobs: - name: gather logs if: always() run: | - sudo docker cp mautic:/var/www/html/var/logs /tmp + sudo docker cp mautic:/var/www/html/var/logs/ /tmp/logs - name: Upload logs as artifacts uses: actions/upload-artifact@v2 From 29cec5502bc3f8b0ca554cd7be11eef413490f85 Mon Sep 17 00:00:00 2001 From: Mattias Michaux Date: Fri, 10 Feb 2023 22:46:24 +0100 Subject: [PATCH 20/40] permissions --- .github/ci-files/prepare_mautic.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/ci-files/prepare_mautic.sh b/.github/ci-files/prepare_mautic.sh index 12fcfd18..3255231c 100644 --- a/.github/ci-files/prepare_mautic.sh +++ b/.github/ci-files/prepare_mautic.sh @@ -50,3 +50,5 @@ php bin/console cache:clear --no-interaction mysql -uroot -proot -hmysql -e "USE mautictest; INSERT INTO plugin_integration_settings (plugin_id, name, is_published, supported_features, api_keys, feature_settings) VALUES (NULL, 'Twilio', 1, 'a:0:{}', 'a:2:{s:8:\"username\";s:169:\"bzFmNlIydWRSZXlIN2lQVkdpanJ4aTQ2NUh6RVdDbHlLRVhsWGZ4b0kyZVNxLzYrQ1J6V1RvMnlhVEp0c245TEp6eStQekx5ZVhLWjB1YVdoR3RnR2dHQ3k1emVVdGt5NzZKUmtjUnJ3c1E9|L8tbZRIYhwatT7Mq+HAdYA==\";s:8:\"password\";s:169:\"T2d2cFpXQWE5YVZnNFFianJSYURRYUtGRHBNZGZjM1VETXg2Wm5Va3NheW43MjVWUlJhTVlCL2pYMDBpbElONStiVVBNbEM3M3BaeGJMNkFKNUFEN1pTNldSRjc4bUM4SDh1SE9OY1k5MTg9|TeuSvfx4XSUOvp0O7T49Cg==\";}', 'a:4:{s:20:\"sending_phone_number\";N;s:22:\"disable_trackable_urls\";i:0;s:16:\"frequency_number\";N;s:14:\"frequency_time\";N;}');" php bin/console mautic:plugins:reload +chown -R www-data:www-data var +chown -R www-data:www-data app/config \ No newline at end of file From e26654c00fd09521316a98650eb16a33c49907c8 Mon Sep 17 00:00:00 2001 From: Mattias Michaux Date: Fri, 10 Feb 2023 22:56:22 +0100 Subject: [PATCH 21/40] faster? --- .github/ci-files/prepare_mautic.sh | 57 +++++++++++++++--------------- .github/workflows/tests.yml | 9 ++++- 2 files changed, 37 insertions(+), 29 deletions(-) diff --git a/.github/ci-files/prepare_mautic.sh b/.github/ci-files/prepare_mautic.sh index 3255231c..6f5754f6 100644 --- a/.github/ci-files/prepare_mautic.sh +++ b/.github/ci-files/prepare_mautic.sh @@ -15,34 +15,35 @@ $parameters = [ ]; EOF -#cat << 'EOF' > app/config/security_local.php -#import('security.php'); -# -#// Support HTTP basic auth for test logins -#$container->loadFromExtension('security', -# [ -# 'firewalls' => [ -# 'main' => [ -# // Support HTTP basic auth for test logins -# 'http_basic' => true, -# ], -# ], -# 'encoders' => [ -# 'Symfony\Component\Security\Core\User\User' => [ -# 'algorithm' => 'md5', -# 'encode_as_base64' => false, -# 'iterations' => 0, -# ], -# 'Mautic\UserBundle\Entity\User' => [ -# 'algorithm' => 'md5', -# 'encode_as_base64' => false, -# 'iterations' => 0, -# ], -# ], -# ] -#); +cat << 'EOF2' > app/config/security_local.php +import('security.php'); + +// Support HTTP basic auth for test logins +$container->loadFromExtension('security', + [ + 'firewalls' => [ + 'main' => [ + // Support HTTP basic auth for test logins + 'http_basic' => true, + ], + ], + 'encoders' => [ + 'Symfony\Component\Security\Core\User\User' => [ + 'algorithm' => 'md5', + 'encode_as_base64' => false, + 'iterations' => 0, + ], + 'Mautic\UserBundle\Entity\User' => [ + 'algorithm' => 'md5', + 'encode_as_base64' => false, + 'iterations' => 0, + ], + ], + ] +); +EOF2 php bin/console mautic:install http://localhost/ --force --mailer_from_name="GitHub Actions" --mailer_from_email="github-actions@mautic.org" --mailer_transport="smtp" --mailer_host="mailhog" --mailer_port="1025" --admin_username=admin --admin_password=mautic --admin_email="bla@bla.be" php bin/console cache:clear --no-interaction diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 51b457a1..3f5b910e 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -28,7 +28,14 @@ jobs: MYSQL_DATABASE: mautictest ports: - 3306:3306 - options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 + options: >- + --shm-size=2gb + --name=mysql + --tmpfs=/var/lib/mysql + --health-cmd="mysqladmin ping" + --health-interval=10s + --health-timeout=5s + --health-retries=3 mailhog: image: mailhog/mailhog:latest From 13fa1bf0900b2c58c5ff878044a00b48d0e1413d Mon Sep 17 00:00:00 2001 From: Mattias Michaux Date: Sat, 11 Feb 2023 08:39:54 +0100 Subject: [PATCH 22/40] debug user password --- .github/ci-files/prepare_mautic.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/ci-files/prepare_mautic.sh b/.github/ci-files/prepare_mautic.sh index 6f5754f6..b277c067 100644 --- a/.github/ci-files/prepare_mautic.sh +++ b/.github/ci-files/prepare_mautic.sh @@ -48,8 +48,10 @@ EOF2 php bin/console mautic:install http://localhost/ --force --mailer_from_name="GitHub Actions" --mailer_from_email="github-actions@mautic.org" --mailer_transport="smtp" --mailer_host="mailhog" --mailer_port="1025" --admin_username=admin --admin_password=mautic --admin_email="bla@bla.be" php bin/console cache:clear --no-interaction -mysql -uroot -proot -hmysql -e "USE mautictest; INSERT INTO plugin_integration_settings (plugin_id, name, is_published, supported_features, api_keys, feature_settings) VALUES (NULL, 'Twilio', 1, 'a:0:{}', 'a:2:{s:8:\"username\";s:169:\"bzFmNlIydWRSZXlIN2lQVkdpanJ4aTQ2NUh6RVdDbHlLRVhsWGZ4b0kyZVNxLzYrQ1J6V1RvMnlhVEp0c245TEp6eStQekx5ZVhLWjB1YVdoR3RnR2dHQ3k1emVVdGt5NzZKUmtjUnJ3c1E9|L8tbZRIYhwatT7Mq+HAdYA==\";s:8:\"password\";s:169:\"T2d2cFpXQWE5YVZnNFFianJSYURRYUtGRHBNZGZjM1VETXg2Wm5Va3NheW43MjVWUlJhTVlCL2pYMDBpbElONStiVVBNbEM3M3BaeGJMNkFKNUFEN1pTNldSRjc4bUM4SDh1SE9OY1k5MTg9|TeuSvfx4XSUOvp0O7T49Cg==\";}', 'a:4:{s:20:\"sending_phone_number\";N;s:22:\"disable_trackable_urls\";i:0;s:16:\"frequency_number\";N;s:14:\"frequency_time\";N;}');" +mysql -uroot -proot -hmysql mautictest -e "INSERT INTO plugin_integration_settings (plugin_id, name, is_published, supported_features, api_keys, feature_settings) VALUES (NULL, 'Twilio', 1, 'a:0:{}', 'a:2:{s:8:\"username\";s:169:\"bzFmNlIydWRSZXlIN2lQVkdpanJ4aTQ2NUh6RVdDbHlLRVhsWGZ4b0kyZVNxLzYrQ1J6V1RvMnlhVEp0c245TEp6eStQekx5ZVhLWjB1YVdoR3RnR2dHQ3k1emVVdGt5NzZKUmtjUnJ3c1E9|L8tbZRIYhwatT7Mq+HAdYA==\";s:8:\"password\";s:169:\"T2d2cFpXQWE5YVZnNFFianJSYURRYUtGRHBNZGZjM1VETXg2Wm5Va3NheW43MjVWUlJhTVlCL2pYMDBpbElONStiVVBNbEM3M3BaeGJMNkFKNUFEN1pTNldSRjc4bUM4SDh1SE9OY1k5MTg9|TeuSvfx4XSUOvp0O7T49Cg==\";}', 'a:4:{s:20:\"sending_phone_number\";N;s:22:\"disable_trackable_urls\";i:0;s:16:\"frequency_number\";N;s:14:\"frequency_time\";N;}');" php bin/console mautic:plugins:reload chown -R www-data:www-data var -chown -R www-data:www-data app/config \ No newline at end of file +chown -R www-data:www-data app/config + +mysql -uroot -proot -hmysql mautictest -e 'select password from users' From 4cffa6f54f6f800acd46b5d47d217c36cd0e6793 Mon Sep 17 00:00:00 2001 From: Mattias Michaux Date: Sat, 11 Feb 2023 08:43:17 +0100 Subject: [PATCH 23/40] clear cache before --- .github/ci-files/prepare_mautic.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/ci-files/prepare_mautic.sh b/.github/ci-files/prepare_mautic.sh index b277c067..989e49bb 100644 --- a/.github/ci-files/prepare_mautic.sh +++ b/.github/ci-files/prepare_mautic.sh @@ -45,7 +45,10 @@ $container->loadFromExtension('security', ); EOF2 +php bin/console cache:clear --no-interaction + php bin/console mautic:install http://localhost/ --force --mailer_from_name="GitHub Actions" --mailer_from_email="github-actions@mautic.org" --mailer_transport="smtp" --mailer_host="mailhog" --mailer_port="1025" --admin_username=admin --admin_password=mautic --admin_email="bla@bla.be" + php bin/console cache:clear --no-interaction mysql -uroot -proot -hmysql mautictest -e "INSERT INTO plugin_integration_settings (plugin_id, name, is_published, supported_features, api_keys, feature_settings) VALUES (NULL, 'Twilio', 1, 'a:0:{}', 'a:2:{s:8:\"username\";s:169:\"bzFmNlIydWRSZXlIN2lQVkdpanJ4aTQ2NUh6RVdDbHlLRVhsWGZ4b0kyZVNxLzYrQ1J6V1RvMnlhVEp0c245TEp6eStQekx5ZVhLWjB1YVdoR3RnR2dHQ3k1emVVdGt5NzZKUmtjUnJ3c1E9|L8tbZRIYhwatT7Mq+HAdYA==\";s:8:\"password\";s:169:\"T2d2cFpXQWE5YVZnNFFianJSYURRYUtGRHBNZGZjM1VETXg2Wm5Va3NheW43MjVWUlJhTVlCL2pYMDBpbElONStiVVBNbEM3M3BaeGJMNkFKNUFEN1pTNldSRjc4bUM4SDh1SE9OY1k5MTg9|TeuSvfx4XSUOvp0O7T49Cg==\";}', 'a:4:{s:20:\"sending_phone_number\";N;s:22:\"disable_trackable_urls\";i:0;s:16:\"frequency_number\";N;s:14:\"frequency_time\";N;}');" From 27f8e894b5baae2b958346a24a177c960c5753f7 Mon Sep 17 00:00:00 2001 From: Mattias Michaux Date: Sat, 11 Feb 2023 08:57:29 +0100 Subject: [PATCH 24/40] why are they failing? --- .github/ci-files/prepare_mautic.sh | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/.github/ci-files/prepare_mautic.sh b/.github/ci-files/prepare_mautic.sh index 989e49bb..2db6ab70 100644 --- a/.github/ci-files/prepare_mautic.sh +++ b/.github/ci-files/prepare_mautic.sh @@ -45,16 +45,11 @@ $container->loadFromExtension('security', ); EOF2 -php bin/console cache:clear --no-interaction +php bin/console cache:clear --no-warmup php bin/console mautic:install http://localhost/ --force --mailer_from_name="GitHub Actions" --mailer_from_email="github-actions@mautic.org" --mailer_transport="smtp" --mailer_host="mailhog" --mailer_port="1025" --admin_username=admin --admin_password=mautic --admin_email="bla@bla.be" -php bin/console cache:clear --no-interaction - mysql -uroot -proot -hmysql mautictest -e "INSERT INTO plugin_integration_settings (plugin_id, name, is_published, supported_features, api_keys, feature_settings) VALUES (NULL, 'Twilio', 1, 'a:0:{}', 'a:2:{s:8:\"username\";s:169:\"bzFmNlIydWRSZXlIN2lQVkdpanJ4aTQ2NUh6RVdDbHlLRVhsWGZ4b0kyZVNxLzYrQ1J6V1RvMnlhVEp0c245TEp6eStQekx5ZVhLWjB1YVdoR3RnR2dHQ3k1emVVdGt5NzZKUmtjUnJ3c1E9|L8tbZRIYhwatT7Mq+HAdYA==\";s:8:\"password\";s:169:\"T2d2cFpXQWE5YVZnNFFianJSYURRYUtGRHBNZGZjM1VETXg2Wm5Va3NheW43MjVWUlJhTVlCL2pYMDBpbElONStiVVBNbEM3M3BaeGJMNkFKNUFEN1pTNldSRjc4bUM4SDh1SE9OY1k5MTg9|TeuSvfx4XSUOvp0O7T49Cg==\";}', 'a:4:{s:20:\"sending_phone_number\";N;s:22:\"disable_trackable_urls\";i:0;s:16:\"frequency_number\";N;s:14:\"frequency_time\";N;}');" php bin/console mautic:plugins:reload -chown -R www-data:www-data var -chown -R www-data:www-data app/config - -mysql -uroot -proot -hmysql mautictest -e 'select password from users' +chown -R www-data:www-data /var/www/html From e51c7382fcfdb29935e8e870a639a3477c9bd3d2 Mon Sep 17 00:00:00 2001 From: Mattias Michaux Date: Sat, 11 Feb 2023 09:08:49 +0100 Subject: [PATCH 25/40] let's see if non-parallel works --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 3f5b910e..c4c83a73 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -92,7 +92,7 @@ jobs: composer install --prefer-dist --no-progress - name: Run tests - run: vendor/bin/paratest -p 3 --coverage-clover coverage.xml + run: vendor/bin/phpunit --coverage-clover coverage.xml # - name: Upload code coverage # run: bash <(curl -s https://codecov.io/bash) From bb1dd6a8248bcd5e1c06b2912043f7e76e80dc99 Mon Sep 17 00:00:00 2001 From: Mattias Michaux Date: Sat, 11 Feb 2023 09:13:34 +0100 Subject: [PATCH 26/40] uncomment --- .github/workflows/tests.yml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index c4c83a73..dd5f705c 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -94,9 +94,9 @@ jobs: - name: Run tests run: vendor/bin/phpunit --coverage-clover coverage.xml -# - name: Upload code coverage -# run: bash <(curl -s https://codecov.io/bash) -# + - name: Upload code coverage + run: bash <(curl -s https://codecov.io/bash) + - name: gather logs if: always() run: | @@ -108,13 +108,13 @@ jobs: with: name: mautic-logs path: /tmp/logs/ -# -# - name: Slack Notification if tests fail -# uses: rtCamp/action-slack-notify@v2 -# if: ${{ failure() && github.event_name == 'schedule' }} -# env: -# SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} -# SLACK_MESSAGE: 'The daily API library tests against mautic/mautic have failed. Most likely a PR was merged recently which introduced a regression of some sort.' + + - name: Slack Notification if tests fail + uses: rtCamp/action-slack-notify@v2 + if: ${{ failure() && github.event_name == 'schedule' }} + env: + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} + SLACK_MESSAGE: 'The daily API library tests against mautic/mautic have failed. Most likely a PR was merged recently which introduced a regression of some sort.' cs: runs-on: ubuntu-20.04 From 63b44ac2e0d9aae0b0d6bbda896285ffe1acb3bb Mon Sep 17 00:00:00 2001 From: Mattias Michaux Date: Sat, 11 Feb 2023 10:10:42 +0100 Subject: [PATCH 27/40] switch to supported version --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index dd5f705c..55d1d037 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -103,7 +103,7 @@ jobs: sudo docker cp mautic:/var/www/html/var/logs/ /tmp/logs - name: Upload logs as artifacts - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 if: always() with: name: mautic-logs From f7ea514716de18e299ab835a7eaaa266f1687275 Mon Sep 17 00:00:00 2001 From: Mattias Michaux Date: Sat, 11 Feb 2023 14:09:14 +0100 Subject: [PATCH 28/40] let's try multiple images --- .github/workflows/tests.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 55d1d037..3be0491f 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -19,6 +19,9 @@ jobs: phpunit: runs-on: ubuntu-20.04 name: PHPUnit tests + strategy: + matrix: + mautic_version: [ghcr.io/mollux/docker-mautic:5.x-dev, mautic/mautic:v4-apache] services: mysql: @@ -48,7 +51,7 @@ jobs: - 6379:6379 mautic: - image: mautic/mautic:v4-apache + image: ${{ matrix.mautic_version }} env: MAUTIC_DB_HOST: mysql MAUTIC_DB_USER: root From a2302fdf48f96395903de1361ce0e52bef06b3db Mon Sep 17 00:00:00 2001 From: Mattias Michaux Date: Sat, 11 Feb 2023 14:12:41 +0100 Subject: [PATCH 29/40] quoting --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 3be0491f..42e618d5 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -21,7 +21,7 @@ jobs: name: PHPUnit tests strategy: matrix: - mautic_version: [ghcr.io/mollux/docker-mautic:5.x-dev, mautic/mautic:v4-apache] + mautic_version: ["ghcr.io/mollux/docker-mautic:5.x-dev", "mautic/mautic:v4-apache"] services: mysql: From b8d91989e9be3a48ebc6d6e5981485dcacf5c01d Mon Sep 17 00:00:00 2001 From: Mattias Michaux Date: Sat, 11 Feb 2023 14:27:47 +0100 Subject: [PATCH 30/40] correct images and path --- .github/ci-files/prepare_mautic.sh | 4 ++-- .github/workflows/tests.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/ci-files/prepare_mautic.sh b/.github/ci-files/prepare_mautic.sh index 2db6ab70..9eb04647 100644 --- a/.github/ci-files/prepare_mautic.sh +++ b/.github/ci-files/prepare_mautic.sh @@ -2,7 +2,7 @@ set -e -cd /var/www/html +cd /var/www/docroot cat << 'EOF' > app/config/parameters_local.php Date: Sat, 11 Feb 2023 14:30:35 +0100 Subject: [PATCH 31/40] correct paths --- .github/ci-files/prepare_mautic.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/ci-files/prepare_mautic.sh b/.github/ci-files/prepare_mautic.sh index 9eb04647..cb95dfb1 100644 --- a/.github/ci-files/prepare_mautic.sh +++ b/.github/ci-files/prepare_mautic.sh @@ -2,9 +2,9 @@ set -e -cd /var/www/docroot +cd /var/www -cat << 'EOF' > app/config/parameters_local.php +cat << 'EOF' > docroot/app/config/parameters_local.php app/config/security_local.php +cat << 'EOF2' > docroot/app/config/security_local.php import('security.php'); From 31dea6cd228afcd713facba44975c8d66eda4967 Mon Sep 17 00:00:00 2001 From: Mattias Michaux Date: Sat, 11 Feb 2023 15:03:29 +0100 Subject: [PATCH 32/40] we need mysql binary --- .github/ci-files/prepare_mautic.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/ci-files/prepare_mautic.sh b/.github/ci-files/prepare_mautic.sh index cb95dfb1..9f779f4a 100644 --- a/.github/ci-files/prepare_mautic.sh +++ b/.github/ci-files/prepare_mautic.sh @@ -2,6 +2,8 @@ set -e +apt-get update && apt-get install default-mysql-client -y + cd /var/www cat << 'EOF' > docroot/app/config/parameters_local.php From 780ad624150b3ce22deceeb5fd7e3a705b0e68fd Mon Sep 17 00:00:00 2001 From: Mattias Michaux Date: Sat, 11 Feb 2023 15:07:48 +0100 Subject: [PATCH 33/40] new log dir --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 743c9a35..3007fbf2 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -103,7 +103,7 @@ jobs: - name: gather logs if: always() run: | - sudo docker cp mautic:/var/www/html/var/logs/ /tmp/logs + sudo docker cp mautic:/var/www/var/logs/ /tmp/logs - name: Upload logs as artifacts uses: actions/upload-artifact@v3 From cca1f49419cf98003dd3e293e163da036d4153db Mon Sep 17 00:00:00 2001 From: Mattias Michaux Date: Sat, 11 Feb 2023 15:30:43 +0100 Subject: [PATCH 34/40] workaround for failing tests --- .github/ci-files/prepare_mautic.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/ci-files/prepare_mautic.sh b/.github/ci-files/prepare_mautic.sh index 9f779f4a..5b2e2296 100644 --- a/.github/ci-files/prepare_mautic.sh +++ b/.github/ci-files/prepare_mautic.sh @@ -54,4 +54,6 @@ php bin/console mautic:install http://localhost/ --force --mailer_from_name="Git mysql -uroot -proot -hmysql mautictest -e "INSERT INTO plugin_integration_settings (plugin_id, name, is_published, supported_features, api_keys, feature_settings) VALUES (NULL, 'Twilio', 1, 'a:0:{}', 'a:2:{s:8:\"username\";s:169:\"bzFmNlIydWRSZXlIN2lQVkdpanJ4aTQ2NUh6RVdDbHlLRVhsWGZ4b0kyZVNxLzYrQ1J6V1RvMnlhVEp0c245TEp6eStQekx5ZVhLWjB1YVdoR3RnR2dHQ3k1emVVdGt5NzZKUmtjUnJ3c1E9|L8tbZRIYhwatT7Mq+HAdYA==\";s:8:\"password\";s:169:\"T2d2cFpXQWE5YVZnNFFianJSYURRYUtGRHBNZGZjM1VETXg2Wm5Va3NheW43MjVWUlJhTVlCL2pYMDBpbElONStiVVBNbEM3M3BaeGJMNkFKNUFEN1pTNldSRjc4bUM4SDh1SE9OY1k5MTg9|TeuSvfx4XSUOvp0O7T49Cg==\";}', 'a:4:{s:20:\"sending_phone_number\";N;s:22:\"disable_trackable_urls\";i:0;s:16:\"frequency_number\";N;s:14:\"frequency_time\";N;}');" php bin/console mautic:plugins:reload +cp -rp docroot/app/assets/images/* docroot/media/images/ + chown -R www-data:www-data /var/www From 64a43bcffd99c83a36348275b1d4b4606da45fe1 Mon Sep 17 00:00:00 2001 From: Mattias Michaux Date: Sat, 11 Feb 2023 15:40:38 +0100 Subject: [PATCH 35/40] get logs from correct dir --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 3007fbf2..623ec445 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -103,7 +103,7 @@ jobs: - name: gather logs if: always() run: | - sudo docker cp mautic:/var/www/var/logs/ /tmp/logs + sudo docker cp mautic:/var/www/docroot/var/logs/ /tmp/logs - name: Upload logs as artifacts uses: actions/upload-artifact@v3 From f91d97e66390d280c5a0c255266a17725c9a9083 Mon Sep 17 00:00:00 2001 From: Mattias Michaux Date: Sat, 11 Feb 2023 15:48:33 +0100 Subject: [PATCH 36/40] better naming --- .github/workflows/tests.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 623ec445..3dacf02f 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -21,7 +21,7 @@ jobs: name: PHPUnit tests strategy: matrix: - mautic_version: ["ghcr.io/mollux/docker-mautic:5.x-dev", "ghcr.io/mollux/docker-mautic:4.4.6"] + mautic_version: ["5.x-dev", "4.4.6"] services: mysql: @@ -51,7 +51,7 @@ jobs: - 6379:6379 mautic: - image: ${{ matrix.mautic_version }} + image: ghcr.io/mollux/docker-mautic:${{ matrix.mautic_version }} env: MAUTIC_DB_HOST: mysql MAUTIC_DB_USER: root @@ -109,7 +109,7 @@ jobs: uses: actions/upload-artifact@v3 if: always() with: - name: mautic-logs + name: mautic-logs-${{ matrix.mautic_version }} path: /tmp/logs/ - name: Slack Notification if tests fail From d17ded9871358f71e0721400b828eb7343aa4c8d Mon Sep 17 00:00:00 2001 From: Mattias Michaux Date: Sat, 11 Feb 2023 20:15:48 +0100 Subject: [PATCH 37/40] bump version --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 3dacf02f..f81b0ba1 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -21,7 +21,7 @@ jobs: name: PHPUnit tests strategy: matrix: - mautic_version: ["5.x-dev", "4.4.6"] + mautic_version: ["5.x-dev", "4.x-dev"] services: mysql: From 3b6a8937d921dc1629307ec974bfa4f9b04171ba Mon Sep 17 00:00:00 2001 From: Mattias Michaux Date: Sat, 11 Feb 2023 20:48:28 +0100 Subject: [PATCH 38/40] cleanup --- .github/ci-files/local.php | 17 ----------------- .github/workflows/tests.yml | 6 ------ 2 files changed, 23 deletions(-) delete mode 100644 .github/ci-files/local.php diff --git a/.github/ci-files/local.php b/.github/ci-files/local.php deleted file mode 100644 index 0fc13904..00000000 --- a/.github/ci-files/local.php +++ /dev/null @@ -1,17 +0,0 @@ - true, - 'api_enable_basic_auth' => true, - 'db_driver' => 'pdo_mysql', - 'db_host' => '127.0.0.1', - 'db_table_prefix' => null, - 'db_port' => getenv('DB_PORT'), - 'db_name' => 'mautictest', - 'db_user' => 'root', - 'db_password' => '', - 'admin_email' => 'github-actions@mautic.org', - 'admin_password' => 'mautic', -]; diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index f81b0ba1..df325f59 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -44,11 +44,6 @@ jobs: image: mailhog/mailhog:latest ports: - 1025:1025 - - redis: - image: redis:6 - ports: - - 6379:6379 mautic: image: ghcr.io/mollux/docker-mautic:${{ matrix.mautic_version }} @@ -82,7 +77,6 @@ jobs: uses: shivammathur/setup-php@v2 with: php-version: 8.0 - ini-values: session.save_handler=redis, session.save_path="tcp://127.0.0.1:6379" extensions: mbstring, xml, ctype, iconv, intl, pdo_sqlite, mysql, pdo_mysql coverage: pcov From 95a1d025fa66edf4b1d35b83e7e2920dae25b56b Mon Sep 17 00:00:00 2001 From: Mattias Michaux Date: Sun, 12 Feb 2023 20:16:57 +0100 Subject: [PATCH 39/40] test API on both 7.4 and 8.0 --- .github/workflows/tests.yml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index df325f59..2714387b 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -18,10 +18,11 @@ on: jobs: phpunit: runs-on: ubuntu-20.04 - name: PHPUnit tests + name: PHPUnit ${{ matrix.php-version }} ${{ matrix.mautic_version }} strategy: matrix: mautic_version: ["5.x-dev", "4.x-dev"] + php_version: ["7.4", "8.0"] services: mysql: @@ -76,8 +77,7 @@ jobs: - name: Setup PHP, with composer and extensions uses: shivammathur/setup-php@v2 with: - php-version: 8.0 - extensions: mbstring, xml, ctype, iconv, intl, pdo_sqlite, mysql, pdo_mysql + php-version: ${{ matrix.php_version }} coverage: pcov - name: Set SYMFONY_ENV to test @@ -116,6 +116,9 @@ jobs: cs: runs-on: ubuntu-20.04 name: CS tests + strategy: + matrix: + php_version: ["7.4", "8.0"] steps: - uses: actions/checkout@v3 @@ -123,8 +126,7 @@ jobs: - name: Setup PHP, with composer and extensions uses: shivammathur/setup-php@v2 with: - php-version: 8.0 - extensions: mbstring, xml, ctype, iconv, intl, pdo_sqlite, mysql, pdo_mysql + php-version: ${{ matrix.php_version }} - name: Install dependencies run: | From 4945f72bb95daf83c6a5bc466352f1e0f481b964 Mon Sep 17 00:00:00 2001 From: Mattias Michaux Date: Sun, 12 Feb 2023 20:23:05 +0100 Subject: [PATCH 40/40] let's test something --- .github/workflows/tests.yml | 4 ++-- phpunit.xml.dist | 15 ++++++++++++++- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 2714387b..063e8d4c 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -18,11 +18,11 @@ on: jobs: phpunit: runs-on: ubuntu-20.04 - name: PHPUnit ${{ matrix.php-version }} ${{ matrix.mautic_version }} + name: PHPUnit ${{ matrix.php_version }} ${{ matrix.mautic_version }} strategy: matrix: mautic_version: ["5.x-dev", "4.x-dev"] - php_version: ["7.4", "8.0"] + php_version: ["7.4", "8.0", "8.1"] services: mysql: diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 64811a6b..4b65860a 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,5 +1,18 @@ - + lib