Skip to content

Commit 26c354d

Browse files
authored
feat(supported-version): add all kind (#36)
1 parent 09d4f1e commit 26c354d

File tree

8 files changed

+24
-7
lines changed

8 files changed

+24
-7
lines changed

.github/workflows/_internal-install.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,16 @@ jobs:
2929
steps:
3030
- uses: actions/checkout@v3
3131
- uses: ./supported-version
32+
with:
33+
kind: all
3234
id: supported-version
3335
- run: echo ${{ steps.supported-version.outputs.matrix }}
3436

3537
install-test:
3638
needs: compute_matrix
3739
strategy:
3840
matrix: ${{ fromJSON(needs.compute_matrix.outputs.matrix) }}
41+
fail-fast: false
3942
runs-on: ubuntu-latest
4043
steps:
4144
- uses: actions/checkout@v3

.github/workflows/_internal-integration.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ jobs:
2929
steps:
3030
- uses: actions/checkout@v3
3131
- uses: ./supported-version
32+
with:
33+
kind: all
3234
id: supported-version
3335
- run: echo ${{ steps.supported-version.outputs.matrix }}
3436
integration-workflow:
@@ -39,3 +41,4 @@ jobs:
3941
source_folder: $GITHUB_WORKSPACE/_test/demo-package
4042
matrix: ${{ needs.compute_matrix.outputs.matrix }}
4143
test_command: ../../../vendor/bin/phpunit ../../../vendor/graycore/magento2-demo-package/Test/Integration
44+
fail-fast: false

supported-version/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ See the [action.yml](./action.yml)
1313

1414
| Input | Description | Required | Default |
1515
| --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ | -------- | ----------- |
16-
| kind | The "kind" of support you're targeting for your package. Allowed values are `currently-supported`, `latest` and `custom` | false | 'currently-supported' |
16+
| kind | The "kind" of support you're targeting for your package. Allowed values are `currently-supported`, `latest`, `custom`, and `all` | false | 'currently-supported' |
1717
| custom_versions | The versions you want to support, as a comma-separated string, i.e. 'magento/project-community-edition:2.3.7-p3, magento/project-community-edition:2.4.2-p2' | false | '' |
1818

1919
## Usage

supported-version/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ description: "A Github Action that computes the Github Actions matrix for the ch
55
inputs:
66
kind:
77
required: false
8-
description: "The kind of versions you want to return. Allowed values are `currently-supported, latest, custom`"
8+
description: "The kind of versions you want to return. Allowed values are `currently-supported, latest, custom, all`"
99
default: "currently-supported"
1010
custom_versions:
1111
required: false

supported-version/dist/index.js

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

supported-version/src/kind/compute-kind.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ export const KNOWN_KINDS = {
55
'currently-supported': true,
66
'latest': true,
77
'custom': true,
8+
'all': true,
89
}
910

1011
export const isValidKind = (kind: string): boolean => {

supported-version/src/matrix/get-matrix-for-kind.spec.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,13 @@ describe('getMatrixForKind', () => {
1515
expect(result.include).toBeDefined();
1616
});
1717

18+
it('returns a matrix for `all`', () => {
19+
const result = getMatrixForKind("all");
20+
21+
expect(result.magento).toBeDefined();
22+
expect(result.include).toBeDefined();
23+
});
24+
1825
it('returns a matrix for valid `custom`', () => {
1926
const result = getMatrixForKind("custom", "magento/project-community-edition:2.3.7-p3");
2027

supported-version/src/matrix/get-matrix-for-kind.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,16 @@ import { getMatrixForVersions } from "./get-matrix-for-versions";
22

33
import latestJson from '../kind/latest.json';
44
import currentlySupportedJson from '../kind/currently-supported.json';
5+
import allVersions from '../versions/individual.json';
56

67
export const getMatrixForKind = (kind: string, versions: string = "") => {
78
switch(kind){
89
case 'latest':
910
return getMatrixForVersions(latestJson);
1011
case 'currently-supported':
1112
return getMatrixForVersions(currentlySupportedJson);
13+
case 'all':
14+
return getMatrixForVersions(Object.keys(allVersions));
1215
case 'custom':
1316
return getMatrixForVersions(versions.split(","))
1417
default:

0 commit comments

Comments
 (0)