23
23
steps :
24
24
- name : Checkout
25
25
uses : actions/checkout@v4
26
+ with :
27
+ persist-credentials : false
26
28
27
29
- name : Simple 1 invoke - no copy, no artifact
28
30
id : simple1
@@ -40,11 +42,18 @@ jobs:
40
42
41
43
- name : Simple 1 - assert
42
44
shell : python
45
+ env :
46
+ EXPECTED_HASH : ${{ hashFiles('.test/simple-build/src') }}
47
+ OUTPUT_HASH : ${{ steps.simple1.outputs.hash }}
48
+ OUTPUT_BUILD_HTML : ${{ steps.simple1.outputs.build-html }}
49
+ ARTIFACT_HASH : ${{ hashFiles(steps.simple1-artifact.outputs.download-path) }}
43
50
run : |
44
- expected_hash = r'${{ hashFiles('.test/simple-build/src') }}'
45
- output_hash = r'${{ steps.simple1.outputs.hash }}'
46
- output_build_html = r'${{ steps.simple1.outputs.build-html }}'
47
- artifact_hash = r'${{ hashFiles(steps.simple1-artifact.outputs.download-path) }}'
51
+ import os
52
+
53
+ expected_hash = os.environ['ARTIFACT_HASH']
54
+ output_hash = os.environ['OUTPUT_HASH']
55
+ output_build_html = os.environ['OUTPUT_BUILD_HTML']
56
+ artifact_hash = os.environ['ARTIFACT_HASH']
48
57
49
58
assert output_build_html == '.test/simple-build/build/html'
50
59
assert output_hash == expected_hash
@@ -67,12 +76,20 @@ jobs:
67
76
68
77
- name : Simple 2 - assert
69
78
shell : python
79
+ env :
80
+ expected_hash : ${{ hashFiles('.test/simple-build/src') }}
81
+ output_hash : ${{ steps.simple2.outputs.hash }}
82
+ output_build_html : ${{ steps.simple2.outputs.build-html }}
83
+ artifact_hash : ${{ hashFiles(steps.simple2-artifact.outputs.download-path) }}
84
+ original_build_hash : ${{ hashFiles('.test/simple-build/build/html') }}
70
85
run : |
71
- expected_hash = r'${{ hashFiles('.test/simple-build/src') }}'
72
- output_hash = r'${{ steps.simple2.outputs.hash }}'
73
- output_build_html = r'${{ steps.simple2.outputs.build-html }}'
74
- artifact_hash = r'${{ hashFiles(steps.simple2-artifact.outputs.download-path) }}'
75
- original_build_hash = r'${{ hashFiles('.test/simple-build/build/html') }}'
86
+ import os
87
+
88
+ expected_hash = os.environ['expected_hash']
89
+ output_hash = os.environ['output_hash']
90
+ output_build_html = os.environ['output_build_html']
91
+ artifact_hash = os.environ['artifact_hash']
92
+ original_build_hash = os.environ['original_build_hash']
76
93
77
94
assert output_build_html == '.copies/simple2/html'
78
95
assert output_hash == expected_hash
@@ -97,26 +114,36 @@ jobs:
97
114
98
115
- name : Simple 3 - assert
99
116
shell : python
117
+ env :
118
+ expected_hash : ${{ hashFiles('.test/simple-build/src') }}
119
+ output_hash : ${{ steps.simple3.outputs.hash }}
120
+ output_build_html : ${{ steps.simple3.outputs.build-html }}
121
+ artifact_hash : ${{ hashFiles(steps.simple3-artifact.outputs.download-path) }}
100
122
run : |
101
- expected_hash = r'${{ hashFiles('.test/simple-build/src') }}'
102
- output_hash = r'${{ steps.simple3.outputs.hash }}'
103
- output_build_html = r'${{ steps.simple3.outputs.build-html }}'
104
- artifact_hash = r'${{ hashFiles(steps.simple3-artifact.outputs.download-path) }}'
123
+ import os
124
+
125
+ expected_hash = os.environ['expected_hash']
126
+ output_hash = os.environ['output_hash']
127
+ output_build_html = os.environ['output_build_html']
128
+ artifact_hash = os.environ['artifact_hash']
105
129
106
130
assert output_build_html == '.test/simple-build/build/html'
107
131
assert output_hash == expected_hash
108
132
assert artifact_hash == output_hash
109
133
110
134
- name : Simple 3 - bash asserts
135
+ env :
136
+ ARTIFACTS_URL : ${{ steps.simple3.outputs.artifact-url }}
137
+ DOWNLOAD_PATH : ${{ steps.simple3-artifact.outputs.download-path }}
111
138
run : |
112
139
set -eu
113
140
114
141
# this URL only goes to the run page, not to an individual artifact
115
142
# so all we're really checking here is that it's a valid URL that's accessible
116
- wget '${{ steps.simple3.outputs.artifact-url }}'
143
+ wget "${ARTIFACTS_URL}"
117
144
118
145
# ensure that the html directory is not present in the downloaded artifact
119
- test ! -d "${{ steps.simple3-artifact.outputs.download-path } }/html"
146
+ test ! -d "${DOWNLOAD_PATH }/html"
120
147
121
148
- name : Simple 4 invoke - with copy, with artifact
122
149
id : simple4
@@ -137,28 +164,39 @@ jobs:
137
164
138
165
- name : Simple 4 - assert
139
166
shell : python
167
+ env :
168
+ expected_hash : ${{ hashFiles('.test/simple-build/src') }}
169
+ output_hash : ${{ steps.simple4.outputs.hash }}
170
+ output_build_html : ${{ steps.simple4.outputs.build-html }}
171
+ artifact_hash : ${{ hashFiles(steps.simple4-artifact.outputs.download-path) }}
172
+ original_build_hash : ${{ hashFiles('.test/simple-build/build/html') }}
140
173
run : |
141
- expected_hash = r'${{ hashFiles('.test/simple-build/src') }}'
142
- output_hash = r'${{ steps.simple4.outputs.hash }}'
143
- output_build_html = r'${{ steps.simple4.outputs.build-html }}'
144
- artifact_hash = r'${{ hashFiles(steps.simple4-artifact.outputs.download-path) }}'
145
- original_build_hash = r'${{ hashFiles('.test/simple-build/build/html') }}'
174
+ import os
175
+
176
+ expected_hash = os.environ['expected_hash']
177
+ output_hash = os.environ['output_hash']
178
+ output_build_html = os.environ['output_build_html']
179
+ artifact_hash = os.environ['artifact_hash']
180
+ original_build_hash = os.environ['original_build_hash']
146
181
147
182
assert output_build_html == '.copies/simple4/html'
148
183
assert output_hash == expected_hash
149
184
assert output_hash == original_build_hash
150
185
assert artifact_hash == output_hash
151
186
152
187
- name : Simple 4 - bash asserts
188
+ env :
189
+ ARTIFACTS_URL : ${{ steps.simple4.outputs.artifact-url }}
190
+ DOWNLOAD_PATH : ${{ steps.simple4-artifact.outputs.download-path }}
153
191
run : |
154
192
set -eu
155
193
156
194
# this URL only goes to the run page, not to an individual artifact
157
195
# so all we're really checking here is that it's a valid URL that's accessible
158
- wget '${{ steps.simple4.outputs.artifact-url }}'
196
+ wget "${ARTIFACTS_URL}"
159
197
160
198
# ensure that the html directory is not present in the downloaded artifact
161
- test ! -d "${{ steps.simple4-artifact.outputs.download-path } }/html"
199
+ test ! -d "${DOWNLOAD_PATH }/html"
162
200
163
201
- name : Simple 5 invoke - with copy, with artifact, trailing slash in input
164
202
id : simple5
@@ -179,25 +217,36 @@ jobs:
179
217
180
218
- name : Simple 5 - assert
181
219
shell : python
220
+ env :
221
+ expected_hash : ${{ hashFiles('.test/simple-build/src') }}
222
+ output_hash : ${{ steps.simple5.outputs.hash }}
223
+ output_build_html : ${{ steps.simple5.outputs.build-html }}
224
+ artifact_hash : ${{ hashFiles(steps.simple5-artifact.outputs.download-path) }}
225
+ original_build_hash : ${{ hashFiles('.test/simple-build/build/html/') }}
182
226
run : |
183
- expected_hash = r'${{ hashFiles('.test/simple-build/src') }}'
184
- output_hash = r'${{ steps.simple5.outputs.hash }}'
185
- output_build_html = r'${{ steps.simple5.outputs.build-html }}'
186
- artifact_hash = r'${{ hashFiles(steps.simple5-artifact.outputs.download-path) }}'
187
- original_build_hash = r'${{ hashFiles('.test/simple-build/build/html/') }}'
227
+ import os
228
+
229
+ expected_hash = os.environ['expected_hash ']
230
+ output_hash = os.environ['output_hash']
231
+ output_build_html = os.environ['output_build_html']
232
+ artifact_hash = os.environ['artifact_hash']
233
+ original_build_hash = os.environ['original_build_hash']
188
234
189
235
assert output_build_html == '.copies/simple5/html/'
190
236
assert output_hash == expected_hash
191
237
assert output_hash == original_build_hash
192
238
assert artifact_hash == output_hash
193
239
194
240
- name : Simple 5 - bash asserts
241
+ env :
242
+ ARTIFACTS_URL : ${{ steps.simple5.outputs.artifact-url }}
243
+ DOWNLOAD_PATH : ${{ steps.simple5-artifact.outputs.download-path }}
195
244
run : |
196
245
set -eu
197
246
198
247
# this URL only goes to the run page, not to an individual artifact
199
248
# so all we're really checking here is that it's a valid URL that's accessible
200
- wget '${{ steps.simple5.outputs.artifact-url }}'
249
+ wget "${ARTIFACTS_URL}"
201
250
202
251
# ensure that the html directory is not present in the downloaded artifact
203
- test ! -d "${{ steps.simple5-artifact.outputs.download-path } }/html"
252
+ test ! -d "${DOWNLOAD_PATH }/html"
0 commit comments