mirror of
https://github.com/graycoreio/github-actions-magento2.git
synced 2026-06-08 19:46:41 +00:00
feat(supported-version): dynamically append "version" to matrix
This commit is contained in:
Vendored
+1
-1
File diff suppressed because one or more lines are too long
@@ -16,7 +16,7 @@ export const getMatrixForVersions = (project: string, versions: string[]): Githu
|
||||
|
||||
return {
|
||||
magento: [...acc.magento, current],
|
||||
include: [...acc.include, knownVersions[current]]
|
||||
include: [...acc.include, { ...knownVersions[current], version: current.split(':')[1] ?? '' }]
|
||||
}
|
||||
}, {magento: [], include: []});
|
||||
}
|
||||
@@ -11,6 +11,7 @@ export interface Services {
|
||||
|
||||
export interface PackageMatrixVersion {
|
||||
magento: string,
|
||||
version: string,
|
||||
php: string | number,
|
||||
composer: string | number,
|
||||
mysql: string,
|
||||
|
||||
@@ -8,6 +8,7 @@ describe('amendMatrixForNext', () => {
|
||||
include: [
|
||||
{
|
||||
"magento": "magento/project-community-edition:next",
|
||||
"version": "next",
|
||||
"php": 8.2,
|
||||
"composer": "2",
|
||||
"mysql": "mysql:8.0",
|
||||
@@ -33,6 +34,7 @@ describe('amendMatrixForNext', () => {
|
||||
include: [
|
||||
{
|
||||
"magento": "magento/project-community-edition:@alpha",
|
||||
"version": "@alpha",
|
||||
"php": 8.2,
|
||||
"composer": "2",
|
||||
"mysql": "mysql:8.0",
|
||||
@@ -60,6 +62,7 @@ describe('amendMatrixForNext', () => {
|
||||
include: [
|
||||
{
|
||||
"magento": "magento/project-community-edition:v2.4.6-p2",
|
||||
"version": "v2.4.6-p2",
|
||||
"php": 8.2,
|
||||
"composer": "2",
|
||||
"mysql": "mysql:8.0",
|
||||
@@ -85,6 +88,7 @@ describe('amendMatrixForNext', () => {
|
||||
include: [
|
||||
{
|
||||
"magento": "magento/project-community-edition:v2.4.6-p2",
|
||||
"version": "v2.4.6-p2",
|
||||
"php": 8.2,
|
||||
"composer": "2",
|
||||
"mysql": "mysql:8.0",
|
||||
@@ -112,6 +116,7 @@ describe('amendMatrixForNext', () => {
|
||||
include: [
|
||||
{
|
||||
"magento": "magento/project-community-edition:v2.4.6-p2",
|
||||
"version": "v2.4.6-p2",
|
||||
"php": 8.2,
|
||||
"composer": "2",
|
||||
"mysql": "mysql:8.0",
|
||||
@@ -128,6 +133,7 @@ describe('amendMatrixForNext', () => {
|
||||
},
|
||||
{
|
||||
"magento": "magento/project-community-edition:next",
|
||||
"version": "next",
|
||||
"php": 8.2,
|
||||
"composer": "2",
|
||||
"mysql": "mysql:8.0",
|
||||
@@ -153,6 +159,7 @@ describe('amendMatrixForNext', () => {
|
||||
include: [
|
||||
{
|
||||
"magento": "magento/project-community-edition:v2.4.6-p2",
|
||||
"version": "v2.4.6-p2",
|
||||
"php": 8.2,
|
||||
"composer": "2",
|
||||
"mysql": "mysql:8.0",
|
||||
@@ -169,6 +176,7 @@ describe('amendMatrixForNext', () => {
|
||||
},
|
||||
{
|
||||
"magento": "magento/project-community-edition:@alpha",
|
||||
"version": "@alpha",
|
||||
"php": 8.2,
|
||||
"composer": "2",
|
||||
"mysql": "mysql:8.0",
|
||||
@@ -196,6 +204,7 @@ describe('amendMatrixForNext', () => {
|
||||
include: [
|
||||
{
|
||||
"magento": "mage-os/project-community-edition:next",
|
||||
"version": "next",
|
||||
"php": 8.2,
|
||||
"composer": "2",
|
||||
"mysql": "mysql:8.0",
|
||||
@@ -221,6 +230,7 @@ describe('amendMatrixForNext', () => {
|
||||
include: [
|
||||
{
|
||||
"magento": "mage-os/project-community-edition:@alpha",
|
||||
"version": "@alpha",
|
||||
"php": 8.2,
|
||||
"composer": "2",
|
||||
"mysql": "mysql:8.0",
|
||||
|
||||
@@ -12,12 +12,11 @@ export const amendMatrixForNext = (matrix: GithubActionsMatrix, repository: Repo
|
||||
const nextVersionRegExp = new RegExp(nextVersionPlaceHolder + '$');
|
||||
matrix.magento = matrix.magento.map((item) => item.match(nextVersionRegExp) ? unifyNextPackageName(item, repository, date) : item);
|
||||
matrix.include = matrix.include.map((item) => {
|
||||
return item.magento.match(nextVersionRegExp)
|
||||
? {
|
||||
...item,
|
||||
magento: unifyNextPackageName(item.magento, repository, date),
|
||||
}
|
||||
: item;
|
||||
if (!item.magento.match(nextVersionRegExp)) {
|
||||
return item;
|
||||
}
|
||||
const magento = unifyNextPackageName(item.magento, repository, date);
|
||||
return { ...item, magento, version: magento.split(':')[1] };
|
||||
});
|
||||
return matrix;
|
||||
}
|
||||
@@ -3,6 +3,7 @@ import { PackageMatrixVersion } from '../matrix/matrix-type';
|
||||
|
||||
const createTestEntry = (overrides: Partial<PackageMatrixVersion> = {}): PackageMatrixVersion => ({
|
||||
magento: 'magento/project-community-edition:2.4.7',
|
||||
version: '2.4.7',
|
||||
php: '8.3',
|
||||
composer: '2.7.4',
|
||||
mysql: 'mysql:8.4',
|
||||
|
||||
Reference in New Issue
Block a user