Skip to content

Commit

Permalink
Merge pull request #77 from ArnoStrouwen/downgrade
Browse files Browse the repository at this point in the history
Downgrade CI
  • Loading branch information
ChrisRackauckas authored Dec 30, 2023
2 parents 2688790 + cdb15cf commit 9518653
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 24 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/Downgrade.yml
Original file line number Diff line number Diff line change
@@ -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
4 changes: 2 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
42 changes: 20 additions & 22 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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 t1t2 atol=3e-9
@test t1t3 atol=3e-9
@test t1t4 atol=3e-9
@test t1t2 atol=3e-8
@test t1t3 atol=3e-8
@test t1t4 atol=3e-8

function no_worldage()
ex = :(function f(_du, _u, _p, _t)
Expand Down Expand Up @@ -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

Expand Down

0 comments on commit 9518653

Please sign in to comment.