tkf / BenchmarkCI.jl
Showing 1 of 2 files from the diff.
Other files ignored by Codecov
test/runtests.jl has changed.

@@ -105,6 +105,10 @@
Loading
105 105
    return PkgBenchmark.judge(group_target, group_baseline)
106 106
end
107 107
108 +
# Used only for testing:
109 +
_loadciresult(workspace::AbstractString = DEFAULT_WORKSPACE) =
110 +
    CIResult(judgement = _loadjudge(workspace))
111 +
108 112
"""
109 113
    postjudge()
110 114
@@ -174,6 +178,18 @@
Loading
174 178
    JSON.print(io, Dict("body" => comment::AbstractString))
175 179
end
176 180
181 +
function error_on_missing_github_token()
182 +
    error("""
183 +
    Environment variable `GITHUB_TOKEN` is not set.  The workflow file
184 +
    must contain configuration such as:
185 +
186 +
        - name: Post result
187 +
          run: julia -e "using BenchmarkCI; BenchmarkCI.postjudge()"
188 +
          env:
189 +
            GITHUB_TOKEN: \${{ secrets.GITHUB_TOKEN }}
190 +
    """)
191 +
end
192 +
177 193
function post_judge_github(event_path, ciresult)
178 194
    event = JSON.parsefile(event_path)
179 195
    url = event["pull_request"]["comments_url"]
@@ -181,18 +197,7 @@
Loading
181 197
    @debug "Posting to: $url"
182 198
183 199
    GITHUB_TOKEN = get(ENV, "GITHUB_TOKEN", nothing)
184 -
    if GITHUB_TOKEN === nothing
185 -
        error("""
186 -
        Environment variable `GITHUB_TOKEN` is not set.  The workflow
187 -
        file must contain configuration such as:
188 -
189 -
            - name: Post result
190 -
              run: julia -e "using BenchmarkCI; BenchmarkCI.postjudge()"
191 -
              env:
192 -
                GITHUB_TOKEN: \${{ secrets.GITHUB_TOKEN }}
193 -
        """)
194 -
        return
195 -
    end
200 +
    GITHUB_TOKEN === nothing && error_on_missing_github_token()
196 201
197 202
    cmd = ```
198 203
    curl
Files Coverage
src 79.13%
Project Totals (2 files) 79.13%
Untitled

No yaml found.

Create your codecov.yml to customize your Codecov experience

Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading