diff --git a/.ci/build_tarballs.jl b/.ci/build_tarballs.jl index b6e5b23..27ed0ea 100644 --- a/.ci/build_tarballs.jl +++ b/.ci/build_tarballs.jl @@ -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 = [ diff --git a/.ci/override-jll.jl b/.ci/override-jll.jl index d040526..1e869c7 100644 --- a/.ci/override-jll.jl +++ b/.ci/override-jll.jl @@ -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 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6991893..e605b20 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -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)' @@ -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 diff --git a/test/runexamples.jl b/test/runexamples.jl new file mode 100644 index 0000000..bf59d59 --- /dev/null +++ b/test/runexamples.jl @@ -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 diff --git a/test/runtests.jl b/test/runtests.jl index 9ac0cf7..bd161be 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -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