Skip to content

Update main.yml

Update main.yml #131

Workflow file for this run

name: m2-actions-test
on: [push]
jobs:
magento2-build:
runs-on: ubuntu-latest
name: 'm2 tests & build'
services:
mysql:
image: docker://mysql:8.0
env:
MYSQL_ROOT_PASSWORD: magento
MYSQL_DATABASE: magento
ports:
- 3306:3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
opensearch:
image: opensearchproject/opensearch:1.2.1
ports:
- 9200:9200
options: -e="discovery.type=single-node" -e "plugins.security.disabled=true" -e "plugins.security.ssl.http.enabled=false" --health-cmd="curl http://localhost:9200/_cluster/health" --health-interval=10s --health-timeout=5s --health-retries=10
steps:
- uses: actions/checkout@v4
- name: 'install fresh magento repo'
if: ${{false}}
uses: MAD-I-T/magento-actions@v3.28
env:
COMPOSER_AUTH: ${{secrets.COMPOSER_AUTH}}
with:
process: 'create-project'
magento_version: 2.4.7
#no_push: 1 ## add this arg to not push to the repo ideal for quick test on specific version
- name: 'install fresh pwa-studio project'
#if: (!cancelled())
if: ${{false}}
uses: MAD-I-T/magento-actions@v3.28
with:
process: 'pwa-studio-install'
no_push: 1
- name: 'launch magento2 unit test'
if: (!cancelled())
uses: MAD-I-T/magento-actions@v3.28
env:
COMPOSER_AUTH: ${{secrets.COMPOSER_AUTH}}
with:
process: 'unit-test'
- name: 'launch magento2 unit test filtered by testsuite'
if: (!cancelled())
uses: MAD-I-T/magento-actions@v3.28
env:
COMPOSER_AUTH: ${{secrets.COMPOSER_AUTH}}
with:
process: 'unit-test'
testsuite: 'Magento_Unit_Tests_Other'
- name: 'launch magento2 unit test specific module i.e module-email'
if: (!cancelled())
uses: MAD-I-T/magento-actions@v3.28
env:
COMPOSER_AUTH: ${{secrets.COMPOSER_AUTH}}
with:
process: 'unit-test'
unit_test_subset_path: 'vendor/magento/module-email/Test/Unit'
#php: 8.1
#composer_version: 2
#opensearch: 1
- name: 'launch magento2 static test'
if: (!cancelled())
uses: MAD-I-T/magento-actions@master
env:
COMPOSER_AUTH: ${{secrets.COMPOSER_AUTH}}
with:
process: 'static-test'
- name: 'magento coding standard checker'
if: (!cancelled())
uses: MAD-I-T/magento-actions@v3.28
env:
COMPOSER_AUTH: ${{secrets.COMPOSER_AUTH}}
with:
process: 'phpcs-test'
extension: 'magento/vendor/magento/module-email' # can be a custom value module in app/code/ dir e.g: Madit/Atos
severity: 10
standard: 'Magento2'
- name: 'launch magento2 build'
if: (!cancelled())
id: build
uses: MAD-I-T/magento-actions@v3.28
env:
COMPOSER_AUTH: ${{secrets.COMPOSER_AUTH}}
with:
process: 'build'
- name: 'launch security scanner files'
if: (!cancelled())
uses: MAD-I-T/magento-actions@v3.28
env:
COMPOSER_AUTH: ${{secrets.COMPOSER_AUTH}}
with:
process: 'security-scan-files'
- name: 'launch security scanner modules'
if: steps.build.outcome == 'success'
uses: MAD-I-T/magento-actions@v3.28
env:
COMPOSER_AUTH: ${{secrets.COMPOSER_AUTH}}
with:
process: 'security-scan-modules'
- name: 'mess detector'
if: (!cancelled())
uses: MAD-I-T/magento-actions@v3.28
with:
process: 'mess-detector'
md_src_path: 'vendor/magento/module-email'
- name: 'phpstan'
if: (!cancelled())
uses: MAD-I-T/magento-actions@v3.28
with:
process: 'phpstan'
exec_path: 'vendor/magento/module-email'
#### section to be activated, for zero downtime deployment on preprod and/or prod remove ${{false}}
- name: 'launch magento2 zero downtime deploy with no permission check'
if: ${{false}} # if: steps.build.outcome == 'success'
uses: MAD-I-T/magento-actions@v3.28
env:
COMPOSER_AUTH: ${{secrets.COMPOSER_AUTH}}
BUCKET_COMMIT: bucket-commit-${{github.sha}}.tar.gz
MYSQL_ROOT_PASSWORD: magento
MYSQL_DATABASE: magento
HOST_DEPLOY_PATH: ${{secrets.STAGE_HOST_DEPLOY_PATH}}
HOST_DEPLOY_PATH_BUCKET: ${{secrets.STAGE_HOST_DEPLOY_PATH}}/bucket
SSH_PRIVATE_KEY: ${{secrets.STAGE_SSH_PRIVATE_KEY}}
SSH_CONFIG: ${{secrets.STAGE_SSH_CONFIG}}
WRITE_USE_SUDO: false
with:
deployer: 'no-permission-check'
process: 'deploy-staging'
- name: 'unlock deployer if fails'
if: ${{false}} # if: failure() || cancelled()
uses: MAD-I-T/magento-actions@v3.28
env:
COMPOSER_AUTH: ${{secrets.COMPOSER_AUTH}}
BUCKET_COMMIT: bucket-commit-${{github.sha}}.tar.gz
MYSQL_ROOT_PASSWORD: magento
MYSQL_DATABASE: magento
HOST_DEPLOY_PATH: ${{secrets.STAGE_HOST_DEPLOY_PATH}}
HOST_DEPLOY_PATH_BUCKET: ${{secrets.STAGE_HOST_DEPLOY_PATH}}/bucket
SSH_PRIVATE_KEY: ${{secrets.STAGE_SSH_PRIVATE_KEY}}
SSH_CONFIG: ${{secrets.STAGE_SSH_CONFIG}}
WRITE_USE_SUDO: false
with:
process: 'cleanup-staging'
- name: 'start zero downtime deploy on production'
if: ${{false}} # if: steps.build.outcome == 'success'
uses: MAD-I-T/magento-actions@v3.28
env:
COMPOSER_AUTH: ${{secrets.COMPOSER_AUTH}}
BUCKET_COMMIT: bucket-commit-${{github.sha}}.tar.gz
MYSQL_ROOT_PASSWORD: magento
MYSQL_DATABASE: magento
HOST_DEPLOY_PATH: ${{secrets.PROD_HOST_DEPLOY_PATH}}
HOST_DEPLOY_PATH_BUCKET: ${{secrets.PROD_HOST_DEPLOY_PATH}}/bucket
SSH_PRIVATE_KEY: ${{secrets.PROD_SSH_PRIVATE_KEY}}
SSH_CONFIG: ${{secrets.PROD_SSH_CONFIG}}
WRITE_USE_SUDO: false
with:
process: 'deploy-prod'
deployer: 'no-permission-check'
- name: 'unlock php deployer if the deployment fails on production'
if: ${{false}} #if: failure() || cancelled()
uses: MAD-I-T/magento-actions@v3.28
env:
COMPOSER_AUTH: ${{secrets.COMPOSER_AUTH}}
BUCKET_COMMIT: bucket-commit-${{github.sha}}.tar.gz
MYSQL_ROOT_PASSWORD: magento
MYSQL_DATABASE: magento
HOST_DEPLOY_PATH: ${{secrets.PROD_HOST_DEPLOY_PATH}}
HOST_DEPLOY_PATH_BUCKET: ${{secrets.PROD_HOST_DEPLOY_PATH}}/bucket
SSH_PRIVATE_KEY: ${{secrets.PROD_SSH_PRIVATE_KEY}}
SSH_CONFIG: ${{secrets.PROD_SSH_CONFIG}}
WRITE_USE_SUDO: false
with:
process: 'cleanup-prod'
magento2-integration-test:
runs-on: ubuntu-latest
name: 'm2 integration test'
services:
mysql:
image: docker://mysql:8.0
env:
MYSQL_ROOT_PASSWORD: magento
MYSQL_DATABASE: magento
ports:
- 3106:3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
#elasticsearch:
# image: docker://elasticsearch:7.17.0
# ports:
# - 9200:9200
# options: -e="discovery.type=single-node" --health-cmd="curl http://localhost:9200/_cluster/health" --health-interval=10s --health-timeout=5s --health-retries=10
rabbitmq:
image: docker://rabbitmq:3.9-alpine
env:
RABBITMQ_DEFAULT_USER: "magento"
RABBITMQ_DEFAULT_PASS: "magento"
RABBITMQ_DEFAULT_VHOST: "/"
ports:
- 5672:5672
opensearch:
image: ghcr.io/mad-i-t/magento-opensearch:2.5.0
ports:
- 9200:9200
options: -e="discovery.type=single-node" -e "plugins.security.disabled=true" --health-cmd="curl http://localhost:9200/_cluster/health" --health-interval=10s --health-timeout=5s --health-retries=10
steps:
- uses: actions/checkout@v4
- name: 'install fresh magento repo'
#if: (!cancelled())
if: ${{false}}
uses: MAD-I-T/magento-actions@v3.28
env:
COMPOSER_AUTH: ${{secrets.COMPOSER_AUTH}}
with:
process: 'create-project'
magento_version: 2.4.7
no_push: 1
- name: 'launch magento2 integration test custom testsuite'
if: (!cancelled())
uses: MAD-I-T/magento-actions@v3.28
env:
COMPOSER_AUTH: ${{secrets.COMPOSER_AUTH}}
with:
process: 'integration-test'
testsuite: "Memory Usage Tests"
- name: 'integration test class'
if: (!cancelled())
uses: MAD-I-T/magento-actions@v3.28
env:
COMPOSER_AUTH: ${{secrets.COMPOSER_AUTH}}
with:
process: 'integration-test'
integration_class: "./testsuite/Magento/MemoryUsageTest.php"
- name: 'integration test class filter'
if: (!cancelled())
uses: MAD-I-T/magento-actions@v3.28
env:
COMPOSER_AUTH: ${{secrets.COMPOSER_AUTH}}
with:
process: 'integration-test'
integration_class: "./testsuite/Magento/MemoryUsageTest.php"
integration_filter: "testAppReinitializationNoMemoryLeak"