Skip to content

Commit

Permalink
Run examples separately and build all JLL versions
Browse files Browse the repository at this point in the history
  • Loading branch information
barche committed Oct 16, 2023
1 parent 4a7ace5 commit 0b987e2
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 41 deletions.
2 changes: 1 addition & 1 deletion .ci/build_tarballs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ LibGit2.clone("https://github.com/JuliaGraphics/jlqml.git", name)

version = getversion(joinpath(name, "CMakeLists.txt"))

julia_versions = [v"1.9.0"]
julia_versions = [v"1.6.3", v"1.9", v"1.11"]

# Collection of sources required to complete build
sources = [
Expand Down
8 changes: 7 additions & 1 deletion .ci/override-jll.jl
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
using Tar, jlqml_jll, CodecZlib

tarball = "undefined"

julia_version = "julia_version+$(Int(VERSION.major)).$(Int(VERSION.minor))"

for fname in readdir()
if !startswith(fname, "jlqml.")
continue
end
if (Sys.islinux() && occursin("linux", fname)) || (Sys.isapple() && occursin("apple", fname)) || (Sys.iswindows() && occursin("mingw32", fname))
if occursin(julia_version,fname) && (
(Sys.islinux() && occursin("linux", fname)) ||
(Sys.isapple() && occursin("apple", fname)) ||
(Sys.iswindows() && occursin("mingw32", fname)))
global tarball = fname
end
end
Expand Down
12 changes: 11 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ jobs:
julia --project .ci/override-jll.jl
- name: install-xfvb
if: runner.os == 'Linux'
run: sudo apt-get install xvfb libxkbcommon-x11-0
run: sudo apt-get install xvfb libxkbcommon-x11-0 libgl1-mesa-dri
- name: test-linux
if: runner.os == 'Linux'
run: xvfb-run --auto-servernum julia --color=yes --check-bounds=yes --project -e 'using Pkg; Pkg.test(coverage=true)'
Expand All @@ -84,6 +84,16 @@ jobs:
- name: test-win-mac
if: runner.os != 'Linux'
uses: julia-actions/julia-runtest@v1
- name: examples-linux
if: runner.os == 'Linux'
run: xvfb-run --auto-servernum julia --project test/runexamples.jl
env:
XDG_RUNTIME_DIR: /tmp/runtime-runner
continue-on-error: true
- name: examples-win-mac
if: runner.os != 'Linux'
run: julia --project test/runexamples.jl
continue-on-error: true
- uses: julia-actions/julia-processcoverage@v1
env:
DISABLE_AMEND_COVERAGE_FROM_SRC: yes
Expand Down
38 changes: 38 additions & 0 deletions test/runexamples.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import QML
import LibGit2

withenv("JULIA_LOAD_PATH" => nothing, "JULIA_GR_PROVIDER" => "BinaryBuilder") do
mktempdir() do tmpd
cd(tmpd) do
examplesdir = mkdir("QmlJuliaExamples")
LibGit2.clone("https://github.com/barche/QmlJuliaExamples.git", examplesdir)
cd(examplesdir) do
for d in ["basic", "images", "opengl", "plots"]
cd(d) do
allowmakie = true
if get(ENV, "CI", "false") == "true" && (Sys.isapple() || Sys.iswindows())
allowmakie = false
filtered = filter(l -> !contains(l, "Makie"), collect(eachline("Project.toml")))
open("Project.toml", "w") do output
for l in filtered
println(output, l)
end
end
end

qmlpath = replace(dirname(dirname(pathof(QML))), "\\" => "/")
cxxpath = replace(dirname(dirname(pathof(QML.CxxWrap))), "\\" => "/")
updatecommand = """
using Pkg
Pkg.develop([PackageSpec(path="$qmlpath"), PackageSpec(path="$cxxpath")])
Pkg.precompile()
"""
run(`$(Base.julia_cmd()) --project -e "$updatecommand"`)
QML.runexamples(allowmakie)
end
end
end
end
println(pwd())
end
end
38 changes: 0 additions & 38 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -18,41 +18,3 @@ testfiles = filter(fname -> fname ∉ excluded, readdir(@__DIR__))
end

doctest(QML)

# import LibGit2

# withenv("JULIA_LOAD_PATH" => nothing, "JULIA_GR_PROVIDER" => "BinaryBuilder") do
# mktempdir() do tmpd
# cd(tmpd) do
# examplesdir = mkdir("QmlJuliaExamples")
# LibGit2.clone("https://github.com/barche/QmlJuliaExamples.git", examplesdir)
# cd(examplesdir) do
# for d in ["basic", "images", "opengl", "plots"]
# cd(d) do
# allowmakie = true
# if get(ENV, "CI", "false") == "true" && (Sys.isapple() || Sys.iswindows())
# allowmakie = false
# filtered = filter(l -> !contains(l, "Makie"), collect(eachline("Project.toml")))
# open("Project.toml", "w") do output
# for l in filtered
# println(output, l)
# end
# end
# end

# qmlpath = replace(dirname(dirname(pathof(QML))), "\\" => "/")
# cxxpath = replace(dirname(dirname(pathof(QML.CxxWrap))), "\\" => "/")
# updatecommand = """
# using Pkg
# Pkg.develop([PackageSpec(path="$qmlpath"), PackageSpec(path="$cxxpath")])
# Pkg.precompile()
# """
# run(`$(Base.julia_cmd()) --project -e "$updatecommand"`)
# QML.runexamples(allowmakie)
# end
# end
# end
# end
# println(pwd())
# end
# end

0 comments on commit 0b987e2

Please sign in to comment.