Skip to content

Commit 32689de

Browse files
committed
ci(git): Copy generic CI/CD files
1 parent 69d3335 commit 32689de

2 files changed

Lines changed: 28 additions & 24 deletions

File tree

.github/workflows/magento-install.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ php -dmemory_limit=-1 bin/magento setup:install \
6363
cd /tmp/magento/pub/
6464
nohup php -S 0.0.0.0:8888 >/tmp/php-server.log 2>&1 &
6565

66-
echo "Waiting for Magento front to become reachable"
66+
echo "Waiting for Magento front to become reachable on ${MAGENTO_BASE_URL}"
6767
result=0
6868
for i in {1..60}; do
6969
if curl -s "${MAGENTO_BASE_URL}" 2>1 >/dev/null; then
@@ -73,3 +73,4 @@ for i in {1..60}; do
7373
sleep 1
7474
done
7575
test $result -eq 0 && echo "Not available" && cat /tmp/php-server.log && exit 1
76+
exit 0

.github/workflows/playwright.yml

Lines changed: 26 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
playwright:
1010
runs-on: ubuntu-latest
1111
container:
12-
image: yireo/magento2installed:2.4.8-p3
12+
image: yireo/magento2playwright:2.4.8-p3
1313
env:
1414
GIT_DEPTH: 1
1515
GIT_STRATEGY: fetch
@@ -49,21 +49,15 @@ jobs:
4949
MYSQL_USER: magento2
5050
MYSQL_PASSWORD: magento2
5151
MYSQL_ROOT_PASSWORD: root
52-
ports:
53-
- 3306:3306
5452

5553
redis:
5654
image: redis:latest
57-
ports:
58-
- 6379:6379
5955

6056
opensearch:
6157
image: yireo/opensearch
6258
env:
6359
OPENSEARCH_JAVA_OPTS: "-Xms128m -Xmx128m"
6460
OPENSEARCH_INITIAL_ADMIN_PASSWORD: "admin"
65-
ports:
66-
- 9200:9200
6761

6862
steps:
6963
- name: Checkout repository
@@ -73,14 +67,16 @@ jobs:
7367

7468
- name: Detecting Playwright tests
7569
run: |
76-
test -d $GITHUB_WORKSPACE/Test/Playwright || exit 0
70+
test -d $GITHUB_WORKSPACE/Test/Playwright || echo "SKIP_JOB=true" >> $GITHUB_ENV
7771
7872
- name: Setting up module variables
73+
if: env.SKIP_JOB != 'true'
7974
run: |
8075
echo COMPOSER_NAME=`jq '.name' composer.json -r` >> $GITHUB_ENV
8176
echo MAGENTO_MODULE=`jq '.module_name' MODULE.json -r` >> $GITHUB_ENV
8277
8378
- name: Configure Yireo GitLab
79+
if: env.SKIP_JOB != 'true'
8480
run: |
8581
test -n "${{ secrets.GITLAB_TOKEN }}" || exit 0
8682
cd /tmp/magento
@@ -89,8 +85,8 @@ jobs:
8985
composer config repositories.loki-third-party composer https://gitlab.yireo.com/api/v4/group/loki-third-party/-/packages/composer/packages.json
9086
composer config repositories.loki-checkout composer https://gitlab.yireo.com/api/v4/group/loki-checkout/-/packages/composer/packages.json
9187
92-
- name: Run Magento Playwright setup and tests
93-
shell: bash
88+
- name: Prepare Magento Playwright setup
89+
if: env.SKIP_JOB != 'true'
9490
run: |
9591
cd "$GITHUB_WORKSPACE"
9692
cd /tmp/magento
@@ -99,24 +95,31 @@ jobs:
9995
test -f "$GITHUB_WORKSPACE/.github/workflows/composer-${MAGENTO_VERSION}.sh" && source "$GITHUB_WORKSPACE/.github/workflows/composer-${MAGENTO_VERSION}.sh"
10096
10197
composer config repositories.local-source path "$GITHUB_WORKSPACE"
102-
composer require --prefer-source -- "${COMPOSER_NAME}:@dev" loki-checkout/magento2-functional-tests:@dev yireo/magento2-enable-module-sequence
98+
composer require --prefer-source -- "${COMPOSER_NAME}:@dev" loki-checkout/magento2-core-cli:@dev loki-checkout/magento2-functional-tests:@dev yireo/magento2-enable-module-sequence
10399
104-
source "$GITHUB_WORKSPACE/.github/workflows/magento-install.sh"
100+
$GITHUB_WORKSPACE/.github/workflows/magento-install.sh
105101
106102
bin/magento module:enable Yireo_EnableModuleSequence
107-
bin/magento module:sequence LokiCheckout_FunctionalTests
103+
bin/magento module:sequence LokiCheckout_FunctionalTests
104+
bin/magento module:sequence LokiCheckout_CoreCli
108105
bin/magento module:sequence "${MAGENTO_MODULE}"
109106
bin/magento setup:upgrade
107+
bin/magento loki-checkout:modules:dump
110108
111109
magerun2 config:store:set loki_functional_tests/general/token loki -n
110+
cp -R /tmp/magento $GITHUB_WORKSPACE/magento
112111
113-
cd vendor/loki-checkout/magento2-functional-tests/Test/Playwright/
114-
115-
npm install
116-
npx playwright install
117-
118-
touch .env
119-
echo "TEST_URL=${MAGENTO_BASE_URL}" >> .env
120-
echo "TEST_TOKEN=loki" >> .env
121-
122-
npx playwright test --project="${MAGENTO_MODULE}"
112+
- name: Prepare Magento Playwright setup
113+
if: env.SKIP_JOB != 'true'
114+
uses: docker://mcr.microsoft.com/playwright:v1.57.0-noble
115+
with:
116+
args: >
117+
bash -lc "
118+
cd $GITHUB_WORKSPACE/magento/vendor/loki-checkout/magento2-functional-tests/Test/Playwright/
119+
npm install
120+
npx playwright install
121+
touch .env
122+
echo TEST_URL=$MAGENTO_BASE_URL >> .env
123+
echo TEST_TOKEN=loki >> .env
124+
npx playwright test --project=$MAGENTO_MODULE
125+
"

0 commit comments

Comments
 (0)