Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add CI to make sure that the lower bounds are working #279

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions .github/workflows/Downgrade.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Downgrade
on:
pull_request:
branches:
- main
paths-ignore:
- 'docs/**'
push:
branches:
- main
paths-ignore:
- 'docs/**'
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
version:
- '1.6'
- '1'
# - 'nightly'
steps:
- uses: actions/checkout@v3
- 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
75 changes: 75 additions & 0 deletions .just/downgrade.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
function downgrade(file, ignore_pkgs, strict)
lines = readlines(file)
compat = false
for (i, line) in pairs(lines)
if startswith(line, "[compat]")
compat = true
elseif startswith(line, "[")
compat = false
elseif startswith(strip(line), "#") || isempty(strip(line))
continue
elseif compat
# parse the compat line
m = match(r"^([A-Za-z0-9]+)( *= *\")([^\"]*)(\".*)", line)
if m === nothing
error("cannot parse compat line: $line")
end
pkg, eq, ver, post = m.captures
# skip julia and any ignored packages
if pkg == "julia" || pkg in ignore_pkgs
println("skipping $pkg: $ver")
continue
end
# just take the first part a list compat
ver2 = strip(split(ver, ",")[1])
if occursin(" - ", ver2)
error("range specifiers not supported")
end
# separate the operator from the version
if ver2[1] in "^~="
op = ver2[1]
ver2 = ver2[2:end]
elseif isnumeric(ver2[1])
op = '^'
else
println("skipping $pkg: $ver")
continue
end
# parse the version
ver2 = VersionNumber(ver2)
# select a new operator
if strict == "true"
op = '='
elseif strict == "v0" && ver2.major == 0
op = '='
elseif op == '^'
op = '~'
end
# output the new compat entry
ver2 = "$op$ver2"
if ver == ver2
println("skipping $pkg: $ver")
continue
end
lines[i] = "$pkg$eq$ver2$post"
println("downgrading $pkg: $ver -> $ver2")
end
end
open(file, "w") do io
for line in lines
println(io, line)
end
end
end

ignore_pkgs = map(strip, split(ARGS[1], ",", keepempty=false))
strict = ARGS[2]

strict in ["true", "false", "v0"] || error("strict must be true, false or v0")

project_files = filter(isfile, ["Project.toml", "JuliaProject.toml"])
isempty(project_files) && error("could not find Project.toml")

for file in project_files
downgrade(file, ignore_pkgs, strict)
end
56 changes: 28 additions & 28 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,34 +39,34 @@ DiffEqDevTools = "f3b72e0c-5b89-59e1-b016-84e28bfd966d"
DiffEqDevToolsExt = "DiffEqDevTools"

[compat]
ArrayAllocators = "0.3"
DiffEqBase = "6.122"
DiffEqDevTools = "2"
ExponentialUtilities = "1"
FastBroadcast = "0.2"
FastGaussQuadrature = "0.5, 1"
ForwardDiff = "0.10"
FunctionWrappersWrappers = "0.1.3"
GaussianDistributions = "0.5"
Kronecker = "0.5.4"
LinearAlgebra = "1"
Octavian = "0.3.17"
OrdinaryDiffEq = "6.52"
PSDMatrices = "0.4.6"
PrecompileTools = "1"
RecipesBase = "1"
RecursiveArrayTools = "2"
Reexport = "1"
SciMLBase = "1.90, 2"
SimpleUnPack = "1"
SpecialMatrices = "3"
StaticArrayInterface = "1.3"
Statistics = "1"
StructArrays = "0.4, 0.5, 0.6"
TaylorIntegration = "0.8, 0.9, 0.10, 0.11, 0.12, 0.13, 0.14"
TaylorSeries = "0.10, 0.11, 0.12, 0.13, 0.14, 0.15"
Test = "1"
ToeplitzMatrices = "0.7, 0.8"
ArrayAllocators = "=0.3.0"
DiffEqBase = "~6.125.0"
DiffEqDevTools = "~2.30.0"
ExponentialUtilities = "~1.22.0"
FastBroadcast = "=0.2.5"
FastGaussQuadrature = "=1.0.0"
ForwardDiff = "=0.10.13"
FunctionWrappersWrappers = "=0.1.3"
GaussianDistributions = "=0.5.2"
Kronecker = "=0.5.4"
LinearAlgebra = "~1.9.0"
Octavian = "=0.3.21"
OrdinaryDiffEq = "~6.52.0"
PSDMatrices = "=0.4.6"
PrecompileTools = "~1.0.0"
RecipesBase = "~1.3.0"
RecursiveArrayTools = "~2.36.0"
Reexport = "~1.0.0"
SciMLBase = "~1.90.0"
SimpleUnPack = "~1.0.0"
SpecialMatrices = "~3.0.0"
StaticArrayInterface = "~1.3.0"
Statistics = "~1.9.0"
StructArrays = "=0.4.0"
TaylorIntegration = "=0.9.0"
TaylorSeries = "=0.12.0"
Test = "~1.6.0"
ToeplitzMatrices = "=0.7.0"
julia = "1.6"

