Skip to content

Fix testing setup #299

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

Merged
merged 11 commits into from
Jun 14, 2024
Merged
Show file tree
Hide file tree
Changes from 4 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
51 changes: 47 additions & 4 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,67 @@ name: CI
on:
pull_request:
branches:
- main
- master
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- master
- main

- 'release-'
paths-ignore:
- 'docs/**'
push:
branches:
- main
- master
paths-ignore:
- 'docs/**'

concurrency:
# Skip intermediate builds: always, but for the master branch.
# Cancel intermediate builds: always, but for the master branch.
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}

jobs:
formatter:
runs-on: ${{ matrix.os }}
strategy:
matrix:
julia-version: [1]
julia-arch: [x86]
os: [ubuntu-latest]
steps:
- uses: julia-actions/setup-julia@latest
with:
version: ${{ matrix.julia-version }}

- uses: actions/checkout@v4
- name: Install JuliaFormatter and format
# This will use the latest version by default but you can set the version like so:
#
# julia -e 'using Pkg; Pkg.add(PackageSpec(name="JuliaFormatter", version="0.13.0"))'
run: |
julia -e 'using Pkg; Pkg.add(PackageSpec(name="JuliaFormatter", version="1.0.50"))'
julia -e 'using JuliaFormatter; format(".", verbose=true)'
- name: Format check
run: |
julia -e '
out = Cmd(`git diff`) |> read |> String
if out == ""
exit(0)
else
@error "Some files have not been formatted !!!"
write(stdout, out)
exit(1)
end'
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
group:
- All
- QA
- Core
version:
- '1'
steps:
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v2
- uses: julia-actions/setup-julia@v1
with:
version: ${{ matrix.version }}
- uses: actions/cache@v4
Expand All @@ -36,6 +77,8 @@ jobs:
${{ runner.os }}-
- uses: julia-actions/julia-buildpkg@v1
- uses: julia-actions/julia-runtest@v1
env:
GROUP: ${{ matrix.group }}
- uses: julia-actions/julia-processcoverage@v1
- uses: codecov/codecov-action@v4
with:
Expand Down
2 changes: 1 addition & 1 deletion docs/pages.jl
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ pages = [
],
"About Acausal Connections" => [
"Theory" => "connectors/connections.md",
"Sign Convention" => "connectors/sign_convention.md",
"Sign Convention" => "connectors/sign_convention.md"
],
"API" => [
"Basic Blocks" => "API/blocks.md",
Expand Down
28 changes: 14 additions & 14 deletions src/Hydraulic/IsothermalCompressible/components.jl
Original file line number Diff line number Diff line change
Expand Up @@ -495,20 +495,20 @@ See also [`FixedVolume`](@ref), [`DynamicVolume`](@ref)
end

eqs = [
# connectors
port.p ~ p
port.dm ~ dm
flange.v * direction ~ dx
flange.f * direction ~ -f

# differentials
D(x) ~ dx
D(rho) ~ drho

# physics
rho ~ liquid_density(port, p)
f ~ p * area
dm ~ drho * x * area + rho * dx * area]
# connectors
port.p ~ p
port.dm ~ dm
flange.v * direction ~ dx
flange.f * direction ~ -f

# differentials
D(x) ~ dx
D(rho) ~ drho

# physics
rho ~ liquid_density(port, p)
f ~ p * area
dm ~ drho * x * area + rho * dx * area]

ODESystem(eqs, t, vars, pars; name, systems, defaults = [rho => liquid_density(port)])
end
Expand Down
File renamed without changes.
126 changes: 67 additions & 59 deletions test/runtests.jl
Original file line number Diff line number Diff line change
@@ -1,69 +1,77 @@
using SafeTestsets

@safetestset "Quality Assurance" begin
include("qa.jl")
end
const GROUP = get(ENV, "GROUP", "All")

# Blocks
@safetestset "Blocks: utils" begin
include("Blocks/utils.jl")
end
@safetestset "Blocks: math" begin
include("Blocks/math.jl")
end
@safetestset "Blocks: nonlinear" begin
include("Blocks/nonlinear.jl")
end
@safetestset "Blocks: continuous" begin
include("Blocks/continuous.jl")
end
@safetestset "Blocks: sources" begin
include("Blocks/sources.jl")
end
@safetestset "Blocks: analysis points" begin
include("Blocks/test_analysis_points.jl")
end
@time begin
if GROUP == "QA" || GROUP == "All"
@time @safetestset "Aqua" begin
include("aqua.jl")
end
end

# Electrical
@safetestset "Analog Circuits" begin
include("Electrical/analog.jl")
end
if GROUP == "Core" || GROUP == "All"
# Blocks
@safetestset "Blocks: utils" begin
include("Blocks/utils.jl")
end
@safetestset "Blocks: math" begin
include("Blocks/math.jl")
end
@safetestset "Blocks: nonlinear" begin
include("Blocks/nonlinear.jl")
end
@safetestset "Blocks: continuous" begin
include("Blocks/continuous.jl")
end
@safetestset "Blocks: sources" begin
include("Blocks/sources.jl")
end
@safetestset "Blocks: analysis points" begin
include("Blocks/test_analysis_points.jl")
end

@safetestset "Digital Circuits" begin
include("Electrical/digital.jl")
end
@safetestset "Chua Circuit Demo" begin
include("chua_circuit.jl")
end
# Electrical
@safetestset "Analog Circuits" begin
include("Electrical/analog.jl")
end

# Thermal
@safetestset "Thermal Circuits" begin
include("Thermal/thermal.jl")
end
@safetestset "Thermal Demo" begin
include("Thermal/demo.jl")
end
@safetestset "Digital Circuits" begin
include("Electrical/digital.jl")
end
@safetestset "Chua Circuit Demo" begin
include("chua_circuit.jl")
end

# Magnetic
@safetestset "Magnetic" begin
include("Magnetic/magnetic.jl")
end
# Thermal
@safetestset "Thermal Circuits" begin
include("Thermal/thermal.jl")
end
@safetestset "Thermal Demo" begin
include("Thermal/demo.jl")
end

# Mechanical
@safetestset "Mechanical Rotation" begin
include("Mechanical/rotational.jl")
end
@safetestset "Mechanical Translation" begin
include("Mechanical/translational.jl")
end
@safetestset "Mechanical Translation" begin
include("Mechanical/translational_modelica.jl")
end
@safetestset "Multi-Domain" begin
include("multi_domain.jl")
end
# Magnetic
@safetestset "Magnetic" begin
include("Magnetic/magnetic.jl")
end

# Mechanical
@safetestset "Mechanical Rotation" begin
include("Mechanical/rotational.jl")
end
@safetestset "Mechanical Translation" begin
include("Mechanical/translational.jl")
end
@safetestset "Mechanical Translation" begin
include("Mechanical/translational_modelica.jl")
end
@safetestset "Multi-Domain" begin
include("multi_domain.jl")
end

# Hydraulic
@safetestset "Hydraulic IsothermalCompressible" begin
include("Hydraulic/isothermal_compressible.jl")
# Hydraulic
@safetestset "Hydraulic IsothermalCompressible" begin
include("Hydraulic/isothermal_compressible.jl")
end
end
end
Loading