@@ -29,10 +29,6 @@ commands:
29
29
description : Custom url to submit the codecov result. Default to "https://codecov.io/bash"
30
30
type : string
31
31
default : " https://codecov.io/bash"
32
- using_windows :
33
- description : Is this being run in a Windows setup?
34
- type : boolean
35
- default : false
36
32
validate_url :
37
33
description : Validate the url before submitting the codecov result. https://docs.codecov.io/docs/about-the-codecov-bash-uploader#validating-the-bash-script
38
34
type : boolean
@@ -46,88 +42,40 @@ commands:
46
42
type : string
47
43
default : " "
48
44
steps :
45
+ - run :
46
+ name : Download Codecov Bash Uploader
47
+ command : curl -fLso codecov << parameters.url >>
48
+ when : << parameters.when >>
49
49
- when :
50
- condition : << parameters.using_windows >>
50
+ condition : << parameters.validate_url >>
51
51
steps :
52
52
- run :
53
- name : Download Codecov Bash Uploader
54
- command : Invoke-WebRequest -Uri "<< parameters.url >>" -Outfile codecov
55
- when : << parameters.when >>
56
- - when :
57
- condition : << parameters.validate_url >>
58
- steps :
59
- - run :
60
- name : Validate Codecov Bash Uploader
61
- command : |
62
- $VERSION=((Select-String -path codecov 'VERSION=\"[0-9\.]*\"' | ForEach-Object {$_.Matches} | Foreach-Object {$_.Groups[0].Value})-split '"')[1]
63
- foreach ($i in 1, 256, 512) {
64
- echo "Pulling public hashes from https://github.com/codecov/codecov-bash/releases/download/${VERSION}/SHA${i}SUM"
65
- $hash = (((Invoke-WebRequest -Uri "https://github.com/codecov/codecov-bash/releases/download/${VERSION}/SHA${i}SUM")[0])-split( " " ))[0]
66
- $scripthash = (Get-FileHash -Algorithm "SHA${i}" codecov).hash.ToLower()
67
- If ($scripthash -ne $hash) {
68
- echo "Script hash: ${scripthash}"
69
- echo "Published has: ${hash}"
70
- echo "SHASUMs do not match, exiting."
71
- exit 1
72
- } Else {
73
- echo "OK"
74
- }
75
- }
76
- - run :
77
- name : Upload Coverage Results
78
- command : |
79
- $arguments = @( "-Q", "codecov-circleci-orb-1.2.2" )
80
- If ( "<< parameters.token >>" -ne "") {
81
- $arguments += "-t"
82
- $arguments += "<< parameters.token >>"
83
- }
84
- If ( "<< parameters.flags >>" -ne "") {
85
- $arguments += "-F"
86
- $arguments += "<< parameters.flags >>"
87
- }
88
- If ( "<< parameters.file >>" -ne "") {
89
- $arguments += "-f"
90
- $arguments += "<< parameters.file >>"
91
- }
92
- If ( "<< parameters.upload_name >>" -ne "") {
93
- $arguments += "-n"
94
- $arguments += "<< parameters.upload_name >>"
95
- }
96
- If ( "<< parameters.xtra_args >>" -ne "") {
97
- foreach ($arg in "<< parameters.xtra_args >>".split( " " ) ) {
98
- $arguments += $arg
99
- }
100
- }
101
- chmod +x codecov
102
- bash ./codecov @arguments
103
- - unless :
104
- condition : << parameters.using_windows >>
105
- steps :
53
+ name : Validate Codecov Bash Uploader
54
+ command : |
55
+ VERSION=$(grep 'VERSION=\"[0-9\.]*\"' codecov | cut -d'"' -f2);
56
+ sha1sum -c --ignore-missing <(curl -s https://raw.githubusercontent.com/codecov/codecov-bash/${VERSION}/SHA1SUM) ||
57
+ sha1sum -c <(curl -s https://raw.githubusercontent.com/codecov/codecov-bash/${VERSION}/SHA1SUM | grep -w "codecov") ||
58
+ shasum -a 1 -c --ignore-missing <(curl -s https://raw.githubusercontent.com/codecov/codecov-bash/${VERSION}/SHA1SUM) ||
59
+ shasum -a 1 -c <(curl -s https://raw.githubusercontent.com/codecov/codecov-bash/${VERSION}/SHA1SUM | grep -w "codecov")
60
+
61
+ sha256sum -c --ignore-missing <(curl -s https://raw.githubusercontent.com/codecov/codecov-bash/${VERSION}/SHA256SUM) ||
62
+ sha256sum -c <(curl -s https://raw.githubusercontent.com/codecov/codecov-bash/${VERSION}/SHA256SUM | grep -w "codecov") ||
63
+ shasum -a 256 -c --ignore-missing <(curl -s https://raw.githubusercontent.com/codecov/codecov-bash/${VERSION}/SHA256SUM) ||
64
+ shasum -a 256 -c <(curl -s https://raw.githubusercontent.com/codecov/codecov-bash/${VERSION}/SHA256SUM | grep -w "codecov")
65
+
66
+ sha512sum -c --ignore-missing <(curl -s https://raw.githubusercontent.com/codecov/codecov-bash/${VERSION}/SHA512SUM) ||
67
+ sha512sum -c <(curl -s https://raw.githubusercontent.com/codecov/codecov-bash/${VERSION}/SHA512SUM | grep -w "codecov") ||
68
+ shasum -a 512 -c --ignore-missing <(curl -s https://raw.githubusercontent.com/codecov/codecov-bash/${VERSION}/SHA512SUM) ||
69
+ shasum -a 512 -c <(curl -s https://raw.githubusercontent.com/codecov/codecov-bash/${VERSION}/SHA512SUM | grep -w "codecov")
106
70
- run :
107
- name : Download Codecov Bash Uploader
108
- command : curl -fLso codecov << parameters.url >>
109
- when : << parameters.when >>
110
- - when :
111
- condition : << parameters.validate_url >>
112
- steps :
113
- - run :
114
- name : Validate Codecov Bash Uploader
115
- command : |
116
- VERSION=$(grep 'VERSION=\"[0-9\.]*\"' codecov | cut -d'"' -f2);
117
- for i in 1 256 512
118
- do
119
- shasum -a $i -c --ignore-missing <(curl -s https://raw.githubusercontent.com/codecov/codecov-bash/${VERSION}/SHA${i}SUM) ||
120
- shasum -a $i -c <(curl -s https://raw.githubusercontent.com/codecov/codecov-bash/${VERSION}/SHA${i}SUM | grep -w "codecov")
121
- done
122
- - run :
123
- name : Upload Coverage Results
124
- command : |
125
- args=()
126
- [[ -n "<< parameters.file >>" ]] && args+=( '-f << parameters.file >>' )
127
- [[ -n "<< parameters.xtra_args >>" ]] && args+=( '<< parameters.xtra_args >>' )
128
- bash codecov \
129
- -Q "codecov-circleci-orb-1.2.2" \
130
- -t "<< parameters.token >>" \
131
- -n "<< parameters.upload_name >>" \
132
- -F "<< parameters.flags >>" \
133
- ${args[@]}
71
+ name : Upload Coverage Results
72
+ command : |
73
+ args=()
74
+ [[ -n "<< parameters.file >>" ]] && args+=( '-f << parameters.file >>' )
75
+ [[ -n "<< parameters.xtra_args >>" ]] && args+=( '<< parameters.xtra_args >>' )
76
+ bash codecov \
77
+ -Q "codecov-circleci-orb-1.2.3" \
78
+ -t "<< parameters.token >>" \
79
+ -n "<< parameters.upload_name >>" \
80
+ -F "<< parameters.flags >>" \
81
+ ${args[@]}
0 commit comments