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 #16

Merged
merged 1 commit into from
Aug 7, 2023
Merged
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
21 changes: 21 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: CI
on: [push, pull_request]
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
julia-version: ['1.7']
julia-arch: [x64]
os: [ubuntu-latest] # [ubuntu-latest, windows-latest, macOS-latest]
steps:
- name: Get Dependancies
run: pip install matplotlib
- uses: actions/checkout@v3
- uses: julia-actions/setup-julia@latest
with:
version: ${{ matrix.julia-version }}
- uses: julia-actions/julia-buildpkg@latest
- uses: julia-actions/julia-runtest@latest
- uses: julia-actions/julia-processcoverage@v1
- uses: codecov/codecov-action@v3
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@

<p align="center">
<a href="http://www.gnu.org/licenses/gpl-3.0.txt"><img src="https://img.shields.io/badge/license-GPL_3-green.svg" alt="License GPL 3" /></a>
&ensp;&ensp;
<a href="https://mybinder.org/v2/gh/UW-ACL/SCPToolbox_tutorial/master?labpath=tutorial%2Fsrc%2Fp1_clp.ipynb"><img src="https://mybinder.org/badge_logo.svg" alt="Launch Binder" /></a>
<a href="https://github.com//UW-ACL/SCPToolbox.jl/actions/workflows/CI.yml/badge.svg"><img src="https://github.com//UW-ACL/SCPToolbox.jl/actions/workflows/CI.yml/badge.svg"/></a>
<a href="https://codecov.io/gh/UW-ACL/SCPToolbox.jl" >
<img src="https://codecov.io/gh/UW-ACL/SCPToolbox.jl/branch/master/graph/badge.svg?token=UI74DSQCLL"/> </a>
</p>

The <b>SCP Toolbox</b> provides the tools necessary to define and solve
Expand Down
6 changes: 5 additions & 1 deletion test/examples/double_integrator/tests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,11 @@ function lcvx()::Nothing
@test true

if !tests_failed
plot_trajectory(sol_lcvx, sol_mp, param_choice)
try
plot_trajectory(sol_lcvx, sol_mp, param_choice)
catch e
showerror(stdout, e)
end
govindchari marked this conversation as resolved.
Show resolved Hide resolved
end
end

