mirror of
https://github.com/graycoreio/github-actions-magento2.git
synced 2026-06-08 19:46:41 +00:00
feat(supported-version): dynamically compute (#120)
Previously, I maintained supported versions by revising a file of versions. This was monotonous, like time. Now, these are just based upon the documented EoL dates of the versions published by Magento.
This commit is contained in:
Vendored
+5
-5
File diff suppressed because one or more lines are too long
@@ -1,10 +0,0 @@
|
||||
[
|
||||
"magento/project-community-edition:>=2.3 <2.4",
|
||||
"magento/project-community-edition:>=2.4.0 <2.4.1",
|
||||
"magento/project-community-edition:>=2.4.1 <2.4.2",
|
||||
"magento/project-community-edition:>=2.4.2 <2.4.3",
|
||||
"magento/project-community-edition:>=2.4.3 <2.4.4",
|
||||
"magento/project-community-edition:>=2.4.4 <2.4.5",
|
||||
"magento/project-community-edition:>=2.4.5 <2.4.6",
|
||||
"magento/project-community-edition"
|
||||
]
|
||||
@@ -0,0 +1,24 @@
|
||||
import { getCurrentlySupportedVersions } from "./get-currently-supported";
|
||||
|
||||
describe('getCurrentlySupportedVersions', () => {
|
||||
it('should say that v2.4.0 is not supported in 2025', () => {
|
||||
const date: Date = new Date('2025-01-01T00:00:00Z');
|
||||
expect(getCurrentlySupportedVersions(date)).not.toContain('magento/project-community-edition:2.4.0');
|
||||
});
|
||||
|
||||
it('should say that v2.4.5 is supported in 2023 and most of 2024.', () => {
|
||||
const firstDayOf2023: Date = new Date('2023-01-01T00:00:00Z');
|
||||
const firstDayOf2024: Date = new Date('2024-01-01T00:00:00Z');
|
||||
const lastDayOf2024: Date = new Date('2024-12-31T00:00:00Z');
|
||||
const dayBeforeEol: Date = new Date('2024-11-24T00:00:00Z');
|
||||
const dayOfEol: Date = new Date('2024-11-25T00:00:00Z');
|
||||
const dayAfterEol: Date = new Date('2024-11-26T00:00:00Z');
|
||||
|
||||
expect(getCurrentlySupportedVersions(firstDayOf2023)).toContain('magento/project-community-edition:2.4.5-p1');
|
||||
expect(getCurrentlySupportedVersions(firstDayOf2024)).toContain('magento/project-community-edition:2.4.5-p1');
|
||||
expect(getCurrentlySupportedVersions(lastDayOf2024)).not.toContain('magento/project-community-edition:2.4.5-p1');
|
||||
expect(getCurrentlySupportedVersions(dayBeforeEol)).toContain('magento/project-community-edition:2.4.5-p1');
|
||||
expect(getCurrentlySupportedVersions(dayOfEol)).toContain('magento/project-community-edition:2.4.5-p1');
|
||||
expect(getCurrentlySupportedVersions(dayAfterEol)).not.toContain('magento/project-community-edition:2.4.5-p1');
|
||||
})
|
||||
})
|
||||
@@ -0,0 +1,7 @@
|
||||
import { MagentoMatrixVersion } from '../matrix/matrix-type';
|
||||
import allVersions from '../versions/individual.json';
|
||||
|
||||
export const getCurrentlySupportedVersions = (date: Date): string[] =>
|
||||
Object.entries(<Record<string,MagentoMatrixVersion>>allVersions)
|
||||
.filter(([key, value]) => new Date(value.eol) >= date)
|
||||
.map(([key, value]) => key);
|
||||
@@ -1,18 +1,18 @@
|
||||
import { getMatrixForVersions } from "./get-matrix-for-versions";
|
||||
|
||||
import latestJson from '../kind/latest.json';
|
||||
import currentlySupportedJson from '../kind/currently-supported.json';
|
||||
import allVersions from '../versions/individual.json';
|
||||
import nightly from '../kind/nightly.json';
|
||||
import { amendMatrixForNext } from "../nightly/get-next-version";
|
||||
import { getDayBefore } from '../nightly/get-day-before';
|
||||
import { getCurrentlySupportedVersions } from "../kind/get-currently-supported";
|
||||
|
||||
export const getMatrixForKind = (kind: string, versions: string = "") => {
|
||||
export const getMatrixForKind = (kind: string, versions = "") => {
|
||||
switch(kind){
|
||||
case 'latest':
|
||||
return getMatrixForVersions(latestJson);
|
||||
case 'currently-supported':
|
||||
return getMatrixForVersions(currentlySupportedJson);
|
||||
return getMatrixForVersions(getCurrentlySupportedVersions(new Date()));
|
||||
case 'nightly':
|
||||
return amendMatrixForNext(getMatrixForVersions(nightly), 'https://upstream-mirror.mage-os.org', getDayBefore());
|
||||
case 'all':
|
||||
|
||||
@@ -8,7 +8,8 @@ export interface MagentoMatrixVersion {
|
||||
redis: string,
|
||||
varnish: string,
|
||||
nginx: string,
|
||||
os: string
|
||||
os: string,
|
||||
eol: string
|
||||
}
|
||||
|
||||
export interface GithubActionsMatrix {
|
||||
|
||||
@@ -9,7 +9,8 @@
|
||||
"redis": "redis:6.0",
|
||||
"varnish": "varnish:6.0",
|
||||
"nginx": "nginx:1.18",
|
||||
"os": "ubuntu-18.04"
|
||||
"os": "ubuntu-18.04",
|
||||
"eol": "2022-09-30T00:00:00+0000"
|
||||
},
|
||||
"magento/project-community-edition:>=2.4.0 <2.4.1": {
|
||||
"magento": "magento/project-community-edition:>=2.4.0 <2.4.1",
|
||||
@@ -21,7 +22,8 @@
|
||||
"redis": "redis:5.0",
|
||||
"varnish": "varnish:6.0",
|
||||
"nginx": "nginx:1.18",
|
||||
"os": "ubuntu-20.04"
|
||||
"os": "ubuntu-20.04",
|
||||
"eol": "2022-11-28T00:00:00+0000"
|
||||
},
|
||||
"magento/project-community-edition:>=2.4.1 <2.4.2": {
|
||||
"magento": "magento/project-community-edition:>=2.4.1 <2.4.2",
|
||||
@@ -33,7 +35,8 @@
|
||||
"redis": "redis:5.0",
|
||||
"varnish": "varnish:6.0",
|
||||
"nginx": "nginx:1.18",
|
||||
"os": "ubuntu-20.04"
|
||||
"os": "ubuntu-20.04",
|
||||
"eol": "2022-11-28T00:00:00+0000"
|
||||
},
|
||||
"magento/project-community-edition:>=2.4.2 <2.4.3": {
|
||||
"magento": "magento/project-community-edition:>=2.4.2 <2.4.3",
|
||||
@@ -45,7 +48,8 @@
|
||||
"redis": "redis:6.0",
|
||||
"varnish": "varnish:6.0",
|
||||
"nginx": "nginx:1.18",
|
||||
"os": "ubuntu-20.04"
|
||||
"os": "ubuntu-20.04",
|
||||
"eol": "2022-11-28T00:00:00+0000"
|
||||
},
|
||||
"magento/project-community-edition:>=2.4.3 <2.4.4": {
|
||||
"magento": "magento/project-community-edition:>=2.4.3 <2.4.4",
|
||||
@@ -57,7 +61,8 @@
|
||||
"redis": "redis:6.0",
|
||||
"varnish": "varnish:6.0",
|
||||
"nginx": "nginx:1.18",
|
||||
"os": "ubuntu-20.04"
|
||||
"os": "ubuntu-20.04",
|
||||
"eol": "2022-11-28T00:00:00+0000"
|
||||
},
|
||||
"magento/project-community-edition:>=2.4.4 <2.4.5": {
|
||||
"magento": "magento/project-community-edition:>=2.4.4 <2.4.5",
|
||||
@@ -69,7 +74,8 @@
|
||||
"redis": "redis:6.2",
|
||||
"varnish": "varnish:7.0",
|
||||
"nginx": "nginx:1.18",
|
||||
"os": "ubuntu-latest"
|
||||
"os": "ubuntu-latest",
|
||||
"eol": "2024-11-25T00:00:00+0000"
|
||||
},
|
||||
"magento/project-community-edition:>=2.4.5 <2.4.6": {
|
||||
"magento": "magento/project-community-edition:>=2.4.5 <2.4.6",
|
||||
@@ -81,7 +87,8 @@
|
||||
"redis": "redis:6.2",
|
||||
"varnish": "varnish:7.0",
|
||||
"nginx": "nginx:1.18",
|
||||
"os": "ubuntu-latest"
|
||||
"os": "ubuntu-latest",
|
||||
"eol": "2024-11-25T00:00:00+0000"
|
||||
},
|
||||
"magento/project-community-edition": {
|
||||
"magento": "magento/project-community-edition",
|
||||
@@ -93,7 +100,8 @@
|
||||
"redis": "redis:6.2",
|
||||
"varnish": "varnish:7.0",
|
||||
"nginx": "nginx:1.18",
|
||||
"os": "ubuntu-latest"
|
||||
"os": "ubuntu-latest",
|
||||
"eol": "2024-11-25T00:00:00+0000"
|
||||
},
|
||||
"magento/project-community-edition:next": {
|
||||
"magento": "magento/project-community-edition:next",
|
||||
@@ -105,6 +113,7 @@
|
||||
"redis": "redis:6.2",
|
||||
"varnish": "varnish:7.0",
|
||||
"nginx": "nginx:1.18",
|
||||
"os": "ubuntu-latest"
|
||||
"os": "ubuntu-latest",
|
||||
"eol": "2024-11-25T00:00:00+0000"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,7 +9,8 @@
|
||||
"redis": "redis:6.0",
|
||||
"varnish": "varnish:6.0",
|
||||
"nginx": "nginx:1.18",
|
||||
"os": "ubuntu-18.04"
|
||||
"os": "ubuntu-18.04",
|
||||
"eol": "2022-08-09T00:00:00+0000"
|
||||
},
|
||||
"magento/project-community-edition:2.3.7-p4": {
|
||||
"magento": "magento/project-community-edition:2.3.7-p4",
|
||||
@@ -21,7 +22,8 @@
|
||||
"redis": "redis:6.0",
|
||||
"varnish": "varnish:6.0",
|
||||
"nginx": "nginx:1.18",
|
||||
"os": "ubuntu-18.04"
|
||||
"os": "ubuntu-18.04",
|
||||
"eol": "2022-09-30T00:00:00+0000"
|
||||
},
|
||||
"magento/project-community-edition:2.4.0": {
|
||||
"magento": "magento/project-community-edition:2.4.0",
|
||||
@@ -33,7 +35,8 @@
|
||||
"redis": "redis:5.0",
|
||||
"varnish": "varnish:6.0",
|
||||
"nginx": "nginx:1.18",
|
||||
"os": "ubuntu-20.04"
|
||||
"os": "ubuntu-20.04",
|
||||
"eol": "2020-10-15T00:00:00+0000"
|
||||
},
|
||||
"magento/project-community-edition:2.4.0-p1": {
|
||||
"magento": "magento/project-community-edition:2.4.0-p1",
|
||||
@@ -45,7 +48,8 @@
|
||||
"redis": "redis:5.0",
|
||||
"varnish": "varnish:6.0",
|
||||
"nginx": "nginx:1.18",
|
||||
"os": "ubuntu-20.04"
|
||||
"os": "ubuntu-20.04",
|
||||
"eol": "2022-11-28T00:00:00+0000"
|
||||
},
|
||||
"magento/project-community-edition:2.4.1": {
|
||||
"magento": "magento/project-community-edition:2.4.1",
|
||||
@@ -57,7 +61,8 @@
|
||||
"redis": "redis:5.0",
|
||||
"varnish": "varnish:6.0",
|
||||
"nginx": "nginx:1.18",
|
||||
"os": "ubuntu-20.04"
|
||||
"os": "ubuntu-20.04",
|
||||
"eol": "2021-02-09T00:00:00+0000"
|
||||
},
|
||||
"magento/project-community-edition:2.4.1-p1": {
|
||||
"magento": "magento/project-community-edition:2.4.1-p1",
|
||||
@@ -69,7 +74,8 @@
|
||||
"redis": "redis:5.0",
|
||||
"varnish": "varnish:6.0",
|
||||
"nginx": "nginx:1.18",
|
||||
"os": "ubuntu-20.04"
|
||||
"os": "ubuntu-20.04",
|
||||
"eol": "2022-11-28T00:00:00+0000"
|
||||
},
|
||||
"magento/project-community-edition:2.4.2": {
|
||||
"magento": "magento/project-community-edition:2.4.2",
|
||||
@@ -81,7 +87,8 @@
|
||||
"redis": "redis:6.0",
|
||||
"varnish": "varnish:6.0",
|
||||
"nginx": "nginx:1.18",
|
||||
"os": "ubuntu-20.04"
|
||||
"os": "ubuntu-20.04",
|
||||
"eol": "2021-05-11T00:00:00+0000"
|
||||
},
|
||||
"magento/project-community-edition:2.4.2-p1": {
|
||||
"magento": "magento/project-community-edition:2.4.2-p1",
|
||||
@@ -93,7 +100,8 @@
|
||||
"redis": "redis:6.0",
|
||||
"varnish": "varnish:6.0",
|
||||
"nginx": "nginx:1.18",
|
||||
"os": "ubuntu-20.04"
|
||||
"os": "ubuntu-20.04",
|
||||
"eol": "2021-08-10T00:00:00+0000"
|
||||
},
|
||||
"magento/project-community-edition:2.4.2-p2": {
|
||||
"magento": "magento/project-community-edition:2.4.2-p2",
|
||||
@@ -105,7 +113,8 @@
|
||||
"redis": "redis:6.0",
|
||||
"varnish": "varnish:6.0",
|
||||
"nginx": "nginx:1.18",
|
||||
"os": "ubuntu-20.04"
|
||||
"os": "ubuntu-20.04",
|
||||
"eol": "2022-11-28T00:00:00+0000"
|
||||
},
|
||||
"magento/project-community-edition:2.4.3": {
|
||||
"magento": "magento/project-community-edition:2.4.3",
|
||||
@@ -117,7 +126,8 @@
|
||||
"redis": "redis:6.0",
|
||||
"varnish": "varnish:6.0",
|
||||
"nginx": "nginx:1.18",
|
||||
"os": "ubuntu-20.04"
|
||||
"os": "ubuntu-20.04",
|
||||
"eol": "2021-10-12T00:00:00+0000"
|
||||
},
|
||||
"magento/project-community-edition:2.4.3-p1": {
|
||||
"magento": "magento/project-community-edition:2.4.3-p1",
|
||||
@@ -129,7 +139,8 @@
|
||||
"redis": "redis:6.0",
|
||||
"varnish": "varnish:6.0",
|
||||
"nginx": "nginx:1.18",
|
||||
"os": "ubuntu-20.04"
|
||||
"os": "ubuntu-20.04",
|
||||
"eol": "2022-04-12T00:00:00+0000"
|
||||
},
|
||||
"magento/project-community-edition:2.4.3-p2": {
|
||||
"magento": "magento/project-community-edition:2.4.3-p2",
|
||||
@@ -141,7 +152,8 @@
|
||||
"redis": "redis:6.0",
|
||||
"varnish": "varnish:6.0",
|
||||
"nginx": "nginx:1.18",
|
||||
"os": "ubuntu-20.04"
|
||||
"os": "ubuntu-20.04",
|
||||
"eol": "2022-08-09T00:00:00+0000"
|
||||
},
|
||||
"magento/project-community-edition:2.4.3-p3": {
|
||||
"magento": "magento/project-community-edition:2.4.3-p3",
|
||||
@@ -153,7 +165,8 @@
|
||||
"redis": "redis:6.0",
|
||||
"varnish": "varnish:6.0",
|
||||
"nginx": "nginx:1.18",
|
||||
"os": "ubuntu-20.04"
|
||||
"os": "ubuntu-20.04",
|
||||
"eol": "2022-11-28T00:00:00+0000"
|
||||
},
|
||||
"magento/project-community-edition:2.4.4": {
|
||||
"magento": "magento/project-community-edition:2.4.4",
|
||||
@@ -165,7 +178,8 @@
|
||||
"redis": "redis:6.2",
|
||||
"varnish": "varnish:7.0",
|
||||
"nginx": "nginx:1.18",
|
||||
"os": "ubuntu-latest"
|
||||
"os": "ubuntu-latest",
|
||||
"eol": "2022-08-09T00:00:00+0000"
|
||||
},
|
||||
"magento/project-community-edition:2.4.4-p1": {
|
||||
"magento": "magento/project-community-edition:2.4.4-p1",
|
||||
@@ -177,7 +191,8 @@
|
||||
"redis": "redis:6.2",
|
||||
"varnish": "varnish:7.0",
|
||||
"nginx": "nginx:1.18",
|
||||
"os": "ubuntu-latest"
|
||||
"os": "ubuntu-latest",
|
||||
"eol": "2022-10-11T00:00:00+0000"
|
||||
},
|
||||
"magento/project-community-edition:2.4.4-p2": {
|
||||
"magento": "magento/project-community-edition:2.4.4-p2",
|
||||
@@ -189,7 +204,8 @@
|
||||
"redis": "redis:6.2",
|
||||
"varnish": "varnish:7.0",
|
||||
"nginx": "nginx:1.18",
|
||||
"os": "ubuntu-latest"
|
||||
"os": "ubuntu-latest",
|
||||
"eol": "2024-11-25T00:00:00+0000"
|
||||
},
|
||||
"magento/project-community-edition:2.4.5": {
|
||||
"magento": "magento/project-community-edition:2.4.5",
|
||||
@@ -201,7 +217,8 @@
|
||||
"redis": "redis:6.2",
|
||||
"varnish": "varnish:7.0",
|
||||
"nginx": "nginx:1.18",
|
||||
"os": "ubuntu-latest"
|
||||
"os": "ubuntu-latest",
|
||||
"eol": "2022-08-09T00:00:00+0000"
|
||||
},
|
||||
"magento/project-community-edition:2.4.5-p1": {
|
||||
"magento": "magento/project-community-edition:2.4.5-p1",
|
||||
@@ -213,6 +230,7 @@
|
||||
"redis": "redis:6.2",
|
||||
"varnish": "varnish:7.0",
|
||||
"nginx": "nginx:1.18",
|
||||
"os": "ubuntu-latest"
|
||||
"os": "ubuntu-latest",
|
||||
"eol": "2024-11-25T00:00:00+0000"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user