-
Notifications
You must be signed in to change notification settings - Fork 0
76 lines (58 loc) · 2.24 KB
/
Copy pathmatrix-demo.yaml
File metadata and controls
76 lines (58 loc) · 2.24 KB
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
name: Matrix-Job-Builder
env:
REPO: "dev"
NAME: "Jim"
on:
workflow_dispatch:
jobs:
one-dimension-matrix-job:
name: one-dimension-${{ matrix.VERSION }}
runs-on: ubuntu-latest
strategy:
matrix:
VERSION: [ v14, v13 ]
steps:
- name: Checkout source repo
uses: actions/checkout@v3
- name: Display ${{matrix.VERSION}} value
run: |
echo "Display matrix value: ${{matrix.VERSION}}"
- name: show env var
run: |
echo "$GITHUB_RUN_ID"
echo "$GITHUB_RUN_NUMBER"
- name: Say hello to ${{matrix.VERSION}}
run: |
echo "Hello, ${{matrix.VERSION}} ! This is ${{env.NAME}} from ${{env.REPO}}"
ls -l ${{ matrix.VERSION }} || true
two-dimensions-matrix-job:
runs-on: ubuntu-latest
needs: one-dimension-matrix-job
strategy:
matrix:
VERSION_CODE: [ v14, v13, v12, v11 ]
VERSION_NAME: [ ppc, s390, x86]
include:
- VERSION_CODE: v15
VERSION_NAME: x86
exclude:
- VERSION_NAME: x86
steps:
- name: Checkout source repo
uses: actions/checkout@v3
- name: Display ${{matrix.VERSION_CODE}} value
run: |
echo "Display matrix value: ${{matrix.VERSION_CODE}} -> ${{matrix.VERSION_NAME}}"
- name: Say hello to ${{matrix.VERSION_NAME}}
run: |
echo "Hello, ${{matrix.VERSION_NAME}} ! This is ${{env.NAME}} from ${{env.REPO}}"
matrix-job-from-json:
runs-on: ubuntu-latest
needs: two-dimension-matrix-job
strategy:
matrix:
include: [{"distro": "sles", "distro-version": "15sp3", "architecture": "amd64", "package-version": "8.7.0-1.3418945733.119.1", "package-type": "rpm", "name": "amd64"}, {"distro": "sles", "distro-version": "15sp3", "architecture": "ppc64le", "package-version": "8.7.0-1.3418945733.119.1", "package-type": "rpm", "name": "ppc64le"}, {"distro": "sles", "distro-version": "15sp3", "architecture": "s390x", "package-version": "8.7.0-1.3418945733.119.1", "package-type": "rpm", "name": "s390x"}]
steps:
- name: Display matrix values
run: |
echo "Display matrix value: ${{matrix.distro}}-${{matrix.distro-version}}-${{matrix.package-version}}"