[extras]
Expand Down
76 changes: 76 additions & 0 deletions Project_main.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
name = "ProbNumDiffEq"
uuid = "bf3e78b0-7d74-48a5-b855-9609533b56a5"
authors = ["Nathanael Bosch"]
version = "0.13.0"

[deps]
ArrayAllocators = "c9d4266f-a5cb-439d-837c-c97b191379f5"
DiffEqBase = "2b5f629d-d688-5b77-993f-72d75c75574e"
DiffEqDevTools = "f3b72e0c-5b89-59e1-b016-84e28bfd966d"
ExponentialUtilities = "d4d017d3-3776-5f7e-afef-a10c40355c18"
FastBroadcast = "7034ab61-46d4-4ed7-9d0f-46aef9175898"
FastGaussQuadrature = "442a2c76-b920-505d-bb47-c5924d526838"
ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210"
FunctionWrappersWrappers = "77dc65aa-8811-40c2-897b-53d922fa7daf"
GaussianDistributions = "43dcc890-d446-5863-8d1a-14597580bb8d"
Kronecker = "2c470bb0-bcc8-11e8-3dad-c9649493f05e"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Octavian = "6fd5a793-0b7e-452c-907f-f8bfe9c57db4"
OrdinaryDiffEq = "1dea7af3-3e70-54e6-95c3-0bf5283fa5ed"
PSDMatrices = "fe68d972-6fd8-4755-bdf0-97d4c54cefdc"
PrecompileTools = "aea7be01-6a6a-4083-8856-8a6e6704d82a"
RecipesBase = "3cdcf5f2-1ef4-517c-9805-6587b60abb01"
RecursiveArrayTools = "731186ca-8d62-57ce-b412-fbd966d074cd"
Reexport = "189a3867-3050-52da-a836-e630ba90ab69"
SciMLBase = "0bca4576-84f4-4d90-8ffe-ffa030f20462"
SimpleUnPack = "ce78b400-467f-4804-87d8-8f486da07d0a"
SpecialMatrices = "928aab9d-ef52-54ac-8ca1-acd7ca42c160"
StaticArrayInterface = "0d7ed370-da01-4f52-bd93-41d350b8b718"
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
StructArrays = "09ab397b-f2b6-538f-b94a-2f83cf4a842a"
TaylorIntegration = "92b13dbe-c966-51a2-8445-caca9f8a7d42"
TaylorSeries = "6aa5eb33-94cf-58f4-a9d0-e4b2c4fc25ea"
ToeplitzMatrices = "c751599d-da0a-543b-9d20-d0a503d91d24"

[weakdeps]
DiffEqDevTools = "f3b72e0c-5b89-59e1-b016-84e28bfd966d"

[extensions]
DiffEqDevToolsExt = "DiffEqDevTools"

[compat]
ArrayAllocators = "0.3"
DiffEqBase = "6.125"
DiffEqDevTools = "2"
ExponentialUtilities = "1.22"
FastBroadcast = "0.2.5"
FastGaussQuadrature = "1"
ForwardDiff = "0.10.13"
FunctionWrappersWrappers = "0.1.3"
GaussianDistributions = "0.5.2"
Kronecker = "0.5.4"
LinearAlgebra = "1.6"
Octavian = "0.3.21"
OrdinaryDiffEq = "6.52"
PSDMatrices = "0.4.6"
PrecompileTools = "1"
RecipesBase = "1"
RecursiveArrayTools = "2.36"
Reexport = "1"
SciMLBase = "1.90, 2"
SimpleUnPack = "1"
SpecialMatrices = "3"
StaticArrayInterface = "1.3"
Statistics = "1.6"
StructArrays = "0.4, 0.5, 0.6"
TaylorIntegration = "0.9, 0.10, 0.11, 0.12, 0.13, 0.14"
TaylorSeries = "0.12, 0.13, 0.14, 0.15"
Test = "1.6"
ToeplitzMatrices = "0.7, 0.8"
julia = "1.6"

[extras]
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[targets]
test = ["Test"]
7 changes: 6 additions & 1 deletion justfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,9 @@ benchmark:
julia --project=benchmarks -e 'include("benchmarks/runall.jl")'

vale:
git ls-files | xargs vale
git ls-files | xargs vale

test-lower-compat:
julia .just/downgrade.jl "Pkg,TOML" "v0"
julia --project=. -e "using ProbNumDiffEq"
git restore Project.toml
1 change: 0 additions & 1 deletion test/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ ODEProblemLibrary = "fdc4e326-1af4-4b90-96e7-779fcce2daa5"
OrdinaryDiffEq = "1dea7af3-3e70-54e6-95c3-0bf5283fa5ed"
ParameterizedFunctions = "65888b18-ceab-5e60-b2b9-181511a3b968"
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
ProbNumDiffEq = "bf3e78b0-7d74-48a5-b855-9609533b56a5"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
SafeTestsets = "1bc83da4-3b8d-516f-aca4-4fe02f6d838f"
SimpleUnPack = "ce78b400-467f-4804-87d8-8f486da07d0a"
Expand Down