From 5ddb82f339e188f23200eb69fb76fc3451b485c4 Mon Sep 17 00:00:00 2001 From: Arno Strouwen Date: Fri, 29 Dec 2023 18:20:02 +0100 Subject: [PATCH 1/2] Downgrade CI --- .github/workflows/Downgrade.yml | 29 ++++++++++++++++++++++++++ Project.toml | 4 ++-- test/runtests.jl | 36 ++++++++++++++++----------------- 3 files changed, 48 insertions(+), 21 deletions(-) create mode 100644 .github/workflows/Downgrade.yml diff --git a/.github/workflows/Downgrade.yml b/.github/workflows/Downgrade.yml new file mode 100644 index 0000000..01ff8ca --- /dev/null +++ b/.github/workflows/Downgrade.yml @@ -0,0 +1,29 @@ +name: Downgrade +on: + pull_request: + branches: + - master + paths-ignore: + - 'docs/**' + push: + branches: + - master + paths-ignore: + - 'docs/**' +jobs: + test: + runs-on: ubuntu-latest + strategy: + matrix: + version: ['1'] + steps: + - uses: actions/checkout@v4 + - uses: julia-actions/setup-julia@v1 + with: + version: ${{ matrix.version }} + - uses: cjdoris/julia-downgrade-compat-action@v1 +# if: ${{ matrix.version == '1.6' }} + with: + skip: Pkg,TOML + - uses: julia-actions/julia-buildpkg@v1 + - uses: julia-actions/julia-runtest@v1 \ No newline at end of file diff --git a/Project.toml b/Project.toml index 043f496..0fbb8e0 100644 --- a/Project.toml +++ b/Project.toml @@ -13,9 +13,9 @@ Aqua = "0.8" BenchmarkTools = "1" ExprTools = "0.1" SHA = "0.7" -Serialization = "1" +Serialization = "1.10" Test = "1" -julia = "1.9" +julia = "1.10" [extras] Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595" diff --git a/test/runtests.jl b/test/runtests.jl index aaf0842..8ca2048 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -153,30 +153,28 @@ using RuntimeGeneratedFunctions f = @RuntimeGeneratedFunction(:(x -> x + y)) end) -# closures -if VERSION >= v"1.7.0-DEV.351" - ex = :(x -> (y -> x + y)) - @test @RuntimeGeneratedFunction(ex)(2)(3) === 5 - ex = :(x -> (f(y::Int)::Float64 = x + y; f)) - @test @RuntimeGeneratedFunction(ex)(2)(3) === 5.0 +ex = :(x -> (y -> x + y)) +@test @RuntimeGeneratedFunction(ex)(2)(3) === 5 - ex = :(x -> function (y::Int) - return x + y - end) - @test @RuntimeGeneratedFunction(ex)(2)(3) === 5 +ex = :(x -> (f(y::Int)::Float64 = x + y; f)) +@test @RuntimeGeneratedFunction(ex)(2)(3) === 5.0 - ex = :(x -> function f(y::Int)::UInt8 - return x + y - end) - @test @RuntimeGeneratedFunction(ex)(2)(3) === 0x05 +ex = :(x -> function (y::Int) + return x + y +end) +@test @RuntimeGeneratedFunction(ex)(2)(3) === 5 - ex = :(x -> sum(i^2 for i in 1:x)) - @test @RuntimeGeneratedFunction(ex)(3) === 14 +ex = :(x -> function f(y::Int)::UInt8 + return x + y +end) +@test @RuntimeGeneratedFunction(ex)(2)(3) === 0x05 - ex = :(x -> [2i for i in 1:x]) - @test @RuntimeGeneratedFunction(ex)(3) == [2, 4, 6] -end +ex = :(x -> sum(i^2 for i in 1:x)) +@test @RuntimeGeneratedFunction(ex)(3) === 14 + +ex = :(x -> [2i for i in 1:x]) +@test @RuntimeGeneratedFunction(ex)(3) == [2, 4, 6] # Serialization From cdb15cf19484deaa5570edd8076d69323c538aee Mon Sep 17 00:00:00 2001 From: Christopher Rackauckas Date: Fri, 29 Dec 2023 19:10:42 -0500 Subject: [PATCH 2/2] Update runtests.jl --- test/runtests.jl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/runtests.jl b/test/runtests.jl index 8ca2048..ca3bdff 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -58,9 +58,9 @@ t2 = @belapsed $f1($du, $u, $p, $t) t3 = @belapsed $f2($du, $u, $p, $t) t4 = @belapsed $f3($du, $u, $p, $t) -@test t1≈t2 atol=3e-9 -@test t1≈t3 atol=3e-9 -@test t1≈t4 atol=3e-9 +@test t1≈t2 atol=3e-8 +@test t1≈t3 atol=3e-8 +@test t1≈t4 atol=3e-8 function no_worldage() ex = :(function f(_du, _u, _p, _t)