Skip to content

Commit 48f108b

Browse files
authored
common matrix
1 parent 7cd1d93 commit 48f108b

File tree

1 file changed

+31
-30
lines changed

1 file changed

+31
-30
lines changed

.github/workflows/release.yml

Lines changed: 31 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -38,29 +38,42 @@ jobs:
3838
name: built
3939
path: ./
4040

41-
#
42-
# test built image caching
41+
- name: Output matrix
42+
id: set_matrix
43+
uses: actions/github-script@v2
44+
with:
45+
script: |
46+
return {
47+
inspect_image: [
48+
'test_project_node',
49+
'amazon/aws-cli'
50+
],
51+
include: [
52+
{
53+
inspect_image: 'test_project_node'
54+
prepare_command: 'docker-compose -f test_project/docker-compose.yml -p test_project pull'
55+
build_command: 'docker-compose -f test_project/docker-compose.yml -p test_project build'
56+
}, {
57+
inspect_image: 'amazon/aws-cli'
58+
prepare_command: 'echo'
59+
build_command: 'docker pull amazon/aws-cli'
60+
}
61+
]
62+
}
63+
64+
outputs:
65+
matrix: ${{ steps.set_matrix.outputs.result }}
4366

4467
test_saving:
68+
if: github.event_name != 'delete'
69+
needs: build
4570
strategy:
46-
matrix:
47-
inspect_image:
48-
- test_project_node
49-
- amazon/aws-cli
50-
include:
51-
- inspect_image: test_project_node
52-
prepare_command: docker-compose -f test_project/docker-compose.yml -p test_project pull
53-
build_command: docker-compose -f test_project/docker-compose.yml -p test_project build
54-
- inspect_image: amazon/aws-cli
55-
prepare_command: echo
56-
build_command: docker pull amazon/aws-cli
57-
71+
matrix: ${{ needs.build.outputs.matrix }}
5872
runs-on: ubuntu-latest
59-
needs: build
60-
if: github.event_name != 'delete'
6173

6274
steps:
6375
- uses: actions/checkout@v2
76+
6477
- run: ${{ matrix.prepare_command }}
6578

6679
- name: Extract
@@ -83,22 +96,10 @@ jobs:
8396
- run: ${{ matrix.build_command }}
8497

8598
test_restoring:
99+
needs: test_saving
86100
strategy:
87-
matrix:
88-
inspect_image:
89-
- test_project_node
90-
- amazon/aws-cli
91-
include:
92-
- inspect_image: test_project_node
93-
prepare_command: docker-compose -f test_project/docker-compose.yml -p test_project pull
94-
build_command: docker-compose -f test_project/docker-compose.yml -p test_project build
95-
- inspect_image: amazon/aws-cli
96-
prepare_command: echo
97-
build_command: docker pull amazon/aws-cli
98-
101+
matrix: ${{ needs.build.outputs.matrix }}
99102
runs-on: ubuntu-latest
100-
needs: test_saving
101-
102103
steps:
103104
- uses: actions/checkout@v2
104105

0 commit comments

Comments
 (0)