Expand Down
14 changes: 9 additions & 5 deletions test/examples/freeflyer/tests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -192,11 +192,15 @@ function run_trials(
history = history_list[end]

# Make plots
plot_trajectory_history(mdl, history)
plot_final_trajectory(mdl, sol)
plot_timeseries(mdl, sol)
plot_obstacle_constraints(mdl, sol)
plot_convergence(history_list, "freeflyer")
try
plot_trajectory_history(mdl, history)
plot_final_trajectory(mdl, sol)
plot_timeseries(mdl, sol)
plot_obstacle_constraints(mdl, sol)
plot_convergence(history_list, "freeflyer")
catch e
showerror(stdout, e)
end

return nothing
end
10 changes: 7 additions & 3 deletions test/examples/oscillator/tests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,13 @@ function ptr()::Nothing
@test sol.status == @sprintf("%s", SCP_SOLVED)

# Make plots
plot_timeseries(mdl, sol, history)
plot_deadband(mdl, sol)
plot_convergence(history, "oscillator")
try
plot_timeseries(mdl, sol, history)
plot_deadband(mdl, sol)
plot_convergence(history, "oscillator")
catch e
showerror(stdout, e)
end

return nothing
end
14 changes: 9 additions & 5 deletions test/examples/quadrotor/tests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -188,11 +188,15 @@ function run_trials(
history = history_list[end]

# Make plots
plot_trajectory_history(mdl, history)
plot_final_trajectory(mdl, sol)
plot_input_norm(mdl, sol)
plot_tilt_angle(mdl, sol)
plot_convergence(history_list, "quadrotor")
try
plot_trajectory_history(mdl, history)
plot_final_trajectory(mdl, sol)
plot_input_norm(mdl, sol)
plot_tilt_angle(mdl, sol)
plot_convergence(history_list, "quadrotor")
catch e
showerror(stdout, e)
end

return nothing
end
40 changes: 26 additions & 14 deletions test/examples/rendezvous_3d/tests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -95,12 +95,16 @@ function test_single(
@test sol.status == @sprintf("%s", SCP_SOLVED)

# Make plots
plot_trajectory_2d(mdl, sol)
plot_trajectory_2d(mdl, sol; attitude = true)
plot_state_timeseries(mdl, sol)
plot_inputs(mdl, sol, history)
plot_inputs(mdl, sol, history; quad = "D")
plot_cost_evolution(mdl, history)
try
plot_trajectory_2d(mdl, sol)
plot_trajectory_2d(mdl, sol; attitude = true)
plot_state_timeseries(mdl, sol)
plot_inputs(mdl, sol, history)
plot_inputs(mdl, sol, history; quad = "D")
plot_cost_evolution(mdl, history)
catch e
showerror(stdout, e)
end

return sol, history
end
Expand Down Expand Up @@ -151,13 +155,17 @@ function test_runtime(
@test sol.status == @sprintf("%s", SCP_SOLVED)
end

plot_convergence(
history_list,
"rendezvous_3d",
options = fig_opts,
xlabel = "\$\\ell\$",
horizontal = true,
)
try
plot_convergence(
history_list,
"rendezvous_3d",
options = fig_opts,
xlabel = "\$\\ell\$",
horizontal = true,
)
catch e
showerror(stdout, e)
end

return history_list
end
Expand Down Expand Up @@ -213,7 +221,11 @@ function test_homotopy_update(
@test sol_list[i].status == @sprintf("%s", SCP_SOLVED)
end

plot_homotopy_threshold_sweep(mdl, β_sweep, sol_list)
try
plot_homotopy_threshold_sweep(mdl, β_sweep, sol_list)
catch e
showerror(stdout, e)
end

return β_sweep, sol_list
end
Expand Down
12 changes: 8 additions & 4 deletions test/examples/rendezvous_planar/tests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,14 @@ function ptr()::Nothing
@test sol.status == @sprintf("%s", SCP_SOLVED)

# Make plots
plot_final_trajectory(mdl, sol)
plot_attitude(mdl, sol)
plot_thrusts(mdl, sol)
plot_convergence(history, "rendezvous_planar")
try
plot_final_trajectory(mdl, sol)
plot_attitude(mdl, sol)
plot_thrusts(mdl, sol)
plot_convergence(history, "rendezvous_planar")
catch e
showerror(stdout, e)
end

return nothing
end
14 changes: 9 additions & 5 deletions test/examples/rocket_landing/tests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,15 @@ function lcvx()::Nothing
sim = simulate(rocket, pdg)

# Make plots
plot_thrust(rocket, pdg, sim)
plot_mass(rocket, pdg, sim)
plot_pointing_angle(rocket, pdg, sim)
plot_velocity(rocket, pdg, sim)
plot_position(rocket, pdg, sim)
try
plot_thrust(rocket, pdg, sim)
plot_mass(rocket, pdg, sim)
plot_pointing_angle(rocket, pdg, sim)
plot_velocity(rocket, pdg, sim)
plot_position(rocket, pdg, sim)
catch e
showerror(stdout, e)
end

return nothing
end
14 changes: 9 additions & 5 deletions test/examples/starship_flip/tests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -151,11 +151,15 @@ function test_single(
@test sol.status == @sprintf("%s", SCP_SOLVED)

# Make plots
plot_trajectory_history(mdl, history)
plot_final_trajectory(mdl, sol)
plot_velocity(mdl, sol)
plot_thrust(mdl, sol)
plot_gimbal(mdl, sol)
try
plot_trajectory_history(mdl, history)
plot_final_trajectory(mdl, sol)
plot_velocity(mdl, sol)
plot_thrust(mdl, sol)
plot_gimbal(mdl, sol)
catch e
showerror(stdout, e)
end

return nothing
end