-
Notifications
You must be signed in to change notification settings - Fork 102
47 lines (42 loc) · 1.35 KB
/
workflow-tester88.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
name: Test 88 # Related to SO: https://stackoverflow.com/questions/72537896/github-actions-create-matrix-of-multiple-sequential-jobs
on:
push:
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
common-matrix-job:
runs-on: ubuntu-latest
outputs:
environments: ${{ steps.environments.outputs.environments }}
steps:
- name: Build Environments Array
id: environments
run: |
myArray=()
myArray+=("env1")
myArray+=("env2")
myArray+=("env3")
myArray=$(jq --compact-output --null-input '$ARGS.positional' --args -- "${myArray[@]}")
echo "Updated environments list: $myArray"
echo "environments=$myArray" >> $GITHUB_OUTPUT
shell: bash
reusable:
needs: [common-matrix-job]
strategy:
matrix:
environment: ${{ fromJSON(needs.common-matrix-job.outputs.environments) }}
fail-fast: true
max-parallel: 1
# environment:
# name: ${{ matrix.environment }}
uses: GuillaumeFalourd/poc-github-actions/.github/workflows/workflow-tester88-reusable.yml@main
with:
stage: ${{ matrix.environment }}
common-job:
needs: [common-matrix-job, reusable]
runs-on: ubuntu-latest
steps:
- name: Do something
run: echo "Do something"