-
Notifications
You must be signed in to change notification settings - Fork 0
98 lines (91 loc) · 2.35 KB
/
main.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
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
name: Share data between jobs
on: [push]
jobs:
job_1:
name: Add 3 and 7
runs-on: actions_runner_dev
steps:
- shell: bash
run: |
expr 3 + 7 > math-homework.txt
- name: Upload math result for job 1
uses: actions/upload-artifact@v3
with:
name: homework
path: math-homework.txt
job_2:
name: Multiply by 9
needs: job_1
runs-on: actions_runner_dev
steps:
- name: Download math result for job 1
uses: actions/download-artifact@v3
with:
name: homework
- shell: bash
run: |
value=`cat math-homework.txt`
expr $value \* 9 > math-homework.txt
- name: Upload math result for job 2
uses: actions/upload-artifact@v3
with:
name: homework
path: math-homework.txt
job_3:
name: Display results
needs: job_2
runs-on: actions_runner_dev
steps:
- name: Download math result for job 2
uses: actions/download-artifact@v3
with:
name: homework
- name: Print the final result
shell: bash
run: |
value=`cat math-homework.txt`
echo The result is $value
job_4:
name: Add 3 and 7
runs-on: actions_runner_dev
steps:
- shell: bash
run: |
expr 3 + 7 > math-homework.txt
- name: Upload math result for job 1
uses: actions/upload-artifact@v3
with:
name: homework
path: math-homework.txt
job_5:
name: Multiply by 9
needs: job_4
runs-on: actions_runner_dev
steps:
- name: Download math result for job 1
uses: actions/download-artifact@v3
with:
name: homework
- shell: bash
run: |
value=`cat math-homework.txt`
expr $value \* 9 > math-homework.txt
- name: Upload math result for job 2
uses: actions/upload-artifact@v3
with:
name: homework
path: math-homework.txt
job_6:
name: Display results
needs: job_6
runs-on: actions_runner_dev
steps:
- name: Download math result for job 2
uses: actions/download-artifact@v3
with:
name: homework
- name: Print the final result
shell: bash
run: |
value=`cat math-homework.txt`
echo The result is $value