Skip to content

Commit

Permalink
Revert yml for publish policy
Browse files Browse the repository at this point in the history
  • Loading branch information
DerekCrannaford committed Oct 4, 2024
1 parent b48c4bd commit 1fd838f
Showing 1 changed file with 86 additions and 9 deletions.
95 changes: 86 additions & 9 deletions .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
Expand Up @@ -117,12 +117,9 @@ jobs:
done
# Pre-requisites Prepare Cmfive Environment

# Tests will assume playwright code is executable
# we should rely on deployment methods already to have provisioned:
# - name: Setup cmfive Test Environment
# run: |
# docker exec -t cmfive sh -c "chmod -R ugo=rwX /var/www/html*"
- name: Setup cmfive Test Environment
run: |
docker exec -t cmfive sh -c "chmod -R ugo=rwX /var/www/html*"
- name: Inject configs into cmfive Test Environment
run: |
Expand All @@ -146,9 +143,88 @@ jobs:
echo "⚠️ WARNING: could not find dev tools in boilerplate"
fi
- name: Run Unit and Playwright tests
- name: Prepare cmfive Test DB
run: |
docker exec -t cmfive sh -c "DB_HOST=mysql-8 DB_USERNAME=root DB_PASSWORD=root DB_DATABASE=$DB_DATABASE DB_PORT=3306 php cmfive.php testDB setup; exit \$?";
# Setup Node
- uses: actions/setup-node@v4
with:
node-version: 20

# Run Unit Tests
- name: "Run unit tests"
run: |
docker exec -u root cmfive chmod -R ugo=rwX /var/www/html/test/
docker exec -u cmfive cmfive sh -c "DB_HOST=mysql-8 DB_USERNAME=$DB_USERNAME DB_PASSWORD=$DB_PASSWORD DB_DATABASE=$DB_DATABASE DB_PORT=3306 php cmfive.php tests unit all; exit \$?"
if [ $? -gt 0 ]; then
echo "Admin module tests failed"
fi
# Setup playwright
- name: Setup Playwright
run: |
echo "Installing Playwright"
cd boilerplate/test/playwright
npm ci
npx playwright install --with-deps
- name: "Run admin module tests"
run: |
docker exec -u root cmfive sh -c "chmod ugo=rwX -R /var/www/html/system/modules/admin/install/migrations/"
cd boilerplate/test/playwright
npm run build
npm run test --module="admin" --reporter="github"
if [ $? -gt 0 ]; then
echo "Admin module tests failed"
fi
- name: "Run channel module tests"
run: |
sh test/docker_run_tests.sh --cosine_container cmfive
cd boilerplate/test/playwright
npm run build
npm run test --module="channel" --reporter="github"
if [ $? -gt 0 ]; then
echo "Channel module tests failed"
fi
- name: "Run form module tests"
run: |
cd boilerplate/test/playwright
npm run build
npm run test --module="form" --reporter="github"
if [ $? -gt 0 ]; then
echo "Form module tests failed"
fi
- name: "Run report module tests"
run: |
cd boilerplate/test/playwright
npm run build
npm run test --module="report" --reporter="github"
if [ $? -gt 0 ]; then
echo "Report module tests failed"
fi
- name: "Run tag module tests"
run: |
cd boilerplate/test/playwright
npm run build
npm run test --module="tag" --reporter="github"
if [ $? -gt 0 ]; then
echo "Tag module tests failed"
fi
- name: "Run task module tests"
run: |
cd boilerplate/test/playwright
npm run build
npm run test --module="task" --reporter="github"
if [ $? -gt 0 ]; then
echo "Task module tests failed"
fi
- name: "Run timelog module tests"
run: |
cd boilerplate/test/playwright
npm run build
npm run test --module="timelog" --reporter="github"
if [ $? -gt 0 ]; then
echo "Timelog module tests failed"
fi
- name: Get container logs
if: ${{ failure() }} || ${{ success() }}
Expand All @@ -169,8 +245,9 @@ jobs:
if: ${{ failure() }} || ${{ success() }}
uses: actions/upload-artifact@v4
with:
name: test-output
name: test-output-${{matrix.node_version}}
path: |
boilerplate/test/Codeception/tests/_output/
boilerplate/storage/log/
boilerplate/test/playwright/test-results/
boilerplate/test/playwright/playwright-report/
Expand Down

0 comments on commit 1fd838f

Please sign in to comment.