11
11
- run : npm install
12
12
- run : npm run lint
13
13
- run : npm run package
14
+
14
15
action-test :
15
16
runs-on : ${{ matrix.os }}
16
17
strategy :
@@ -30,146 +31,148 @@ jobs:
30
31
if : steps.no-param-file-url == 'success'
31
32
run : exit 1
32
33
33
- - name : Simple test to download a file
34
+ - name : 010 - Simple test to download a file
34
35
uses : ./
35
36
id : download-poetry-simple
36
37
with :
37
38
file-url : ' https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py'
38
39
- run : echo "The file was downloaded to ${{ steps.download-poetry-simple.outputs.file-path }}"
39
- - name : Test file exists
40
+ - name : 010 - Test file exists
40
41
run : python -c "import os; exit(not os.path.isfile('get-poetry.py'))"
41
- - name : Test action output path is correct
42
+ - name : 010 - Test action output path is correct
42
43
run : python -c "import os; exit(not r'${{ steps.download-poetry-simple.outputs.file-path }}' == os.path.abspath('get-poetry.py'))"
43
44
- run : ls && rm ${{ steps.download-poetry-simple.outputs.file-path }} && ls
44
45
45
- - name : Test to download a file with a different filename
46
+ - name : 020 - Test to download a file with a different filename
46
47
uses : ./
47
48
id : download-poetry-name
48
49
with :
49
50
file-url : ' https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py'
50
51
file-name : ' new_name.py'
51
52
- run : echo "The file was downloaded to ${{ steps.download-poetry-name.outputs.file-path }}"
52
- - name : Test file exists
53
+ - name : 020 - Test file exists
53
54
run : python -c "import os; exit(not os.path.isfile('new_name.py'))"
54
- - name : Test action output path is correct
55
+ - name : 020 - Test action output path is correct
55
56
run : python -c "import os; exit(not r'${{ steps.download-poetry-name.outputs.file-path }}' == os.path.abspath('new_name.py'))"
56
57
- run : ls && rm ${{ steps.download-poetry-name.outputs.file-path }} && ls
57
58
58
- - name : Test to download a file to a different path
59
+ - name : 030 - Test to download a file to a different path
59
60
uses : ./
60
61
id : download-poetry-location
61
62
with :
62
63
file-url : ' https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py'
63
64
location : ' new_folder'
64
65
- run : echo "The file was downloaded to ${{ steps.download-poetry-location.outputs.file-path }}"
65
- - name : Test file exists
66
+ - name : 030 - Test file exists
66
67
run : python -c "import os; exit(not os.path.isfile('new_folder/get-poetry.py'))"
67
- - name : Test action output path is correct
68
+ - name : 030 - Test action output path is correct
68
69
run : python -c "import os; exit(not r'${{ steps.download-poetry-location.outputs.file-path }}' == os.path.abspath('new_folder/get-poetry.py'))"
69
- - run : ls new_folder && rm -r new_folder
70
+ - run : ls && ls new_folder && rm -r new_folder && ls
70
71
71
- - name : Test to download a file to a relative path
72
+ - name : 040 - Test to download a file to a relative path
72
73
uses : ./
73
74
id : download-poetry-relative
74
75
with :
75
76
file-url : ' https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py'
76
77
location : ' ../'
77
78
- run : echo "The file was downloaded to ${{ steps.download-poetry-relative.outputs.file-path }}"
78
- - name : Test file exists
79
+ - name : 040 - Test file exists
79
80
run : python -c "import os; exit(not os.path.isfile('../get-poetry.py'))"
80
- - name : Test action output path is correct
81
+ - name : 040 - Test action output path is correct
81
82
run : python -c "import os; exit(not r'${{ steps.download-poetry-relative.outputs.file-path }}' == os.path.abspath('../get-poetry.py'))"
82
83
- run : ls ../ && rm ${{ steps.download-poetry-relative.outputs.file-path }} && ls ../
83
84
84
- - name : Test to download a file to an absolute path
85
+ - name : 050 - Test to download a file to an absolute path
85
86
uses : ./
86
87
id : download-poetry-absolute
87
88
with :
88
89
file-url : ' https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py'
89
90
location : ' ${{ github.workspace }}/a_folder'
90
91
- run : echo "The file was downloaded to ${{ steps.download-poetry-absolute.outputs.file-path }}"
91
- - name : Test file exists
92
+ - name : 050 - Test file exists
92
93
run : python -c "import os; exit(not os.path.isfile(r'${{ github.workspace }}/a_folder/get-poetry.py'))"
93
- - name : Test action output path is correct
94
+ - name : 050 - Test action output path is correct
94
95
run : python -c "import os; exit(not r'${{ steps.download-poetry-absolute.outputs.file-path }}' == os.path.abspath(r'${{ github.workspace }}/a_folder/get-poetry.py'))"
95
- - run : ls ${{ github.workspace }}/a_folder && rm -r ${{ github.workspace }}/a_folder
96
+ - run : ls ${{ github.workspace }} && ls ${{ github.workspace }} /a_folder && rm -r ${{ github.workspace }}/a_folder && ls ${{ github.workspace }}
96
97
97
- - name : Test to download a file to a different filename and path
98
+ - name : 060 - Test to download a file to a different filename and path
98
99
uses : ./
99
100
id : download-poetry-both
100
101
with :
101
102
file-url : ' https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py'
102
103
location : ' different_folder'
103
104
file-name : ' new_name.py'
104
105
- run : echo "The file was downloaded to ${{ steps.download-poetry-both.outputs.file-path }}"
105
- - name : Test file exists
106
+ - name : 060 - Test file exists
106
107
run : python -c "import os; exit(not os.path.isfile('different_folder/new_name.py'))"
108
+ - name : 060 - Test action output path is correct
109
+ run : python -c "import os; exit(not r'${{ steps.download-poetry-both.outputs.file-path }}' == os.path.abspath('different_folder/new_name.py'))"
107
110
- run : ls different_folder && rm -r different_folder
108
111
109
- - name : Test to download a file and match MD5 in lowercase
112
+ - name : 070 - Test to download a file and match MD5 in lowercase
110
113
uses : ./
111
114
id : download-tar-md5
112
115
with :
113
116
file-url : ' https://github.com/carlosperate/download-file-action/archive/refs/tags/v1.0.3.tar.gz'
114
117
file-name : ' name_md5.tar.gz'
115
118
md5 : ' e3b51204dedc75588ca164a26b51610d'
116
- - name : Test file exists
119
+ - name : 070 - Test file exists
117
120
run : python -c "import os, sys; sys.exit(not os.path.isfile('name_md5.tar.gz'))"
118
121
- run : rm name_md5.tar.gz
119
122
120
- - name : Test to download a file and match MD5 in UPPERCASE
123
+ - name : 080 - Test to download a file and match MD5 in UPPERCASE
121
124
uses : ./
122
125
id : download-tar-md5-uppercase
123
126
with :
124
127
file-url : ' https://github.com/carlosperate/download-file-action/archive/refs/tags/v1.0.3.tar.gz'
125
128
file-name : ' name_md5.tar.gz'
126
129
md5 : ' E3B51204DEDC75588CA164A26B51610D'
127
- - name : Test file exists
130
+ - name : 080 - Test file exists
128
131
run : python -c "import os, sys; sys.exit(not os.path.isfile('name_md5.tar.gz'))"
129
132
- run : rm name_md5.tar.gz
130
133
131
- - name : Test bad MD5 value
134
+ - name : 090 - Test bad MD5 value
132
135
continue-on-error : true
133
136
uses : ./
134
137
id : download-tar-md5-bad
135
138
with :
136
139
file-url : ' https://github.com/carlosperate/download-file-action/archive/refs/tags/v1.0.3.tar.gz'
137
140
md5 : ' 12345678901234567890123456789012'
138
- - name : Fail workflow if bad MD5 test didn't raise an error
141
+ - name : 090 - Fail workflow if bad MD5 test didn't raise an error
139
142
if : steps.download-tar-md5-bad.outcome == 'success'
140
143
run : exit 1
141
144
- run : rm download-file-action-1.0.3.tar.gz
142
145
143
- - name : Test to download a file and match SHA256 in lowercase
146
+ - name : 100 - Test to download a file and match SHA256 in lowercase
144
147
uses : ./
145
148
id : download-tar-sha256
146
149
with :
147
150
file-url : ' https://github.com/carlosperate/download-file-action/archive/refs/tags/v1.0.3.tar.gz'
148
151
file-name : ' name_sha256.tar.gz'
149
152
sha256 : ' 76ef5cf6e910a4955f713fb36cca6f90ffeee6ffafe743754716e149d68136de'
150
- - name : Test file exists
153
+ - name : 100 - Test file exists
151
154
run : python -c "import os, sys; sys.exit(not os.path.isfile('name_sha256.tar.gz'))"
152
155
- run : rm name_sha256.tar.gz
153
156
154
- - name : Test to download a file and match SHA256 in UPPERCASE
157
+ - name : 110 - Test to download a file and match SHA256 in UPPERCASE
155
158
uses : ./
156
159
id : download-tar-sha256-uppercase
157
160
with :
158
161
file-url : ' https://github.com/carlosperate/download-file-action/archive/refs/tags/v1.0.3.tar.gz'
159
- file-name : ' name_sha256 .tar.gz'
162
+ file-name : ' name_sha256_upper .tar.gz'
160
163
sha256 : ' 76EF5CF6E910A4955F713FB36CCA6F90FFEEE6FFAFE743754716E149D68136DE'
161
- - name : Test file exists
162
- run : python -c "import os, sys; sys.exit(not os.path.isfile('name_sha256 .tar.gz'))"
163
- - run : rm name_sha256 .tar.gz
164
+ - name : 110 - Test file exists
165
+ run : python -c "import os, sys; sys.exit(not os.path.isfile('name_sha256_upper .tar.gz'))"
166
+ - run : rm name_sha256_upper .tar.gz
164
167
165
- - name : Test bad SHA256 value
168
+ - name : 120 - Test bad SHA256 value
166
169
continue-on-error : true
167
170
uses : ./
168
171
id : download-tar-sha256-bad
169
172
with :
170
173
file-url : ' https://github.com/carlosperate/download-file-action/archive/refs/tags/v1.0.3.tar.gz'
171
174
sha256 : ' 1234567890123456789012345678901234567890123456789012345678901234'
172
- - name : Fail workflow if bad SHA256 test didn't raise an error
175
+ - name : 120 - Fail workflow if bad SHA256 test didn't raise an error
173
176
if : steps.download-tar-sha256-bad.outcome == 'success'
174
177
run : exit 1
175
178
- run : rm download-file-action-1.0.3.tar.gz
0 commit comments