diff --git a/Project.toml b/Project.toml index 37a74f8..a690580 100644 --- a/Project.toml +++ b/Project.toml @@ -21,7 +21,7 @@ Artifacts = "1" CoverageTools = "1" Downloads = "1.6.0" HTTP = "0.8, 0.9, 1" -JSON = "0.21" +JSON = "1" MbedTLS = "0.6, 0.7, 1" SHA = "0.7.0" Scratch = "1" diff --git a/src/codecov_functions.jl b/src/codecov_functions.jl index 5d0b4d4..8f5e6b5 100644 --- a/src/codecov_functions.jl +++ b/src/codecov_functions.jl @@ -40,7 +40,7 @@ function export_codecov_json(fcs::Vector{FileCoverage}, output_file="coverage.js codecov_data = to_codecov_json(fcs) open(output_file, "w") do io - JSON.print(io, codecov_data) + JSON.json(io, codecov_data) end @info "Codecov JSON exported to: $output_file" diff --git a/src/codecovio.jl b/src/codecovio.jl index c403893..6aa877a 100644 --- a/src/codecovio.jl +++ b/src/codecovio.jl @@ -163,7 +163,7 @@ function add_ci_to_kwargs(kwargs::Dict) build = ENV["BUILD_BUILDID"], ) elseif haskey(ENV, "GITHUB_ACTION") # GitHub Actions - event_path = open(JSON.Parser.parse, ENV["GITHUB_EVENT_PATH"]) + event_path = open(JSON.parse, ENV["GITHUB_EVENT_PATH"]) ref = ENV["GITHUB_REF"] if startswith(ref, "refs/heads/") branch = ref[12:end] @@ -308,7 +308,7 @@ end function upload_to_s3(; s3url, fcs) startswith(s3url, "https://") || error("Invalid codecov response: $s3url") # Upload to S3 - request = HTTP.put(s3url; body=json(to_json(fcs)), + request = HTTP.put(s3url; body=JSON.json(to_json(fcs)), header=Dict("Content-Type" => "application/json", "x-amz-storage-class" => "REDUCED_REDUNDANCY")) @debug "Result of submission:" * mask_token(String(request)) diff --git a/src/coveralls.jl b/src/coveralls.jl index 8671e4f..c2b8885 100644 --- a/src/coveralls.jl +++ b/src/coveralls.jl @@ -121,7 +121,7 @@ function prepare_request(fcs::Vector{FileCoverage}, local_env::Bool, git_info=qu data["service_name"] = "github" data["git"] = parse_git_info(git_info) - event_path = open(JSON.Parser.parse, ENV["GITHUB_EVENT_PATH"]) + event_path = open(JSON.parse, ENV["GITHUB_EVENT_PATH"]) github_pr_info = get(event_path, "pull_request", Dict()) github_pr = get(github_pr_info, "number", "") github_pr::Union{AbstractString, Integer} diff --git a/src/coveralls_functions.jl b/src/coveralls_functions.jl index b97a6a4..50e0169 100644 --- a/src/coveralls_functions.jl +++ b/src/coveralls_functions.jl @@ -69,7 +69,7 @@ function export_coveralls_json(fcs::Vector{FileCoverage}, output_file="coveralls end open(output_file, "w") do io - JSON.print(io, coveralls_data) + JSON.json(io, coveralls_data) end @info "Coveralls JSON exported to: $output_file"