Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .JuliaFormatter.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
style = "sciml"
format_markdown = true
format_docstrings = true
18 changes: 10 additions & 8 deletions .github/workflows/update.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,22 @@ using Git, GitHub, Dates
gh_token = ARGS[1]
myauth = GitHub.authenticate(gh_token)

(@isdefined myauth) ? @info("Authentication token is found...") : @info("Coudn't find the authentication token")
(@isdefined myauth) ? @info("Authentication token is found...") :
@info("Coudn't find the authentication token")

const git = Git.git()
date = Dates.format(now(), "yyyy-mm-dd")
benchpath = joinpath(@__DIR__, "..", "..", "benchmarks")

# Get all the open PRs and their number
gh_prs = GitHub.pull_requests("SciML/SciMLBenchmarks.jl"; auth=myauth)
gh_prs = GitHub.pull_requests("SciML/SciMLBenchmarks.jl"; auth = myauth)
prs = Dict{String, Int64}()
for i in 1:length(gh_prs[1])
prs[gh_prs[1][i].head.ref] = gh_prs[1][i].number
end

# Get all the branches from the repo
gh_branches = GitHub.branches("SciML/SciMLBenchmarks.jl"; auth=myauth)
gh_branches = GitHub.branches("SciML/SciMLBenchmarks.jl"; auth = myauth)
branches = [gh_branches[1][i].name for i in 1:length(gh_branches[1])]

@info("PRs and branches", prs, branches)
Expand Down Expand Up @@ -50,14 +51,15 @@ for dir in readdir(benchpath)
if dir ∉ keys(prs)
params = Dict(
"title" => "Updated $(dir) for benchmarks",
"head" => "$(dir)",
"base" => "master"
"head" => "$(dir)",
"base" => "master"
)
@info("Creating a pull request from head: ", dir)
GitHub.create_pull_request("SciML/SciMLBenchmarks.jl"; params=params, auth=myauth)
@info("Creating a pull request from head: ", dir)
GitHub.create_pull_request(
"SciML/SciMLBenchmarks.jl"; params = params, auth = myauth)
else
@info("Updating the pull request numbered: ", prs[dir])
GitHub.update_pull_request("SciML/SciMLBenchmarks.jl", prs[dir]; auth=myauth)
GitHub.update_pull_request("SciML/SciMLBenchmarks.jl", prs[dir]; auth = myauth)
end
end
end