Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use dev tools script, codeception removal #278

Merged
merged 13 commits into from
Mar 14, 2024
36 changes: 10 additions & 26 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ env:
DB_PASSWORD: cmfive_test
DB_DATABASE: cmfive_test
PLAYWRIGHT_MODULES: "admin channel form tag report task timelog"
BOILERPLATE_IMAGE: ghcr.io/2pisoftware/cmfive:develop
BOILERPLATE_IMAGE: ghcr.io/2pisoftware/cmfive:pr-119 # TODO: change back to develop
mattbell87 marked this conversation as resolved.
Show resolved Hide resolved

jobs:
# Lint
Expand Down Expand Up @@ -58,7 +58,7 @@ jobs:
uses: actions/checkout@v4
with:
repository: '2pisoftware/cmfive-boilerplate'
ref: 'develop'
ref: 'feat/phpunit-10' # TODO: change back to develop
mattbell87 marked this conversation as resolved.
Show resolved Hide resolved
path: boilerplate

# Pre-requisites Prepare Cmfive Environment
Expand Down Expand Up @@ -165,28 +165,16 @@ jobs:
# Write extra config to cmfive container
docker exec -t cmfive sh -c "echo \"$CONFIG\" >> /var/www/html/config.php"

- name: Prepare cmfive Test Backend
- name: Install dev tools
env:
CONTAINER: cmfive
run: |
# Install packages required for the tests
docker exec -u root -t cmfive sh -c \
"apk add --no-cache php81-dom php81-xmlwriter php81-tokenizer php81-ctype mysql-client mariadb-connector-c-dev";

# Install phpunit 8
docker exec -u root cmfive sh -c \
"cd /usr/local/bin && curl -L https://phar.phpunit.de/phpunit-8.phar -o phpunit && chmod +x phpunit && chmod 777 .";

# Change owner of the test directory
docker exec -u root -t cmfive sh -c \
"chown -R cmfive:cmfive /var/www/html/test";

# Install Codeception
docker exec -u cmfive cmfive sh -c \
"cd /var/www/html/test/ && sh ./.install/install.sh"
if [ -f ./boilerplate/.codepipeline/docker/install_dev_tools.sh ]; then
./boilerplate/.codepipeline/docker/install_dev_tools.sh
else
echo "⚠️ WARNING: could not find dev tools in boilerplate"
fi

- name: Prepare cmfive Test DB
run: |
docker exec -t cmfive sh -c "DB_HOST=mysql-8 DB_USERNAME=root DB_PASSWORD=root DB_DATABASE=cmfive_test DB_PORT=3306 php cmfive.php testDB setup; exit \$?";

# Build new layout
- uses: actions/setup-node@v4
with:
Expand All @@ -207,10 +195,6 @@ jobs:
cd boilerplate/test/playwright
npm ci
npx playwright install --with-deps
# Run Acceptance Tests
- name: "Confirm Codeception setup"
run: |
docker exec cmfive sh -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
Loading