Skip to content

Commit

Permalink
action-deps-version-bumps (#128)
Browse files Browse the repository at this point in the history
* action-deps-version-bumps

* formatted
  • Loading branch information
0815Creeper authored Sep 17, 2024
1 parent 8001d8b commit a030ebd
Show file tree
Hide file tree
Showing 15 changed files with 60 additions and 35 deletions.
9 changes: 9 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "monthly"
labels:
- "dependencies"
- "github-actions"
6 changes: 3 additions & 3 deletions .github/workflows/Eval.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,19 @@ jobs:
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Check out repository
uses: actions/checkout@v2
uses: actions/checkout@v4

# Set up Julia
- name: "Set up Julia"
uses: julia-actions/setup-julia@v1
uses: julia-actions/setup-julia@v2
with:
version: ${{ matrix.julia-version }}
arch: ${{ matrix.julia-arch }}
id: version

# Set up cache
- name: "Set up cache"
uses: actions/cache@v2
uses: actions/cache@v4
env:
cache-name: cache-artifacts
with:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/TestLTS.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,18 @@ jobs:
steps:
# Checks-out your repository
- name: Check out repository
uses: actions/checkout@v3
uses: actions/checkout@v4

# Set up Julia
- name: "Set up Julia"
uses: julia-actions/setup-julia@v1
uses: julia-actions/setup-julia@v2
with:
version: ${{ matrix.julia-version }}
arch: ${{ matrix.julia-arch }}

# Set up cache
- name: "Set up cache"
uses: actions/cache@v3
uses: actions/cache@v4
env:
cache-name: cache-artifacts
with:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/TestLatest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,18 @@ jobs:
steps:
# Checks-out your repository
- name: Check out repository
uses: actions/checkout@v3
uses: actions/checkout@v4

# Set up Julia
- name: "Set up Julia"
uses: julia-actions/setup-julia@v1
uses: julia-actions/setup-julia@v2
with:
version: ${{ matrix.julia-version }}
arch: ${{ matrix.julia-arch }}

# Set up cache
- name: "Set up cache"
uses: actions/cache@v3
uses: actions/cache@v4
env:
cache-name: cache-artifacts
with:
Expand Down
3 changes: 2 additions & 1 deletion src/FMI2/ext.jl
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,8 @@ function createFMU2(
directories =
[joinpath("binaries", "win64"), joinpath("binaries", "x86_64-windows")]
else
directories = [joinpath("binaries", "win32"), joinpath("binaries","x86-windows")]
directories =
[joinpath("binaries", "win32"), joinpath("binaries", "x86-windows")]
end
osStr = "Windows"
fmuExt = "dll"
Expand Down
2 changes: 1 addition & 1 deletion src/FMI2/md.jl
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,7 @@ end
# ToDo: Comment
function parseDerivatives(md::fmi2ModelDescription, nodes::EzXML.Node)
@assert (nodes.name == "Derivatives") "Wrong element name."

md.modelStructure.derivatives = []
for node in eachelement(nodes)
if node.name == "Unknown"
Expand Down
4 changes: 2 additions & 2 deletions src/FMI2/prep.jl
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ function prepareSolveFMU(

if instantiate || reset # autoInstantiated

if !setup
if !setup
@debug "[AUTO] setup"

fmi2SetupExperiment(c, t_start, t_stop; tolerance = tolerance)
Expand All @@ -199,7 +199,7 @@ function prepareSolveFMU(

handleEvents(c)
end

c.fmu.hasStateEvents = (c.fmu.modelDescription.numberOfEventIndicators > 0)
c.fmu.hasTimeEvents = isTrue(c.eventInfo.nextEventTimeDefined)
end
Expand Down
8 changes: 5 additions & 3 deletions src/FMI3/ext.jl
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,11 @@ function createFMU3(fmuPath, fmuZipPath; type::Union{Symbol,Nothing} = nothing)

if Sys.iswindows()
if juliaArch == 64
directories = [joinpath("binaries", "win64"), joinpath("binaries","x86_64-windows")]
else
directories = [joinpath("binaries", "win32"), joinpath("binaries","x86-windows")]
directories =
[joinpath("binaries", "win64"), joinpath("binaries", "x86_64-windows")]
else
directories =
[joinpath("binaries", "win32"), joinpath("binaries", "x86-windows")]
end
osStr = "Windows"
fmuExt = "dll"
Expand Down
2 changes: 1 addition & 1 deletion src/FMI3/prep.jl
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ function prepareSolveFMU(
if instantiate || reset # autoInstantiated
@debug "[AUTO] setup"

if !setup
if !setup
fmi3EnterInitializationMode(c, t_start, t_stop; tolerance = tolerance)
fmi3ExitInitializationMode(c)
end
Expand Down
2 changes: 1 addition & 1 deletion src/binary.jl
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ function loadFMU(
unpackPath::Union{String,Nothing} = nothing,
cleanup::Bool = true,
type::Union{Symbol,Nothing} = nothing,
kwargs...
kwargs...,
)

unzippedAbsPath, zipAbsPath =
Expand Down
2 changes: 1 addition & 1 deletion src/info.jl
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ function printValueReferences(fmu, vrs; max = 10)
println("\t\t$(vr) $(valueReferenceToString(fmu, vr))")
end
else
half = floor(Integer, max/2) - 1
half = floor(Integer, max / 2) - 1
for vr in vrs[1:half]
println("\t\t$(vr) $(valueReferenceToString(fmu, vr))")
end
Expand Down
27 changes: 16 additions & 11 deletions test/FMI2/getter_setter.jl
Original file line number Diff line number Diff line change
Expand Up @@ -83,23 +83,23 @@ tmp = Random.randstring(8)
rndString = [tmp, tmp]

cacheReal = fmi2Real.([0.0, 0.0])
cacheInteger = [fmi2Integer(0), fmi2Integer(0)]
cacheInteger = [fmi2Integer(0), fmi2Integer(0)]
cacheBoolean = [fmi2Boolean(false), fmi2Boolean(false)]
cacheString = [pointer(""), pointer("")]

@test fmi2SetReal(comp, realValueReferences, rndReal) == 0
if Sys.WORD_SIZE == 64
@test fmi2GetReal(comp, realValueReferences) == rndReal
@test fmi2GetReal(comp, realValueReferences) == rndReal
else
@info "not testing fmi2GetReal for arrays on 32-bit systems"
@info "not testing fmi2GetReal for arrays on 32-bit systems"
end
fmi2GetReal!(comp, realValueReferences, cacheReal)
@test cacheReal == rndReal
@test fmi2SetReal(comp, realValueReferences, -rndReal) == 0
if Sys.WORD_SIZE == 64
@test fmi2GetReal(comp, realValueReferences) == -rndReal
@test fmi2GetReal(comp, realValueReferences) == -rndReal
else
@info "not testing fmi2GetReal for arrays on 32-bit systems"
@info "not testing fmi2GetReal for arrays on 32-bit systems"
end
fmi2GetReal!(comp, realValueReferences, cacheReal)
@test cacheReal == -rndReal
Expand Down Expand Up @@ -131,18 +131,23 @@ fmi2GetString!(comp, stringValueReferences, cacheString)
# Testing input/output derivatives
dirs = fmi2GetRealOutputDerivatives(comp, ["y_real"], ones(fmi2Integer, 1))
if Sys.WORD_SIZE == 64
@test dirs == -Inf # at this point, derivative is undefined
@test dirs == -Inf # at this point, derivative is undefined
else
@test dirs == 0.0 # on 32-bit systems, this seems to be 0.0 (might be just a Dymola bug)
@test dirs == 0.0 # on 32-bit systems, this seems to be 0.0 (might be just a Dymola bug)
end
@test fmi2SetRealInputDerivatives(comp, ["u_real"], ones(fmi2Integer, 1), zeros(fmi2Real, 1)) == 0
@test fmi2SetRealInputDerivatives(
comp,
["u_real"],
ones(fmi2Integer, 1),
zeros(fmi2Real, 1),
) == 0

@test fmi2ExitInitializationMode(comp) == 0
if Sys.WORD_SIZE == 64
@test fmi2DoStep(comp, fmi2Real(0.1)) == 0
@test fmi2DoStep(comp, fmi2Real(0.1)) == 0
else
@info "not testing fmi2DoStep on 32-bit systems, because Dymola 32-Bit is probably broken"
end
@info "not testing fmi2DoStep on 32-bit systems, because Dymola 32-Bit is probably broken"
end

dirs = fmi2GetRealOutputDerivatives(comp, ["y_real"], ones(fmi2Integer, 1))
@test dirs == 0.0
Expand Down
14 changes: 11 additions & 3 deletions test/FMI2/model_description.jl
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,18 @@ info(myFMU) # check if there is an error thrown

@test length(getDerivativeNames(myFMU.modelDescription)) == 2
@test length(getDerivativeNames(myFMU)) == 2
@test getDerivativeNames(myFMU; mode=:first) == ["der(mass.s)", "mass.a_relfric"]
@test getDerivativeNames(myFMU; mode = :first) == ["der(mass.s)", "mass.a_relfric"]
# @test getDerivativeNames(myFMU; mode=:flat) == ["der(mass.s)", "mass.a_relfric", "mass.a", "der(mass.v)"]
@test issetequal(getDerivativeNames(myFMU; mode=:flat) ,["der(mass.s)", "mass.a_relfric", "mass.a", "der(mass.v)"])
@test all(issetequal.(getDerivativeNames(myFMU; mode=:group) ,[["der(mass.s)"], ["mass.a_relfric", "mass.a", "der(mass.v)"]]))
@test issetequal(
getDerivativeNames(myFMU; mode = :flat),
["der(mass.s)", "mass.a_relfric", "mass.a", "der(mass.v)"],
)
@test all(
issetequal.(
getDerivativeNames(myFMU; mode = :group),
[["der(mass.s)"], ["mass.a_relfric", "mass.a", "der(mass.v)"]],
),
)

@test length(getNamesAndDescriptions(myFMU.modelDescription)) == 50
@test length(getNamesAndDescriptions(myFMU)) == 50
Expand Down
2 changes: 1 addition & 1 deletion test/FMI3/getter_setter.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
###############

myFMU = loadFMU("Feedthrough", "ModelicaReferenceFMUs", "0.0.30", "3.0")
inst = fmi3InstantiateCoSimulation!(myFMU; loggingOn=false)
inst = fmi3InstantiateCoSimulation!(myFMU; loggingOn = false)
@test inst != 0

@test fmi3EnterInitializationMode(inst) == 0
Expand Down
2 changes: 1 addition & 1 deletion test/FMI3/state.jl
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import FMIImport.FMICore: fmi3FMUState

myFMU = loadFMU("BouncingBall", "ModelicaReferenceFMUs", "0.0.30", "3.0")
inst = fmi3InstantiateCoSimulation!(myFMU; loggingOn=true)
inst = fmi3InstantiateCoSimulation!(myFMU; loggingOn = true)
@test inst != 0

@test fmi3EnterInitializationMode(inst) == 0
Expand Down

0 comments on commit a030ebd

Please sign in to comment.