├── .eslintrc.cjs ├── .github ├── ISSUE_TEMPLATE │ ├── bug_report.md │ ├── documentation.md │ ├── feature_request.md │ ├── other.md │ └── performance_issue.md ├── PULL_REQUEST_TEMPLATE.md ├── dependabot.yml └── workflows │ ├── _internal-coding-standard.yaml │ ├── _internal-get-composer-version.yaml │ ├── _internal-get-magento-version.yaml │ ├── _internal-install.yaml │ ├── _internal-integration.yaml │ ├── _internal-semver-compare.yaml │ ├── _internal-setup-magento.yaml │ ├── _internal-unit.yaml │ ├── _internal_test_actions.yaml │ ├── full-integration-tests.yaml │ ├── integration-README.md │ ├── integration.yaml │ ├── nx-integration-tests.yml │ ├── release-please.yml │ └── sansec-ecomscan.yml ├── .gitignore ├── .nvmrc ├── .release-please-manifest.json ├── .vscode └── extensions.json ├── CHANGELOG.md ├── CODEOWNERS ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── README.md ├── _test └── demo-package │ ├── .gitignore │ ├── README.md │ ├── Test │ ├── Integration │ │ └── ItWorksTest.php │ └── Unit │ │ └── ItWorksTest.php │ ├── composer.json │ ├── composer.lock │ ├── etc │ └── module.xml │ ├── phpunit.xml │ └── registration.php ├── cache-magento ├── README.md └── action.yml ├── coding-standard-baseline ├── README.md └── action.yml ├── coding-standard ├── README.md └── action.yml ├── fix-magento-install ├── README.md └── action.yml ├── get-composer-version ├── README.md └── action.yml ├── get-magento-version ├── README.md └── action.yml ├── installation-test ├── README.md └── action.yml ├── nx-integration-tests-setup └── action.yml ├── package-lock.json ├── package.json ├── release-please-config.json ├── semver-compare ├── README.md └── action.yml ├── setup-di-compile ├── README.md └── action.yml ├── setup-magento ├── README.md └── action.yml ├── supported-services-matrix-calculator └── action.yml ├── supported-version ├── README.md ├── action.yml ├── dist │ └── index.js ├── jest.config.js ├── package-lock.json ├── package.json ├── src │ ├── index.ts │ ├── kind │ │ ├── get-currently-supported.spec.ts │ │ ├── get-currently-supported.ts │ │ ├── kinds.ts │ │ ├── special-versions │ │ │ ├── latest.json │ │ │ └── nightly.json │ │ ├── validate-kinds.spec.ts │ │ ├── validate-kinds.ts │ │ ├── validations │ │ │ ├── custom-versions-validator.ts │ │ │ └── is-known-kind.ts │ │ └── validator.ts │ ├── matrix │ │ ├── get-matrix-for-kind.spec.ts │ │ ├── get-matrix-for-kind.ts │ │ ├── get-matrix-for-versions.ts │ │ └── matrix-type.ts │ ├── nightly │ │ ├── amend-matrix-for-next.spec.ts │ │ ├── amend-matrix-for-next.ts │ │ ├── get-day-before.ts │ │ ├── get-next-version.spec.ts │ │ ├── get-next-version.ts │ │ ├── repository.ts │ │ ├── unify-next-package-name.spec.ts │ │ └── unify-next-package-name.ts │ ├── project │ │ ├── projects.ts │ │ ├── validate-projects.spec.ts │ │ ├── validate-projects.ts │ │ ├── validations │ │ │ ├── is-known-project.spec.ts │ │ │ └── is-known-project.ts │ │ └── validator.ts │ └── versions │ │ ├── get-versions-for-project.spec.ts │ │ ├── get-versions-for-project.ts │ │ ├── mage-os │ │ ├── composite.json │ │ └── individual.json │ │ └── magento-open-source │ │ ├── composite.json │ │ └── individual.json └── tsconfig.json ├── unit-test ├── README.md └── action.yml └── warden ├── integration-tests └── action.yml └── setup-environment └── action.yml /.eslintrc.cjs: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended'], 3 | parser: '@typescript-eslint/parser', 4 | plugins: ['@typescript-eslint'], 5 | root: true, 6 | }; -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report or Regression 3 | about: Create a report to help us fix an issue or regression 4 | title: '[BUG]' 5 | labels: 'bug' 6 | assignees: 'damienwebdev' 7 | --- 8 | 9 | 14 | 15 | # :bug: Bug report 16 | 17 | ## Current Behavior 18 | 19 | 20 | 21 | ## Expected Behavior 22 | 23 | 24 | 25 | ## Minimal reproduction of the problem with instructions 26 | 27 | 28 | 29 | ## What is the motivation / use case for changing the behavior? 30 | 31 | 32 | 33 | ## Environment 34 | 35 |
36 | Magento version: X.Y.Z
37 | PHP Version version: X.Y.Z
38 |
39 |
40 | Others:
41 |
42 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/documentation.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Documentation Request
3 | about: Request additional documentation or clarification on a feature.
4 | title: '[DOCS]'
5 | labels: 'docs'
6 | assignees: 'damienwebdev'
7 | ---
8 |
9 |
14 |
15 | # :page_facing_up: Documentation Request
16 |
17 | ## What were you doing?
18 |
19 |
20 |
21 | ## Expected behavior
22 |
23 |
24 |
25 | ## Existing Documentation
26 |
27 |
28 | ## Environment
29 |
30 |
31 | Magento version: X.Y.Z
32 | PHP Version version: X.Y.Z
33 |
34 |
35 | Others:
36 |
37 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/feature_request.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Feature Request
3 | about: Ask for a new feature, or something that you'd like to see changed.
4 | title: '[FEAT]'
5 | labels: 'feat'
6 | assignees: 'damienwebdev'
7 | ---
8 |
9 |
14 |
15 | # :bulb: Feature request
16 |
17 | ## Feature Name
18 |
19 |
20 |
21 | ## The Desired Behavior
22 |
23 |
24 |
25 | ## Your Use Case
26 |
27 |
28 |
29 | ## Prior Work
30 |
31 |
32 |
33 | ## Environment
34 |
35 |
36 | Magento version: X.Y.Z
37 | PHP Version version: X.Y.Z
38 |
39 |
40 | Others:
41 |
42 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/other.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Other
3 | about: Report a general issue that isn't covered by other issue templates.
4 | title: '[OTHER]'
5 | labels: ''
6 | assignees: ''
7 | ---
8 |
9 |
14 |
15 | # :question: Other
16 |
17 |
18 |
19 | ## Environment
20 |
21 |
22 | Magento version: X.Y.Z
23 | PHP Version version: X.Y.Z
24 |
25 |
26 | Others:
27 |
28 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/performance_issue.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Performance Issue
3 | about: Create a report about a performance problem.
4 | title: '[PERF]'
5 | labels: 'perf'
6 | assignees: 'damienwebdev'
7 | ---
8 |
9 |
14 |
15 | # :turtle: Performance Issue
16 |
17 | ## Current behavior
18 |
19 |
20 |
21 | ## Expected behavior
22 |
23 |
24 |
25 | ## Minimal reproduction of the problem with instructions
26 |
27 |
28 |
29 | ## What is the motivation / use case for changing the behavior?
30 |
31 |
32 |
33 | ## Environment
34 |
35 |
36 | Magento version: X.Y.Z
37 | PHP Version version: X.Y.Z
38 |
39 |
40 | Others:
41 |
42 |
--------------------------------------------------------------------------------
/.github/PULL_REQUEST_TEMPLATE.md:
--------------------------------------------------------------------------------
1 | ## PR Checklist
2 | Please check if your PR fulfills the following requirements:
3 |
4 | - [ ] The commit message follows our guidelines: https://github.com/mage-os/github-actions/blob/main/CONTRIBUTING.md#commit
5 | - [ ] Tests for the changes have been added (for bug fixes / features)
6 | - [ ] Docs have been added / updated (for bug fixes / features)
7 |
8 |
9 | ## PR Type
10 | What kind of change does this PR introduce?
11 |
12 |
13 | - [ ] Bugfix
14 | - [ ] Feature
15 | - [ ] Code style update (formatting, local variables)
16 | - [ ] Refactoring (no functional changes, no api changes)
17 | - [ ] Build related changes
18 | - [ ] CI related changes
19 | - [ ] Documentation content changes
20 | - [ ] Other... Please describe:
21 |
22 | ## What is the current behavior?
23 |
24 |
25 | Fixes: N/A
26 |
27 |
28 | ## What is the new behavior?
29 |
30 |
31 | ## Does this PR introduce a breaking change?
32 | - [ ] Yes
33 | - [ ] No
34 |
35 |
36 |
37 |
38 | ## Other information
39 |
--------------------------------------------------------------------------------
/.github/dependabot.yml:
--------------------------------------------------------------------------------
1 | version: 2
2 | updates:
3 | # Maintain dependencies for GitHub Actions
4 | - package-ecosystem: "github-actions"
5 | directory: "/"
6 | schedule:
7 | interval: "weekly"
8 | - package-ecosystem: "npm"
9 | directory: "/"
10 | schedule:
11 | interval: "weekly"
--------------------------------------------------------------------------------
/.github/workflows/_internal-coding-standard.yaml:
--------------------------------------------------------------------------------
1 | name: Coding Standard
2 |
3 | on:
4 | push:
5 | branches:
6 | - main
7 | paths:
8 | - "_test/demo-package/**"
9 | - ".github/workflows/_internal-coding-standard.yaml"
10 | - "coding-standard/**"
11 | - "!(**/*.md)"
12 | pull_request:
13 | branches:
14 | - main
15 | paths:
16 | - "_test/demo-package/**"
17 | - ".github/workflows/_internal-coding-standard.yaml"
18 | - "coding-standard/**"
19 | - "!(**/*.md)"
20 | workflow_dispatch:
21 | inputs:
22 | version:
23 | type: string
24 | default: '*'
25 | description: The version of the coding standard to use.
26 | required: false
27 | path:
28 | type: string
29 | default: '_test/demo-package'
30 | description: Path to run the coding standard on.
31 | required: true
32 |
33 | jobs:
34 | compute_matrix:
35 | runs-on: ubuntu-latest
36 | outputs:
37 | matrix: ${{ steps.supported-version.outputs.matrix }}
38 | steps:
39 | - uses: actions/checkout@v4
40 | - uses: ./supported-version
41 | with:
42 | kind: all
43 | id: supported-version
44 | - run: echo ${{ steps.supported-version.outputs.matrix }}
45 |
46 | coding-standard:
47 | needs: compute_matrix
48 | strategy:
49 | matrix: ${{ fromJSON(needs.compute_matrix.outputs.matrix) }}
50 | fail-fast: false
51 | runs-on: ubuntu-latest
52 | steps:
53 | - uses: actions/checkout@v4
54 | - uses: './coding-standard'
55 | with:
56 | version: ${{ github.event.inputs.version || '*' }}
57 | path: ${{ github.event.inputs.path || '_test/demo-package' }}
58 | composer_version: ${{ matrix.composer }}
59 | php_version: ${{ matrix.php }}
--------------------------------------------------------------------------------
/.github/workflows/_internal-get-composer-version.yaml:
--------------------------------------------------------------------------------
1 | name: Get Composer Version
2 |
3 | on:
4 | push:
5 | branches:
6 | - main
7 | - testing
8 | paths:
9 | - ".github/workflows/_internal-get-composer-version.yaml"
10 | - "get-composer-version/**"
11 | - "!(**/*.md)"
12 | pull_request:
13 | branches:
14 | - main
15 | paths:
16 | - ".github/workflows/_internal-get-composer-version.yaml"
17 | - "get-composer-version/**"
18 | - "!(**/*.md)"
19 |
20 | jobs:
21 | get-composer-version:
22 | runs-on: ubuntu-latest
23 | steps:
24 | - uses: actions/checkout@v4
25 | - name: Set PHP Version
26 | uses: shivammathur/setup-php@v2
27 | with:
28 | php-version: 8.3
29 | tools: composer:v2.8.4
30 |
31 | - uses: ./get-composer-version
32 | id: composer-version
33 |
34 |
35 | - name: Fail if versions do not match
36 | if: steps.composer-version.outputs.version != '2.8.4'
37 | shell: bash
38 | run: echo "${{ steps.composer-version.outputs.version }}" && exit 1
39 |
--------------------------------------------------------------------------------
/.github/workflows/_internal-get-magento-version.yaml:
--------------------------------------------------------------------------------
1 | name: Get Magento Version
2 |
3 | on:
4 | push:
5 | branches:
6 | - main
7 | paths:
8 | - ".github/workflows/_internal-get-magento-version.yaml"
9 | - "get-magento-version/**"
10 | - "!(**/*.md)"
11 | pull_request:
12 | branches:
13 | - main
14 | paths:
15 | - ".github/workflows/_internal-get-magento-version.yaml"
16 | - "get-magento-version/**"
17 | - "!(**/*.md)"
18 |
19 | jobs:
20 | get-magento-version:
21 | runs-on: ubuntu-latest
22 | steps:
23 | - uses: actions/checkout@v4
24 | - name: Set PHP Version
25 | uses: shivammathur/setup-php@v2
26 | with:
27 | php-version: 8.3
28 | tools: composer:v2.8.4
29 |
30 | - run: composer create-project --repository-url="https://mirror.mage-os.org" "magento/project-community-edition:2.4.7-p4" ../magento2 --no-install
31 | shell: bash
32 | name: Create Magento ${{ matrix.magento }} Project
33 |
34 | - uses: ./get-magento-version
35 | id: magento-version
36 | with:
37 | working-directory: ../magento2
38 |
39 | - name: Fail if key does not match
40 | if: steps.magento-version.outputs.version != '"2.4.7-p4"'
41 | shell: bash
42 | run: echo "${{ steps.magento-version.outputs.version }}" && exit 1
43 |
--------------------------------------------------------------------------------
/.github/workflows/_internal-install.yaml:
--------------------------------------------------------------------------------
1 | name: Installation Test
2 |
3 | on:
4 | workflow_dispatch: {}
5 | push:
6 | branches:
7 | - main
8 | paths:
9 | - "_test/demo-package/**"
10 | - "installation-test/**"
11 | - ".github/workflows/_internal-install.yaml"
12 | - "supported-version/**"
13 | - "!(**/*.md)"
14 | pull_request:
15 | branches:
16 | - main
17 | paths:
18 | - "_test/demo-package/**"
19 | - "installation-test/**"
20 | - ".github/workflows/_internal-install.yaml"
21 | - "supported-version/**"
22 | - "!(**/*.md)"
23 |
24 | jobs:
25 | compute_matrix:
26 | runs-on: ubuntu-latest
27 | outputs:
28 | matrix: ${{ steps.supported-version.outputs.matrix }}
29 | steps:
30 | - uses: actions/checkout@v4
31 | - uses: ./supported-version
32 | with:
33 | kind: all
34 | id: supported-version
35 | - run: echo ${{ steps.supported-version.outputs.matrix }}
36 |
37 | install-test:
38 | needs: compute_matrix
39 | strategy:
40 | matrix: ${{ fromJSON(needs.compute_matrix.outputs.matrix) }}
41 | fail-fast: false
42 | runs-on: ubuntu-latest
43 | steps:
44 | - uses: actions/checkout@v4
45 | - uses: ./installation-test
46 | with:
47 | composer_version: ${{ matrix.composer }}
48 | php_version: ${{ matrix.php }}
49 | magento_version: ${{ matrix.magento }}
50 | package_name: mage-os/magento2-demo-package
51 | source_folder: $GITHUB_WORKSPACE/_test/demo-package
52 |
--------------------------------------------------------------------------------
/.github/workflows/_internal-integration.yaml:
--------------------------------------------------------------------------------
1 | name: Integration Test
2 |
3 | on:
4 | workflow_dispatch: {}
5 | push:
6 | branches:
7 | - main
8 | paths:
9 | - "_test/demo-package/**"
10 | - ".github/workflows/_internal-integration.yaml"
11 | - ".github/workflows/integration.yaml"
12 | - "supported-version/**"
13 | - "!(**/*.md)"
14 | pull_request:
15 | branches:
16 | - main
17 | paths:
18 | - "_test/demo-package/**"
19 | - ".github/workflows/_internal-integration.yaml"
20 | - ".github/workflows/integration.yaml"
21 | - "supported-version/**"
22 | - "!(**/*.md)"
23 |
24 | jobs:
25 | compute_matrix:
26 | runs-on: ubuntu-latest
27 | outputs:
28 | matrix: ${{ steps.supported-version.outputs.matrix }}
29 | steps:
30 | - uses: actions/checkout@v4
31 | - uses: ./supported-version
32 | with:
33 | kind: all
34 | id: supported-version
35 | - run: echo ${{ steps.supported-version.outputs.matrix }}
36 | integration-workflow:
37 | needs: compute_matrix
38 | uses: ./.github/workflows/integration.yaml
39 | with:
40 | package_name: mage-os/magento2-demo-package
41 | source_folder: $GITHUB_WORKSPACE/_test/demo-package
42 | matrix: ${{ needs.compute_matrix.outputs.matrix }}
43 | test_command: ../../../vendor/bin/phpunit ../../../vendor/mage-os/magento2-demo-package/Test/Integration
44 | fail-fast: false
45 |
--------------------------------------------------------------------------------
/.github/workflows/_internal-semver-compare.yaml:
--------------------------------------------------------------------------------
1 | name: Test semvar-compare action
2 |
3 | on:
4 | push:
5 | branches:
6 | - main
7 | paths:
8 | - ".github/workflows/_internal-semver-compare.yaml"
9 | - "semver-compare/**"
10 | - "!(**/*.md)"
11 | pull_request:
12 | branches:
13 | - main
14 | paths:
15 | - ".github/workflows/_internal-semver-compare.yaml"
16 | - "semver-compare/**"
17 | - "!(**/*.md)"
18 |
19 | jobs:
20 | semver-compare:
21 | runs-on: ubuntu-latest
22 | steps:
23 | - uses: actions/checkout@v4
24 |
25 | - uses: ./semver-compare
26 | id: version-compare-1
27 | with:
28 | version: 2.2.3
29 | compare_against: 2.3
30 |
31 | - uses: ./semver-compare
32 | id: version-compare-2
33 | with:
34 | version: 2
35 | compare_against: 2.0.1
36 |
37 | - uses: ./semver-compare
38 | id: version-compare-3
39 | with:
40 | version: 2.2.1
41 | compare_against: 2.2
42 |
43 |
44 | - uses: ./semver-compare
45 | id: version-compare-4
46 | with:
47 | version: 2.2.0
48 | compare_against: 2.2.0
49 |
50 | - name: Fail if 2.3 is not higher than 2.2.3
51 | if: steps.version-compare-1.outputs.result != -1
52 | shell: bash
53 | run: echo "FAIL because 2.3 must be higher than 2.2.3 Compare 2.2.3 to 2.3 renders ${{ steps.version-compare-1.outputs.result }}" && exit 1
54 |
55 |
56 | - name: Fail if 2.0.1 is not higher than 2
57 | if: steps.version-compare-2.outputs.result != -1
58 | shell: bash
59 | run: echo "FAIL because 2.0.1 must be higher than 2 Compare 2 to 2.0.1 renders ${{ steps.version-compare-2.outputs.result }}" && exit 1
60 |
61 | - name: Fail if 2.2.1 is not higher than 2.2
62 | if: steps.version-compare-3.outputs.result != 1
63 | shell: bash
64 | run: echo "FAIL because 2.2.1 must be higher than 2.2 Compare 2.2.1 to 2.2 renders ${{ steps.version-compare-3.outputs.result }}" && exit 1
65 |
66 | - name: Fail if 2.2.0 is not equals to 2.2.0
67 | if: steps.version-compare-4.outputs.result != 0
68 | shell: bash
69 | run: echo "FAIL because 2.2.0 must be equal to 2.2.0 Compare 2.2.0 to 2.2.0 renders ${{ steps.version-compare-4.outputs.result }}" && exit 1
70 |
--------------------------------------------------------------------------------
/.github/workflows/_internal-setup-magento.yaml:
--------------------------------------------------------------------------------
1 | name: Setup Magento Test
2 |
3 | on:
4 | workflow_dispatch: {}
5 | push:
6 | branches:
7 | - main
8 | paths:
9 | - "setup-magento/**"
10 | - ".github/workflows/_internal-setup-magento.yaml"
11 | - "supported-version/**"
12 | - "!(**/*.md)"
13 | pull_request:
14 | branches:
15 | - main
16 | paths:
17 | - "setup-magento/**"
18 | - ".github/workflows/_internal-setup-magento.yaml"
19 | - "supported-version/**"
20 | - "!(**/*.md)"
21 |
22 | env:
23 | PSEUDO_REPO_FOLDER: ../magento_repo
24 | magento_folder: ../magento2
25 |
26 | jobs:
27 | compute_matrix:
28 | runs-on: ubuntu-latest
29 | outputs:
30 | matrix: ${{ steps.supported-version.outputs.matrix }}
31 | steps:
32 | - uses: actions/checkout@v4
33 | - uses: ./supported-version
34 | with:
35 | kind: currently-supported
36 | id: supported-version
37 | - run: echo ${{ steps.supported-version.outputs.matrix }}
38 |
39 | setup-magento-store:
40 | needs: compute_matrix
41 | strategy:
42 | matrix: ${{ fromJSON(needs.compute_matrix.outputs.matrix) }}
43 | fail-fast: false
44 | runs-on: ubuntu-latest
45 | steps:
46 | - uses: actions/checkout@v4
47 |
48 | - run: |
49 | PSEUDO_STORE_FULL_PATH=$(realpath "${{ env.PSEUDO_REPO_FOLDER }}")
50 | echo "PSEUDO_STORE_FULL_PATH=$PSEUDO_STORE_FULL_PATH" >> $GITHUB_ENV
51 | name: Generate Full Pseudo Store Path
52 | shell: bash
53 |
54 | - name: Set PHP Version
55 | uses: shivammathur/setup-php@v2
56 | with:
57 | php-version: ${{ matrix.php }}
58 | tools: composer:v${{ matrix.composer }}
59 |
60 | - uses: actions/cache@v4
61 | id: setup-magento-store-cache
62 | with:
63 | key: setup-magento-ci | ${{ runner.os }} | ${{ matrix.magento }}
64 | path: ${{ env.PSEUDO_STORE_FULL_PATH }}
65 |
66 | - run: composer create-project --repository-url="https://mirror.mage-os.org" "${{ matrix.magento }}" "${{ env.PSEUDO_REPO_FOLDER }}" --no-install
67 | name: Create Store to simulate a real Magento store in a real repo.
68 | if: steps.setup-magento-store-cache.outputs.cache-hit != 'true'
69 |
70 | - uses: ./fix-magento-install
71 | name: Fix Magento Out of Box Install Issues
72 | with:
73 | magento_directory: ${{ env.PSEUDO_REPO_FOLDER }}
74 | if: steps.setup-magento-store-cache.outputs.cache-hit != 'true'
75 |
76 | - run: composer install
77 | shell: bash
78 | working-directory: "${{ env.PSEUDO_REPO_FOLDER }}"
79 | if: steps.setup-magento-store-cache.outputs.cache-hit != 'true'
80 |
81 | - run: git init && git config user.email "you@example.com" && git config user.name "Your Name" && git add . && git commit -m "init" && git clean -fdx
82 | working-directory: "${{ env.PSEUDO_REPO_FOLDER }}"
83 | if: steps.setup-magento-store-cache.outputs.cache-hit != 'true'
84 |
85 | - run: cp -R ${{ env.PSEUDO_REPO_FOLDER }} ${{ env.magento_folder }}
86 | shell: bash
87 |
88 | - uses: ./setup-magento
89 | id: setup-magento
90 | with:
91 | php-version: ${{ matrix.php }}
92 | tools: composer:v${{ matrix.composer }}
93 | mode: store
94 | working-directory: ${{ env.magento_folder }}
95 |
96 | - uses: mage-os/github-actions/cache-magento@main
97 | with:
98 | mode: 'store'
99 | composer_cache_key: '${{ matrix.magento }}'
100 |
101 | - run: composer install
102 | name: Composer install
103 | shell: bash
104 | working-directory: ${{ steps.setup-magento.outputs.path }}
105 |
106 | setup-magento-extension:
107 | runs-on: ubuntu-latest
108 | steps:
109 | - uses: actions/checkout@v4
110 |
111 | - uses: ./setup-magento
112 | id: setup-magento
113 | with:
114 | php-version: 8.3
115 | tools: composer:v2
116 | mode: extension
117 | magento_version: magento/project-community-edition:2.4.7-p4
118 |
119 | - uses: mage-os/github-actions/cache-magento@main
120 | with:
121 | mode: 'extension'
122 | composer_cache_key: 'magento/project-community-edition:2.4.7-p4'
123 |
124 | - run: composer install
125 | name: Composer install
126 | shell: bash
127 | working-directory: ${{ steps.setup-magento.outputs.path }}
128 |
--------------------------------------------------------------------------------
/.github/workflows/_internal-unit.yaml:
--------------------------------------------------------------------------------
1 | name: Unit Test
2 |
3 | on:
4 | push:
5 | branches:
6 | - main
7 | paths:
8 | - "_test/demo-package/**"
9 | - ".github/workflows/_internal-unit.yaml"
10 | - "unit-test/**"
11 | - "!(**/*.md)"
12 | pull_request:
13 | branches:
14 | - main
15 | paths:
16 | - "_test/demo-package/**"
17 | - ".github/workflows/_internal-unit.yaml"
18 | - "unit-test/**"
19 | - "!(**/*.md)"
20 |
21 | jobs:
22 | unit-test:
23 | strategy:
24 | matrix:
25 | php_version:
26 | - 8.2
27 | - 8.3
28 | runs-on: ubuntu-latest
29 | steps:
30 | - uses: actions/checkout@v4
31 | - uses: ./unit-test
32 | with:
33 | source_folder: _test/demo-package
34 | php_version: ${{ matrix.php_version }}
35 |
--------------------------------------------------------------------------------
/.github/workflows/_internal_test_actions.yaml:
--------------------------------------------------------------------------------
1 | name: Test Actions
2 |
3 | on:
4 | push:
5 | branches:
6 | - main
7 | paths:
8 | - ".github/workflows/_internal-supported-version.yaml"
9 | - "supported-version/**"
10 | - "package-lock.json"
11 | - "!(**/*.md)"
12 | pull_request:
13 | branches:
14 | - main
15 | paths:
16 | - ".github/workflows/_internal-supported-version.yaml"
17 | - "supported-version/**"
18 | - "package-lock.json"
19 | - "!(**/*.md)"
20 |
21 | jobs:
22 | unit-test:
23 | runs-on: ubuntu-latest
24 | steps:
25 | - uses: actions/checkout@v4
26 |
27 | - run: npm ci
28 | shell: bash
29 |
30 | - run: npm test
31 | shell: bash
--------------------------------------------------------------------------------
/.github/workflows/full-integration-tests.yaml:
--------------------------------------------------------------------------------
1 | ## Workflow is only for Magento 2 Main repo - app/code and dev/tests/integration are supported only
2 | ## 3rd party modules are not supported yet
3 | name: Integration Tests - Full Test Suite
4 | run-name: ${{ github.actor }} is running Full Integration Test Suite
5 |
6 | on:
7 | workflow_call:
8 | inputs:
9 | repository:
10 | type: string
11 | description: "Repository"
12 | required: true
13 | head:
14 | type: string
15 | description: "head SHA"
16 | required: true
17 | test_directory:
18 | type: string
19 | description: "Test directory to run integration tests"
20 | required: false
21 |
22 | permissions:
23 | contents: write
24 |
25 | jobs:
26 | matrix-calculator:
27 | runs-on: ubuntu-latest
28 | outputs:
29 | php_versions: ${{ steps.set-matrix.outputs.php_versions }}
30 | database_versions: ${{ steps.set-matrix.outputs.database_versions }}
31 | search_versions: ${{ steps.set-matrix.outputs.search_versions }}
32 | message_queue_versions: ${{ steps.set-matrix.outputs.message_queue_versions }}
33 | cache_versions: ${{ steps.set-matrix.outputs.cache_versions }}
34 | http_cache_versions: ${{ steps.set-matrix.outputs.http_cache_versions }}
35 | testsuite_dirs: ${{ steps.set-matrix-testsuite.outputs.testsuite_dirs }}
36 | steps:
37 | - name: Checkout commit
38 | uses: actions/checkout@v4
39 | with:
40 | repository: ${{ github.event.inputs.repository }}
41 | ref: ${{ github.event.inputs.head }}
42 | fetch-depth: 1
43 |
44 | - id: set-matrix
45 | name: Calculate Matrix
46 | run: |
47 | echo "php_versions=$(jq -c .services.php supported-services.json)" >> "$GITHUB_OUTPUT"
48 | echo "database_versions=$(jq -c .services.database supported-services.json)" >> "$GITHUB_OUTPUT"
49 | echo "search_versions=$(jq -c .services.search supported-services.json)" >> "$GITHUB_OUTPUT"
50 | echo "message_queue_versions=$(jq -c .services.message_queue supported-services.json)" >> "$GITHUB_OUTPUT"
51 | echo "cache_versions=$(jq -c .services.cache supported-services.json)" >> "$GITHUB_OUTPUT"
52 | echo "http_cache_versions=$(jq -c .services.http_cache supported-services.json)" >> "$GITHUB_OUTPUT"
53 |
54 | - id: set-matrix-testsuite
55 | name: Calculate Matrix for testsuite
56 | working-directory: dev/tests/integration
57 | run: |
58 |
59 | ### TODO: rebuild all that hell to node-js
60 |
61 | if [ -n "${{ github.event.inputs.test_directory }}" ]; then
62 | echo "testsuite_dirs=['${{ github.event.inputs.test_directory }}']" >> "$GITHUB_OUTPUT"
63 | exit 0
64 | fi
65 |
66 | OUTPUT_FILE="integration-testsuites.json"
67 | TESTSUITE_DIR="./testsuite/Magento"
68 | CODE_DIR="../../../app/code"
69 | MAX_DIRS_PER_LINE=1
70 |
71 | ## variable with array of exclusion list of directories - they will be handled separately and splitted on more batches
72 | EXCLUSION_LIST=("./testsuite/Magento/Catalog" "./testsuite/Magento/Bundle" "./testsuite/Magento/AsynchronousOperations" "./testsuite/Magento/Sales")
73 |
74 | ## variable with array of exclusion list of files - separate run will be executed for each file (separate place in tests matrix)
75 | STANDALONE_TESTS=("./testsuite/Magento/AsynchronousOperations/Model/MassScheduleTest.php" "./testsuite/Magento/Catalog/Observer/SwitchPriceAttributeScopeOnConfigChangeTest.php" "./testsuite/Magento/Catalog/Model/CategoryTest.php" "./testsuite/Magento/Bundle/Model/ProductTest.php" "./testsuite/Magento/Catalog/Block/Adminhtml/Category/Tab/ProductTest.php")
76 |
77 | # Initialize variables
78 | dir_count=0
79 | json_content="{\n\t\"testsuites\": [\n\t\t\""
80 | current_line=""
81 |
82 | # Function to add a directory to the current line, handling comma and count
83 | add_dir_to_line() {
84 | local dir=$1
85 | # Check if current_line is empty to avoid leading commas
86 | if [ -z "$current_line" ]; then
87 | current_line="$dir"
88 | else
89 | current_line="$current_line,$dir"
90 | fi
91 | dir_count=$((dir_count + 1))
92 |
93 | if [ "$dir_count" -eq "$MAX_DIRS_PER_LINE" ]; then
94 | json_content="$json_content$current_line"
95 | json_content="$json_content\",\n\t\t\""
96 | current_line=""
97 | dir_count=0
98 | fi
99 | }
100 |
101 | # Iterate over the directories and populate the JSON content
102 | while IFS= read -r -d '' dir; do
103 | # if dir is in EXCLUSION_LIST then skip it
104 | if [[ " ${EXCLUSION_LIST[@]} " =~ " ${dir} " ]]; then
105 | continue
106 | fi
107 | add_dir_to_line "${dir}"
108 | done < <(find "$TESTSUITE_DIR" -mindepth 1 -maxdepth 1 -type d -print0)
109 |
110 | # Add app/code integration test directories
111 | while IFS= read -r -d '' dir; do
112 | relative_dir="${dir}" # Convert absolute path to relative
113 | add_dir_to_line "$relative_dir"
114 | done < <(find "$CODE_DIR" -mindepth 4 -maxdepth 4 -type d -name 'Integration' -print0)
115 |
116 | # Handle exclusion list
117 | # run over EXCLUSION_LIST, find all "*Test.php" files, and put them in array. Exclude directories.
118 | EXCLUSION_LIST_FILES=()
119 | for dir in "${EXCLUSION_LIST[@]}"; do
120 | while IFS= read -r -d '' file; do
121 | # check if file is in STANDALONE_TESTS
122 | if [[ " ${STANDALONE_TESTS[@]} " =~ " ${file} " ]]; then
123 | continue
124 | fi
125 | EXCLUSION_LIST_FILES+=("$file")
126 | done < <(find "$dir" -mindepth 1 -type f -name '*Test.php' -print0)
127 | done
128 |
129 | ## run over EXCLUSION_LIST_FILES and call add_dir_to_line for each file
130 | MAX_DIRS_PER_LINE=10
131 | dir_count=MAX_DIRS_PER_LINE-1
132 | add_dir_to_line ""
133 | for file in "${EXCLUSION_LIST_FILES[@]}"; do
134 | add_dir_to_line "$file"
135 | done
136 |
137 | ## run over STANDALONE_TESTS and call add_dir_to_line for each file
138 | MAX_DIRS_PER_LINE=1
139 | dir_count=MAX_DIRS_PER_LINE-1
140 | add_dir_to_line ""
141 | for file in "${STANDALONE_TESTS[@]}"; do
142 | add_dir_to_line "$file"
143 | done
144 |
145 | # Handle the last line if it's not empty
146 | if [ -n "$current_line" ]; then
147 | json_content="$json_content$current_line"
148 | fi
149 |
150 | # Close the JSON string
151 | json_content="$json_content\"\n\t]\n}\n"
152 |
153 | # Write to the output file
154 | echo -e "$json_content" > "$OUTPUT_FILE"
155 |
156 | #######
157 | echo "testsuite_dirs=$(jq -c .testsuites integration-testsuites.json)" >> "$GITHUB_OUTPUT"
158 |
159 | - name: Debug output
160 | run: |
161 | echo "PHP Versions: ${{ steps.set-matrix.outputs.php_versions }}"
162 | echo "database Versions: ${{ steps.set-matrix.outputs.database_versions }}"
163 | echo "search Versions: ${{ steps.set-matrix.outputs.search_versions }}"
164 | echo "message_queue Versions: ${{ steps.set-matrix.outputs.message_queue_versions }}"
165 | echo "cache Versions: ${{ steps.set-matrix.outputs.cache_versions }}"
166 | echo "http_cache Versions: ${{ steps.set-matrix.outputs.http_cache_versions }}"
167 | echo "testsuite_dirs: ${{ steps.set-matrix-testsuite.outputs.testsuite_dirs }}"
168 |
169 | run-integration-tests:
170 | needs: [matrix-calculator]
171 | strategy:
172 | fail-fast: false
173 | matrix:
174 | php_version: ${{ fromJSON(needs.matrix-calculator.outputs.php_versions) }}
175 | database_version: ${{ fromJSON(needs.matrix-calculator.outputs.database_versions) }}
176 | search_version: ${{ fromJSON(needs.matrix-calculator.outputs.search_versions) }}
177 | message_queue_version: ${{ fromJSON(needs.matrix-calculator.outputs.message_queue_versions) }}
178 | cache_version: ${{ fromJSON(needs.matrix-calculator.outputs.cache_versions) }}
179 | http_cache_version: ${{ fromJSON(needs.matrix-calculator.outputs.http_cache_versions) }}
180 | testsuite_dirs: ${{ fromJSON(needs.matrix-calculator.outputs.testsuite_dirs) }}
181 | runs-on: ubuntu-latest
182 | steps:
183 | - name: Checkout commit
184 | uses: actions/checkout@v4
185 | with:
186 | repository: ${{ github.event.inputs.repository }}
187 | ref: ${{ github.event.inputs.head }}
188 | path: main
189 | fetch-depth: 0
190 |
191 | - name: Setup Warden Environment
192 | uses: mage-os/github-actions/warden/setup-environment@main
193 | with:
194 | run_composer_install: 1
195 | php_version: ${{ matrix.php_version }}
196 | database: ${{ matrix.database_version }}
197 | search: ${{ matrix.search_version }}
198 | rabbitmq: ${{ matrix.message_queue_version }}
199 | redis: ${{ matrix.cache_version }}
200 | varnish: ${{ matrix.http_cache_version }}
201 | base_directory: "./main"
202 |
203 | - name: Setup configs for Integration Tests
204 | uses: mage-os/github-actions/warden/integration-tests@main
205 | with:
206 | search: ${{ matrix.search_version }}
207 | rabbitmq: ${{ matrix.message_queue_version }}
208 | redis: ${{ matrix.cache_version }}
209 | run_memory_test: 0
210 | run_magento_integration_tests: 0
211 | run_magento_integration_tests_real_suite: 0
212 | base_directory: "./main"
213 |
214 | - name: Create Mage-OS testsuite
215 | working-directory: ./main/dev/tests/integration
216 | run: |
217 | FILE="phpunit.xml.dist"
218 |
219 | # Remove Memory Usage Tests and Magento Integration Tests Real Suite test suites
220 | sed -i '/