diff --git a/.github/workflows/linters.yml b/.github/workflows/linters.yml index 91e77c16a..6c79e7db4 100644 --- a/.github/workflows/linters.yml +++ b/.github/workflows/linters.yml @@ -13,22 +13,23 @@ jobs: steps: - uses: actions/checkout@v5 - name: Set up Julia - uses: julia-actions/setup-julia@v2 + uses: ./.github/actions/setup-julia with: - version: '1' - - uses: julia-actions/cache@v2 - # - name: Install ReLint.jl - # run: julia -e 'using Pkg; Pkg.add(url="https://github.com/RelationalAI-oss/ReLint.jl")' - # - name: Run ReLint - # run: | - # julia -e ' - # using ReLint - # lint_result = ReLint.run_lint(".") - # if lint_result.fatalviolations_count > 0 - # println("ReLint found fatal violations") - # exit(1) - # end - # ' + julia-version: '1' + project-file: 'Project.toml' + key-suffix: relint + - name: Install ReLint.jl + run: julia -e 'using Pkg; Pkg.add(url="https://github.com/RelationalAI-oss/ReLint.jl")' + - name: Run ReLint + run: | + julia -e ' + using ReLint + lint_result = ReLint.run_lint(".") + if lint_result.fatalviolations_count > 0 + println("ReLint found $(lint_result.fatalviolations_count) fatal violations") + exit(1) + end + ' - uses: julia-actions/julia-format@v4 with: diff --git a/benchmark/util/compare.jl b/benchmark/util/compare.jl index 759e77602..e678f4f24 100644 --- a/benchmark/util/compare.jl +++ b/benchmark/util/compare.jl @@ -129,10 +129,10 @@ function table_to_html(data::Vector{CompareRow})::String html = "

✅ Benchmarks are stable!

" * "\n" * html else if regressed > 0 - html = "

⚠️ $regressed benchmark regressions detected!

" * "\n" * html + html = "

⚠️ $(regressed) benchmark regressions detected!

" * "\n" * html end if improved > 0 - html = "

🚀 $improved benchmark improvements detected!

" * "\n" * html + html = "

🚀 $(improved) benchmark improvements detected!

" * "\n" * html end end @@ -178,6 +178,8 @@ function compare_multi_tables(a::Vector{Vector{Row}}, b::Vector{Vector{Row}})::V return data end +thaskey(dict::Dict, key) = haskey(dict, key) + function compare_tables(a::Vector{Row}, b::Vector{Row})::Vector{CompareRow} dict_a = Dict(@sprintf("%s %07d", x.name, x.n) => x for x in a) dict_b = Dict(@sprintf("%s %07d", x.name, x.n) => x for x in b) @@ -195,13 +197,13 @@ function compare_tables(a::Vector{Row}, b::Vector{Row})::Vector{CompareRow} for bench in keys_vec row = CompareRow() - if haskey(dict_a, bench) + if thaskey(dict_a, bench) r = dict_a[bench] row.name = r.name row.n = r.n row.time_ns_a = r.time_ns end - if haskey(dict_b, bench) + if thaskey(dict_b, bench) r = dict_b[bench] row.name = r.name row.n = r.n