From 4810f439e14c95695e807e2813ca726925bd3434 Mon Sep 17 00:00:00 2001 From: Chris Bateman Date: Wed, 31 Jan 2024 14:42:58 +1100 Subject: [PATCH 01/13] Delete .github/workflows/stale.yml Its important to keep issues open as it can be months or years before we get to them. This action hasn't been used for a long time and having it active would remove issues that will need attending in the future. Happy to add an auto-labler action in the future to help sort issues. --- .github/workflows/stale.yml | 25 ------------------------- 1 file changed, 25 deletions(-) delete mode 100644 .github/workflows/stale.yml diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml deleted file mode 100644 index f1142e391..000000000 --- a/.github/workflows/stale.yml +++ /dev/null @@ -1,25 +0,0 @@ -name: Close stale issues and pull requests - -on: - schedule: - - cron: 0 0 * * * - -jobs: - stale: - name: Update stale issues and pull requests - runs-on: ubuntu-latest - steps: - - uses: actions/stale@v3 - with: - repo-token: ${{ secrets.GITHUB_TOKEN }} - stale-issue-message: This issue is stale because it has been open ${{ secrets.OPEN_DAYS }} days with no activity. Remove stale label or comment or this will be closed in ${{ secrets.STALE_DAYS }} days. - stale-pr-message: This pull request is stale because it has been open ${{ secrets.OPEN_DAYS }} days with no activity. Remove stale label or comment or this will be closed in ${{ secrets.STALE_DAYS }} days. - close-issue-message: This issue has been closed because it has been open for ${{ secrets.TOTAL_DAYS }} days with no activity. - close-pr-message: This pull request has been closed because it has been open for ${{ secrets.TOTAL_DAYS }} days with no activity. - stale-issue-label: stale-closing-soon - stale-pr-label: stale-closing-soon - close-issue-label: stale-closed - close-pr-label: stale-closed - days-before-stale: ${{ secrets.OPEN_DAYS }} - days-before-close: ${{ secrets.STALE_DAYS }} - days-before-issue-close: -1 From e75dc2618e250043ef2fd9473ccef8f3cd4eeb61 Mon Sep 17 00:00:00 2001 From: Matt Bell Date: Wed, 31 Jan 2024 15:26:13 +1100 Subject: [PATCH 02/13] Fix container name --- .github/workflows/ci.yml | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 836a6af24..2df4c5339 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -69,16 +69,16 @@ jobs: docker-compose -f test_agent-compose.yml up --build -d sleep 5 docker ps - docker exec -t nginx-php8.1 bash -c "chmod -R 777 ./*" - docker exec -t nginx-php8.1 bash -c "rm -rf ./system && ln -s ./composer/vendor/2pisoftware/cmfive-core/system ./system" + docker exec -t cmfive bash -c "chmod -R 777 ./*" + docker exec -t cmfive bash -c "rm -rf ./system && ln -s ./composer/vendor/2pisoftware/cmfive-core/system ./system" echo CoreInstall - docker exec -t nginx-php8.1 bash -c "DB_HOST=mysql-8 DB_USERNAME=cmfive_test DB_PASSWORD=cmfive_test DB_DATABASE=cmfive_test DB_PORT=3306 php cmfive.php install core ${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}} 8.1" + docker exec -t cmfive bash -c "DB_HOST=mysql-8 DB_USERNAME=cmfive_test DB_PASSWORD=cmfive_test DB_DATABASE=cmfive_test DB_PORT=3306 php cmfive.php install core ${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}} 8.1" echo DBCreate docker exec -t mysql-8 bash -c "mysql -h 127.0.0.1 -u'root' -p'root' --execute \"CREATE DATABASE cmfive_test; CREATE USER cmfive_test@'%' IDENTIFIED BY 'cmfive_test'; GRANT ALL PRIVILEGES ON cmfive_test.* TO cmfive_test@'%'; GRANT PROCESS ON *.* TO cmfive_test@'%'; FLUSH PRIVILEGES;\"" - docker exec -t nginx-php8.1 bash -c "chmod -R 777 cache/ storage/ uploads/" + docker exec -t cmfive bash -c "chmod -R 777 cache/ storage/ uploads/" docker start seleniumDrv; docker ps @@ -89,21 +89,21 @@ jobs: - name: Prepare cmfive Test Backend run: | - docker exec nginx-php8.1 bash -c "cd ./test/ && sh ./.install/install.sh && chmod -R 777 /var/www/html/test/Codeception/tests" + docker exec cmfive bash -c "cd ./test/ && sh ./.install/install.sh && chmod -R 777 /var/www/html/test/Codeception/tests" - name: Apply cmfive Test Config to Core install run: | echo SeedingCmfive - docker exec nginx-php8.1 bash -c "cat config.php" - # docker exec -t nginx-php8.1 bash -c "php cmfive.php install core ${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" - docker exec -t nginx-php8.1 bash -c "DB_HOST=mysql-8 DB_USERNAME=cmfive_test DB_PASSWORD=cmfive_test DB_DATABASE=cmfive_test DB_PORT=3306 php cmfive.php seed encryption" - docker exec -t nginx-php8.1 bash -c "DB_HOST=mysql-8 DB_USERNAME=cmfive_test DB_PASSWORD=cmfive_test DB_DATABASE=cmfive_test DB_PORT=3306 php cmfive.php install migrations" - docker exec -t nginx-php8.1 bash -c "DB_HOST=mysql-8 DB_USERNAME=cmfive_test DB_PASSWORD=cmfive_test DB_DATABASE=cmfive_test DB_PORT=3306 php cmfive.php seed admin admin admin admin@example.com admin admin" - docker exec -t nginx-php8.1 bash -c "chmod -R 777 cache/ storage/ uploads/" + docker exec cmfive bash -c "cat config.php" + # docker exec -t cmfive bash -c "php cmfive.php install core ${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" + docker exec -t cmfive bash -c "DB_HOST=mysql-8 DB_USERNAME=cmfive_test DB_PASSWORD=cmfive_test DB_DATABASE=cmfive_test DB_PORT=3306 php cmfive.php seed encryption" + docker exec -t cmfive bash -c "DB_HOST=mysql-8 DB_USERNAME=cmfive_test DB_PASSWORD=cmfive_test DB_DATABASE=cmfive_test DB_PORT=3306 php cmfive.php install migrations" + docker exec -t cmfive bash -c "DB_HOST=mysql-8 DB_USERNAME=cmfive_test DB_PASSWORD=cmfive_test DB_DATABASE=cmfive_test DB_PORT=3306 php cmfive.php seed admin admin admin admin@example.com admin admin" + docker exec -t cmfive bash -c "chmod -R 777 cache/ storage/ uploads/" - name: Prepare cmfive Test DB run: | - docker exec -t nginx-php8.1 bash -c "DB_HOST=mysql-8 DB_USERNAME=cmfive_test DB_PASSWORD=cmfive_test DB_DATABASE=cmfive_test DB_PORT=3306 php cmfive.php testDB setup; exit \$?"; + docker exec -t cmfive bash -c "DB_HOST=mysql-8 DB_USERNAME=cmfive_test DB_PASSWORD=cmfive_test DB_DATABASE=cmfive_test DB_PORT=3306 php cmfive.php testDB setup; exit \$?"; # Build new layout - uses: actions/setup-node@v3 @@ -112,7 +112,7 @@ jobs: - name: Build new designs run: | - docker exec -t nginx-php8.1 bash -c "chmod -R 777 system/templates/base" + docker exec -t cmfive bash -c "chmod -R 777 system/templates/base" cd system/templates/base npm i npm run prod @@ -120,7 +120,7 @@ jobs: # Run Unit Tests - name: "Run unit tests" run: | - docker exec nginx-php8.1 bash -c "DB_HOST=mysql-8 DB_USERNAME=cmfive_test DB_PASSWORD=cmfive_test DB_DATABASE=cmfive_test DB_PORT=3306 php cmfive.php tests unit all; exit \$?" + docker exec cmfive bash -c "DB_HOST=mysql-8 DB_USERNAME=cmfive_test DB_PASSWORD=cmfive_test DB_DATABASE=cmfive_test DB_PORT=3306 php cmfive.php tests unit all; exit \$?" if [ $? -gt 0 ]; then echo "Admin module tests failed" fi @@ -133,7 +133,7 @@ jobs: # Run Acceptance Tests - name: "Confirm Codeception setup" run: | - docker exec nginx-php8.1 bash -c "ls -lah -R /var/www/html/test/Codeception/tests && cat /var/www/html/test/Codeception/*.yml && cat /var/www/html/test/Codeception/tests/*.yml" + docker exec cmfive bash -c "ls -lah -R /var/www/html/test/Codeception/tests && cat /var/www/html/test/Codeception/*.yml && cat /var/www/html/test/Codeception/tests/*.yml" # - name: "Run Playwright Module Tests" # run: | From 44cfba4628e52d8f786cd37950732093719974ee Mon Sep 17 00:00:00 2001 From: Matt Bell Date: Wed, 31 Jan 2024 15:49:33 +1100 Subject: [PATCH 03/13] Update ci.yml --- .github/workflows/ci.yml | 48 +++++++++++++++++++++------------------- 1 file changed, 25 insertions(+), 23 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2df4c5339..7e5d1f17d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -62,23 +62,25 @@ jobs: ref: 'develop' # Pre-requisites Prepare Cmfive Environment - - name: Setup cmfive Test Environment + - name: Start containers run: | cp .codepipeline/test_agent/configs/test_agent-config.php config.php + docker-compose -f docker-compose.yml -f test_agent-compose.yml up --build -d --wait --wait-timeout 120 - docker-compose -f test_agent-compose.yml up --build -d - sleep 5 + # Pre-requisites Prepare Cmfive Environment + - name: Setup cmfive Test Environment + run: | docker ps - docker exec -t cmfive bash -c "chmod -R 777 ./*" - docker exec -t cmfive bash -c "rm -rf ./system && ln -s ./composer/vendor/2pisoftware/cmfive-core/system ./system" + docker exec -t nginx-php8.1 bash -c "chmod -R 777 ./*" + docker exec -t nginx-php8.1 bash -c "rm -rf ./system && ln -s ./composer/vendor/2pisoftware/cmfive-core/system ./system" echo CoreInstall - docker exec -t cmfive bash -c "DB_HOST=mysql-8 DB_USERNAME=cmfive_test DB_PASSWORD=cmfive_test DB_DATABASE=cmfive_test DB_PORT=3306 php cmfive.php install core ${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}} 8.1" + docker exec -t nginx-php8.1 bash -c "DB_HOST=mysql-8 DB_USERNAME=cmfive_test DB_PASSWORD=cmfive_test DB_DATABASE=cmfive_test DB_PORT=3306 php cmfive.php install core ${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}} 8.1" echo DBCreate docker exec -t mysql-8 bash -c "mysql -h 127.0.0.1 -u'root' -p'root' --execute \"CREATE DATABASE cmfive_test; CREATE USER cmfive_test@'%' IDENTIFIED BY 'cmfive_test'; GRANT ALL PRIVILEGES ON cmfive_test.* TO cmfive_test@'%'; GRANT PROCESS ON *.* TO cmfive_test@'%'; FLUSH PRIVILEGES;\"" - docker exec -t cmfive bash -c "chmod -R 777 cache/ storage/ uploads/" + docker exec -t nginx-php8.1 bash -c "chmod -R 777 cache/ storage/ uploads/" docker start seleniumDrv; docker ps @@ -89,38 +91,38 @@ jobs: - name: Prepare cmfive Test Backend run: | - docker exec cmfive bash -c "cd ./test/ && sh ./.install/install.sh && chmod -R 777 /var/www/html/test/Codeception/tests" + docker exec nginx-php8.1 bash -c "cd ./test/ && sh ./.install/install.sh && chmod -R 777 /var/www/html/test/Codeception/tests" - name: Apply cmfive Test Config to Core install run: | echo SeedingCmfive - docker exec cmfive bash -c "cat config.php" - # docker exec -t cmfive bash -c "php cmfive.php install core ${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" - docker exec -t cmfive bash -c "DB_HOST=mysql-8 DB_USERNAME=cmfive_test DB_PASSWORD=cmfive_test DB_DATABASE=cmfive_test DB_PORT=3306 php cmfive.php seed encryption" - docker exec -t cmfive bash -c "DB_HOST=mysql-8 DB_USERNAME=cmfive_test DB_PASSWORD=cmfive_test DB_DATABASE=cmfive_test DB_PORT=3306 php cmfive.php install migrations" - docker exec -t cmfive bash -c "DB_HOST=mysql-8 DB_USERNAME=cmfive_test DB_PASSWORD=cmfive_test DB_DATABASE=cmfive_test DB_PORT=3306 php cmfive.php seed admin admin admin admin@example.com admin admin" - docker exec -t cmfive bash -c "chmod -R 777 cache/ storage/ uploads/" + docker exec nginx-php8.1 bash -c "cat config.php" + # docker exec -t nginx-php8.1 bash -c "php cmfive.php install core ${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" + docker exec -t nginx-php8.1 bash -c "DB_HOST=mysql-8 DB_USERNAME=cmfive_test DB_PASSWORD=cmfive_test DB_DATABASE=cmfive_test DB_PORT=3306 php cmfive.php seed encryption" + docker exec -t nginx-php8.1 bash -c "DB_HOST=mysql-8 DB_USERNAME=cmfive_test DB_PASSWORD=cmfive_test DB_DATABASE=cmfive_test DB_PORT=3306 php cmfive.php install migrations" + docker exec -t nginx-php8.1 bash -c "DB_HOST=mysql-8 DB_USERNAME=cmfive_test DB_PASSWORD=cmfive_test DB_DATABASE=cmfive_test DB_PORT=3306 php cmfive.php seed admin admin admin admin@example.com admin admin" + docker exec -t nginx-php8.1 bash -c "chmod -R 777 cache/ storage/ uploads/" - name: Prepare cmfive Test DB run: | - docker exec -t cmfive bash -c "DB_HOST=mysql-8 DB_USERNAME=cmfive_test DB_PASSWORD=cmfive_test DB_DATABASE=cmfive_test DB_PORT=3306 php cmfive.php testDB setup; exit \$?"; + docker exec -t nginx-php8.1 bash -c "DB_HOST=mysql-8 DB_USERNAME=cmfive_test DB_PASSWORD=cmfive_test DB_DATABASE=cmfive_test DB_PORT=3306 php cmfive.php testDB setup; exit \$?"; # Build new layout - uses: actions/setup-node@v3 with: node-version: 18 - - name: Build new designs - run: | - docker exec -t cmfive bash -c "chmod -R 777 system/templates/base" - cd system/templates/base - npm i - npm run prod + # - name: Build new designs + # run: | + # docker exec -t nginx-php8.1 bash -c "chmod -R 777 system/templates/base" + # cd system/templates/base + # npm i + # npm run prod # Run Unit Tests - name: "Run unit tests" run: | - docker exec cmfive bash -c "DB_HOST=mysql-8 DB_USERNAME=cmfive_test DB_PASSWORD=cmfive_test DB_DATABASE=cmfive_test DB_PORT=3306 php cmfive.php tests unit all; exit \$?" + docker exec nginx-php8.1 bash -c "DB_HOST=mysql-8 DB_USERNAME=cmfive_test DB_PASSWORD=cmfive_test DB_DATABASE=cmfive_test DB_PORT=3306 php cmfive.php tests unit all; exit \$?" if [ $? -gt 0 ]; then echo "Admin module tests failed" fi @@ -133,7 +135,7 @@ jobs: # Run Acceptance Tests - name: "Confirm Codeception setup" run: | - docker exec cmfive bash -c "ls -lah -R /var/www/html/test/Codeception/tests && cat /var/www/html/test/Codeception/*.yml && cat /var/www/html/test/Codeception/tests/*.yml" + docker exec nginx-php8.1 bash -c "ls -lah -R /var/www/html/test/Codeception/tests && cat /var/www/html/test/Codeception/*.yml && cat /var/www/html/test/Codeception/tests/*.yml" # - name: "Run Playwright Module Tests" # run: | From ad4c5ebda0646f107cfe65b45dca81e425decc38 Mon Sep 17 00:00:00 2001 From: Matt Bell Date: Wed, 31 Jan 2024 15:54:29 +1100 Subject: [PATCH 04/13] Update ci.yml --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7e5d1f17d..62fcadab6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -65,7 +65,7 @@ jobs: - name: Start containers run: | cp .codepipeline/test_agent/configs/test_agent-config.php config.php - docker-compose -f docker-compose.yml -f test_agent-compose.yml up --build -d --wait --wait-timeout 120 + docker compose -f docker-compose.yml -f test_agent-compose.yml up --build -d --wait --wait-timeout 120 # Pre-requisites Prepare Cmfive Environment - name: Setup cmfive Test Environment From eca39d5b78d4124e430e23a6d7894c1ec40c4f7a Mon Sep 17 00:00:00 2001 From: Matt Bell Date: Wed, 31 Jan 2024 16:53:54 +1100 Subject: [PATCH 05/13] Update ci.yml --- .github/workflows/ci.yml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 62fcadab6..defad5b8f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -65,7 +65,7 @@ jobs: - name: Start containers run: | cp .codepipeline/test_agent/configs/test_agent-config.php config.php - docker compose -f docker-compose.yml -f test_agent-compose.yml up --build -d --wait --wait-timeout 120 + docker compose -f docker-compose.yml up --build -d --wait --wait-timeout 120 # Pre-requisites Prepare Cmfive Environment - name: Setup cmfive Test Environment @@ -93,15 +93,15 @@ jobs: run: | docker exec nginx-php8.1 bash -c "cd ./test/ && sh ./.install/install.sh && chmod -R 777 /var/www/html/test/Codeception/tests" - - name: Apply cmfive Test Config to Core install - run: | - echo SeedingCmfive - docker exec nginx-php8.1 bash -c "cat config.php" - # docker exec -t nginx-php8.1 bash -c "php cmfive.php install core ${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" - docker exec -t nginx-php8.1 bash -c "DB_HOST=mysql-8 DB_USERNAME=cmfive_test DB_PASSWORD=cmfive_test DB_DATABASE=cmfive_test DB_PORT=3306 php cmfive.php seed encryption" - docker exec -t nginx-php8.1 bash -c "DB_HOST=mysql-8 DB_USERNAME=cmfive_test DB_PASSWORD=cmfive_test DB_DATABASE=cmfive_test DB_PORT=3306 php cmfive.php install migrations" - docker exec -t nginx-php8.1 bash -c "DB_HOST=mysql-8 DB_USERNAME=cmfive_test DB_PASSWORD=cmfive_test DB_DATABASE=cmfive_test DB_PORT=3306 php cmfive.php seed admin admin admin admin@example.com admin admin" - docker exec -t nginx-php8.1 bash -c "chmod -R 777 cache/ storage/ uploads/" + # - name: Apply cmfive Test Config to Core install + # run: | + # echo SeedingCmfive + # docker exec nginx-php8.1 bash -c "cat config.php" + # # docker exec -t nginx-php8.1 bash -c "php cmfive.php install core ${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" + # docker exec -t nginx-php8.1 bash -c "DB_HOST=mysql-8 DB_USERNAME=cmfive_test DB_PASSWORD=cmfive_test DB_DATABASE=cmfive_test DB_PORT=3306 php cmfive.php seed encryption" + # docker exec -t nginx-php8.1 bash -c "DB_HOST=mysql-8 DB_USERNAME=cmfive_test DB_PASSWORD=cmfive_test DB_DATABASE=cmfive_test DB_PORT=3306 php cmfive.php install migrations" + # docker exec -t nginx-php8.1 bash -c "DB_HOST=mysql-8 DB_USERNAME=cmfive_test DB_PASSWORD=cmfive_test DB_DATABASE=cmfive_test DB_PORT=3306 php cmfive.php seed admin admin admin admin@example.com admin admin" + # docker exec -t nginx-php8.1 bash -c "chmod -R 777 cache/ storage/ uploads/" - name: Prepare cmfive Test DB run: | From 44e79e6f359de135bfb1a721b0c82288347ae437 Mon Sep 17 00:00:00 2001 From: Matt Bell Date: Wed, 31 Jan 2024 17:04:32 +1100 Subject: [PATCH 06/13] Update ci.yml --- .github/workflows/ci.yml | 47 +++++++++++++++++++++------------------- 1 file changed, 25 insertions(+), 22 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index defad5b8f..e3b53910e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -70,20 +70,23 @@ jobs: # Pre-requisites Prepare Cmfive Environment - name: Setup cmfive Test Environment run: | - docker ps - docker exec -t nginx-php8.1 bash -c "chmod -R 777 ./*" - docker exec -t nginx-php8.1 bash -c "rm -rf ./system && ln -s ./composer/vendor/2pisoftware/cmfive-core/system ./system" - - echo CoreInstall - docker exec -t nginx-php8.1 bash -c "DB_HOST=mysql-8 DB_USERNAME=cmfive_test DB_PASSWORD=cmfive_test DB_DATABASE=cmfive_test DB_PORT=3306 php cmfive.php install core ${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}} 8.1" + echo DBCreate + docker exec -t mysql-8 bash -c "mysql -h 127.0.0.1 -u'root' -p'root' --execute \"CREATE DATABASE cmfive_test; CREATE USER cmfive_test@'%' IDENTIFIED BY 'cmfive_test'; GRANT ALL PRIVILEGES ON cmfive_test.* TO cmfive_test@'%'; GRANT PROCESS ON *.* TO cmfive_test@'%'; FLUSH PRIVILEGES;\"" - echo DBCreate - docker exec -t mysql-8 bash -c "mysql -h 127.0.0.1 -u'root' -p'root' --execute \"CREATE DATABASE cmfive_test; CREATE USER cmfive_test@'%' IDENTIFIED BY 'cmfive_test'; GRANT ALL PRIVILEGES ON cmfive_test.* TO cmfive_test@'%'; GRANT PROCESS ON *.* TO cmfive_test@'%'; FLUSH PRIVILEGES;\"" + # docker ps + # docker exec -t cmfive bash -c "chmod -R 777 ./*" + # docker exec -t cmfive bash -c "rm -rf ./system && ln -s ./composer/vendor/2pisoftware/cmfive-core/system ./system" + + # echo CoreInstall + # docker exec -t cmfive bash -c "DB_HOST=mysql-8 DB_USERNAME=cmfive_test DB_PASSWORD=cmfive_test DB_DATABASE=cmfive_test DB_PORT=3306 php cmfive.php install core ${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}} 8.1" - docker exec -t nginx-php8.1 bash -c "chmod -R 777 cache/ storage/ uploads/" + # echo DBCreate + # docker exec -t mysql-8 bash -c "mysql -h 127.0.0.1 -u'root' -p'root' --execute \"CREATE DATABASE cmfive_test; CREATE USER cmfive_test@'%' IDENTIFIED BY 'cmfive_test'; GRANT ALL PRIVILEGES ON cmfive_test.* TO cmfive_test@'%'; GRANT PROCESS ON *.* TO cmfive_test@'%'; FLUSH PRIVILEGES;\"" + + # docker exec -t cmfive bash -c "chmod -R 777 cache/ storage/ uploads/" - docker start seleniumDrv; - docker ps + # docker start seleniumDrv; + # docker ps - name: Inject configs into cmfive Test Environment run: | echo "Inheriting test_agent config from PIPELINE" @@ -91,21 +94,21 @@ jobs: - name: Prepare cmfive Test Backend run: | - docker exec nginx-php8.1 bash -c "cd ./test/ && sh ./.install/install.sh && chmod -R 777 /var/www/html/test/Codeception/tests" + docker exec cmfive bash -c "cd ./test/ && sh ./.install/install.sh && chmod -R 777 /var/www/html/test/Codeception/tests" # - name: Apply cmfive Test Config to Core install # run: | # echo SeedingCmfive - # docker exec nginx-php8.1 bash -c "cat config.php" - # # docker exec -t nginx-php8.1 bash -c "php cmfive.php install core ${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" - # docker exec -t nginx-php8.1 bash -c "DB_HOST=mysql-8 DB_USERNAME=cmfive_test DB_PASSWORD=cmfive_test DB_DATABASE=cmfive_test DB_PORT=3306 php cmfive.php seed encryption" - # docker exec -t nginx-php8.1 bash -c "DB_HOST=mysql-8 DB_USERNAME=cmfive_test DB_PASSWORD=cmfive_test DB_DATABASE=cmfive_test DB_PORT=3306 php cmfive.php install migrations" - # docker exec -t nginx-php8.1 bash -c "DB_HOST=mysql-8 DB_USERNAME=cmfive_test DB_PASSWORD=cmfive_test DB_DATABASE=cmfive_test DB_PORT=3306 php cmfive.php seed admin admin admin admin@example.com admin admin" - # docker exec -t nginx-php8.1 bash -c "chmod -R 777 cache/ storage/ uploads/" + # docker exec cmfive bash -c "cat config.php" + # # docker exec -t cmfive bash -c "php cmfive.php install core ${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" + # docker exec -t cmfive bash -c "DB_HOST=mysql-8 DB_USERNAME=cmfive_test DB_PASSWORD=cmfive_test DB_DATABASE=cmfive_test DB_PORT=3306 php cmfive.php seed encryption" + # docker exec -t cmfive bash -c "DB_HOST=mysql-8 DB_USERNAME=cmfive_test DB_PASSWORD=cmfive_test DB_DATABASE=cmfive_test DB_PORT=3306 php cmfive.php install migrations" + # docker exec -t cmfive bash -c "DB_HOST=mysql-8 DB_USERNAME=cmfive_test DB_PASSWORD=cmfive_test DB_DATABASE=cmfive_test DB_PORT=3306 php cmfive.php seed admin admin admin admin@example.com admin admin" + # docker exec -t cmfive bash -c "chmod -R 777 cache/ storage/ uploads/" - name: Prepare cmfive Test DB run: | - docker exec -t nginx-php8.1 bash -c "DB_HOST=mysql-8 DB_USERNAME=cmfive_test DB_PASSWORD=cmfive_test DB_DATABASE=cmfive_test DB_PORT=3306 php cmfive.php testDB setup; exit \$?"; + docker exec -t cmfive bash -c "DB_HOST=mysql-8 DB_USERNAME=cmfive_test DB_PASSWORD=cmfive_test DB_DATABASE=cmfive_test DB_PORT=3306 php cmfive.php testDB setup; exit \$?"; # Build new layout - uses: actions/setup-node@v3 @@ -114,7 +117,7 @@ jobs: # - name: Build new designs # run: | - # docker exec -t nginx-php8.1 bash -c "chmod -R 777 system/templates/base" + # docker exec -t cmfive bash -c "chmod -R 777 system/templates/base" # cd system/templates/base # npm i # npm run prod @@ -122,7 +125,7 @@ jobs: # Run Unit Tests - name: "Run unit tests" run: | - docker exec nginx-php8.1 bash -c "DB_HOST=mysql-8 DB_USERNAME=cmfive_test DB_PASSWORD=cmfive_test DB_DATABASE=cmfive_test DB_PORT=3306 php cmfive.php tests unit all; exit \$?" + docker exec cmfive bash -c "DB_HOST=mysql-8 DB_USERNAME=cmfive_test DB_PASSWORD=cmfive_test DB_DATABASE=cmfive_test DB_PORT=3306 php cmfive.php tests unit all; exit \$?" if [ $? -gt 0 ]; then echo "Admin module tests failed" fi @@ -135,7 +138,7 @@ jobs: # Run Acceptance Tests - name: "Confirm Codeception setup" run: | - docker exec nginx-php8.1 bash -c "ls -lah -R /var/www/html/test/Codeception/tests && cat /var/www/html/test/Codeception/*.yml && cat /var/www/html/test/Codeception/tests/*.yml" + docker exec cmfive bash -c "ls -lah -R /var/www/html/test/Codeception/tests && cat /var/www/html/test/Codeception/*.yml && cat /var/www/html/test/Codeception/tests/*.yml" # - name: "Run Playwright Module Tests" # run: | From 120c9c98e26db52d7c4b1389e5afa68e02e242f5 Mon Sep 17 00:00:00 2001 From: Matt Bell Date: Wed, 31 Jan 2024 17:24:04 +1100 Subject: [PATCH 07/13] Update ci.yml --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e3b53910e..f2f411d24 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -72,7 +72,7 @@ jobs: run: | echo DBCreate docker exec -t mysql-8 bash -c "mysql -h 127.0.0.1 -u'root' -p'root' --execute \"CREATE DATABASE cmfive_test; CREATE USER cmfive_test@'%' IDENTIFIED BY 'cmfive_test'; GRANT ALL PRIVILEGES ON cmfive_test.* TO cmfive_test@'%'; GRANT PROCESS ON *.* TO cmfive_test@'%'; FLUSH PRIVILEGES;\"" - + docker exec -t cmfive bash -c "chmod -R 777 cache/ storage/ uploads/" # docker ps # docker exec -t cmfive bash -c "chmod -R 777 ./*" # docker exec -t cmfive bash -c "rm -rf ./system && ln -s ./composer/vendor/2pisoftware/cmfive-core/system ./system" @@ -83,7 +83,7 @@ jobs: # echo DBCreate # docker exec -t mysql-8 bash -c "mysql -h 127.0.0.1 -u'root' -p'root' --execute \"CREATE DATABASE cmfive_test; CREATE USER cmfive_test@'%' IDENTIFIED BY 'cmfive_test'; GRANT ALL PRIVILEGES ON cmfive_test.* TO cmfive_test@'%'; GRANT PROCESS ON *.* TO cmfive_test@'%'; FLUSH PRIVILEGES;\"" - # docker exec -t cmfive bash -c "chmod -R 777 cache/ storage/ uploads/" + # docker exec -t cmfive bash -c "chmod -R 777 cache/ storage/ uploads/" # docker start seleniumDrv; # docker ps From fccffbf1ccfd236a4dd4c40908638dfee5e7e9f3 Mon Sep 17 00:00:00 2001 From: Matt Bell Date: Thu, 1 Feb 2024 11:04:11 +1100 Subject: [PATCH 08/13] Update ci.yml --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f2f411d24..631241a22 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -72,7 +72,7 @@ jobs: run: | echo DBCreate docker exec -t mysql-8 bash -c "mysql -h 127.0.0.1 -u'root' -p'root' --execute \"CREATE DATABASE cmfive_test; CREATE USER cmfive_test@'%' IDENTIFIED BY 'cmfive_test'; GRANT ALL PRIVILEGES ON cmfive_test.* TO cmfive_test@'%'; GRANT PROCESS ON *.* TO cmfive_test@'%'; FLUSH PRIVILEGES;\"" - docker exec -t cmfive bash -c "chmod -R 777 cache/ storage/ uploads/" + docker exec -t cmfive bash -c "chmod -R 777 ./*" # docker ps # docker exec -t cmfive bash -c "chmod -R 777 ./*" # docker exec -t cmfive bash -c "rm -rf ./system && ln -s ./composer/vendor/2pisoftware/cmfive-core/system ./system" From abbb7a50ca57815bd71218555934a6289e98f36a Mon Sep 17 00:00:00 2001 From: Adam Buckley Date: Thu, 1 Feb 2024 13:49:32 +1100 Subject: [PATCH 09/13] Update ci.yml --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 631241a22..38daf2d73 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -53,7 +53,7 @@ jobs: run_test: # Checkout Boilerplate name: Unit/Acceptance tests - runs-on: ubuntu-22.04 + runs-on: ubuntu-latest-m needs: [ php-codesniffer74, php-codesniffer80, php-codesniffer81 ] steps: - uses: actions/checkout@v3 From 4679a8d01da7fc08f8ffbdf56194dba0c2355333 Mon Sep 17 00:00:00 2001 From: Adam Buckley Date: Thu, 1 Feb 2024 15:12:07 +1100 Subject: [PATCH 10/13] Update ci.yml --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 38daf2d73..4a1064350 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -59,7 +59,7 @@ jobs: - uses: actions/checkout@v3 with: repository: '2pisoftware/cmfive-boilerplate' - ref: 'develop' + ref: 'fix/PlaywrightTestIsBS5Fix' # Pre-requisites Prepare Cmfive Environment - name: Start containers From b167f19b9a8a451f455b025a71c79cab47bafb6b Mon Sep 17 00:00:00 2001 From: Matt Bell Date: Thu, 1 Feb 2024 15:34:48 +1100 Subject: [PATCH 11/13] Update ci.yml (ubuntu-22.04) --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4a1064350..7ac58c704 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -53,7 +53,7 @@ jobs: run_test: # Checkout Boilerplate name: Unit/Acceptance tests - runs-on: ubuntu-latest-m + runs-on: ubuntu-22.04 needs: [ php-codesniffer74, php-codesniffer80, php-codesniffer81 ] steps: - uses: actions/checkout@v3 From b8b7a64436a12304cb170b17e39aa59f7a1b7a6a Mon Sep 17 00:00:00 2001 From: Matt Bell Date: Thu, 1 Feb 2024 15:50:52 +1100 Subject: [PATCH 12/13] Clean up ci.yml --- .github/workflows/ci.yml | 40 ---------------------------------------- 1 file changed, 40 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7ac58c704..09d68c489 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -73,20 +73,7 @@ jobs: echo DBCreate docker exec -t mysql-8 bash -c "mysql -h 127.0.0.1 -u'root' -p'root' --execute \"CREATE DATABASE cmfive_test; CREATE USER cmfive_test@'%' IDENTIFIED BY 'cmfive_test'; GRANT ALL PRIVILEGES ON cmfive_test.* TO cmfive_test@'%'; GRANT PROCESS ON *.* TO cmfive_test@'%'; FLUSH PRIVILEGES;\"" docker exec -t cmfive bash -c "chmod -R 777 ./*" - # docker ps - # docker exec -t cmfive bash -c "chmod -R 777 ./*" - # docker exec -t cmfive bash -c "rm -rf ./system && ln -s ./composer/vendor/2pisoftware/cmfive-core/system ./system" - - # echo CoreInstall - # docker exec -t cmfive bash -c "DB_HOST=mysql-8 DB_USERNAME=cmfive_test DB_PASSWORD=cmfive_test DB_DATABASE=cmfive_test DB_PORT=3306 php cmfive.php install core ${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}} 8.1" - # echo DBCreate - # docker exec -t mysql-8 bash -c "mysql -h 127.0.0.1 -u'root' -p'root' --execute \"CREATE DATABASE cmfive_test; CREATE USER cmfive_test@'%' IDENTIFIED BY 'cmfive_test'; GRANT ALL PRIVILEGES ON cmfive_test.* TO cmfive_test@'%'; GRANT PROCESS ON *.* TO cmfive_test@'%'; FLUSH PRIVILEGES;\"" - - # docker exec -t cmfive bash -c "chmod -R 777 cache/ storage/ uploads/" - - # docker start seleniumDrv; - # docker ps - name: Inject configs into cmfive Test Environment run: | echo "Inheriting test_agent config from PIPELINE" @@ -95,16 +82,6 @@ jobs: - name: Prepare cmfive Test Backend run: | docker exec cmfive bash -c "cd ./test/ && sh ./.install/install.sh && chmod -R 777 /var/www/html/test/Codeception/tests" - - # - name: Apply cmfive Test Config to Core install - # run: | - # echo SeedingCmfive - # docker exec cmfive bash -c "cat config.php" - # # docker exec -t cmfive bash -c "php cmfive.php install core ${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" - # docker exec -t cmfive bash -c "DB_HOST=mysql-8 DB_USERNAME=cmfive_test DB_PASSWORD=cmfive_test DB_DATABASE=cmfive_test DB_PORT=3306 php cmfive.php seed encryption" - # docker exec -t cmfive bash -c "DB_HOST=mysql-8 DB_USERNAME=cmfive_test DB_PASSWORD=cmfive_test DB_DATABASE=cmfive_test DB_PORT=3306 php cmfive.php install migrations" - # docker exec -t cmfive bash -c "DB_HOST=mysql-8 DB_USERNAME=cmfive_test DB_PASSWORD=cmfive_test DB_DATABASE=cmfive_test DB_PORT=3306 php cmfive.php seed admin admin admin admin@example.com admin admin" - # docker exec -t cmfive bash -c "chmod -R 777 cache/ storage/ uploads/" - name: Prepare cmfive Test DB run: | @@ -115,13 +92,6 @@ jobs: with: node-version: 18 - # - name: Build new designs - # run: | - # docker exec -t cmfive bash -c "chmod -R 777 system/templates/base" - # cd system/templates/base - # npm i - # npm run prod - # Run Unit Tests - name: "Run unit tests" run: | @@ -139,16 +109,6 @@ jobs: - name: "Confirm Codeception setup" run: | docker exec cmfive bash -c "ls -lah -R /var/www/html/test/Codeception/tests && cat /var/www/html/test/Codeception/*.yml && cat /var/www/html/test/Codeception/tests/*.yml" - - # - name: "Run Playwright Module Tests" - # run: | - # export DB_HOST=mysql-8 DB_USERNAME=cmfive_test DB_PASSWORD=cmfive_test DB_DATABASE=cmfive_test DB_PORT=3306 - # sudo chmod 777 -R system/modules/admin/install/migrations/ - # cd test/playwright - - # for module in $PLAYWRIGHT_MODULES; do - # npm run test:with-retries --module="$module" --platform="chromium" --attempts=3 --reporter="github" - # done - name: "Run admin module tests" run: | From d13bfbe0209c0d6f5705579f8b11e778a53772ef Mon Sep 17 00:00:00 2001 From: Adam Buckley Date: Thu, 1 Feb 2024 18:42:53 +1100 Subject: [PATCH 13/13] Update ci.yml --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 09d68c489..a41ad6305 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -59,7 +59,7 @@ jobs: - uses: actions/checkout@v3 with: repository: '2pisoftware/cmfive-boilerplate' - ref: 'fix/PlaywrightTestIsBS5Fix' + ref: 'develop' # Pre-requisites Prepare Cmfive Environment - name: Start containers