Skip to content

Commit

Permalink
Merge pull request #238 from 2pisoftware/remove-stale
Browse files Browse the repository at this point in the history
Delete .github/workflows/stale.yml
  • Loading branch information
chris-bateman authored Feb 1, 2024
2 parents 1ac1110 + d13bfbe commit fb33db9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 72 deletions.
59 changes: 12 additions & 47 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,65 +62,40 @@ 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 up --build -d --wait --wait-timeout 120
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"
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;\""
# Pre-requisites Prepare Cmfive Environment
- name: Setup cmfive Test Environment
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 ./*"
docker exec -t nginx-php8.1 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"
echo 'Config::append("tests", ["testrunner" => "ENABLED"]);' >> config.php
- 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"
- 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 [email protected] admin admin"
docker exec -t nginx-php8.1 bash -c "chmod -R 777 cache/ storage/ uploads/"
docker exec cmfive bash -c "cd ./test/ && sh ./.install/install.sh && chmod -R 777 /var/www/html/test/Codeception/tests"
- 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
with:
node-version: 18

- 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 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
Expand All @@ -133,17 +108,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"
# - 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
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 admin module tests"
run: |
Expand Down
25 changes: 0 additions & 25 deletions .github/workflows/stale.yml

This file was deleted.

0 comments on commit fb33db9

Please sign in to comment.