diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml new file mode 100644 index 0000000..395fa01 --- /dev/null +++ b/.github/workflows/CI.yml @@ -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 \ No newline at end of file diff --git a/README.md b/README.md index f4d63c4..ae5d054 100644 --- a/README.md +++ b/README.md @@ -14,8 +14,10 @@
- + + +
The SCP Toolbox provides the tools necessary to define and solve diff --git a/test/examples/double_integrator/tests.jl b/test/examples/double_integrator/tests.jl index 0fda7f6..964d595 100644 --- a/test/examples/double_integrator/tests.jl +++ b/test/examples/double_integrator/tests.jl @@ -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 + println("PyPlot Issues") + end end end diff --git a/test/examples/freeflyer/tests.jl b/test/examples/freeflyer/tests.jl index 7766e48..87c96cd 100644 --- a/test/examples/freeflyer/tests.jl +++ b/test/examples/freeflyer/tests.jl @@ -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 + println("PyPlot Issues") + end return nothing end diff --git a/test/examples/oscillator/tests.jl b/test/examples/oscillator/tests.jl index 0736df0..4811930 100644 --- a/test/examples/oscillator/tests.jl +++ b/test/examples/oscillator/tests.jl @@ -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 + println("PyPlot Issues") + end return nothing end diff --git a/test/examples/quadrotor/tests.jl b/test/examples/quadrotor/tests.jl index 0847659..16100ad 100644 --- a/test/examples/quadrotor/tests.jl +++ b/test/examples/quadrotor/tests.jl @@ -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 + println("PyPlot Issues") + end return nothing end diff --git a/test/examples/rendezvous_3d/tests.jl b/test/examples/rendezvous_3d/tests.jl index 97baf6a..038992e 100644 --- a/test/examples/rendezvous_3d/tests.jl +++ b/test/examples/rendezvous_3d/tests.jl @@ -95,12 +95,17 @@ 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 + println("PyPlot Issues") + end + return sol, history end @@ -151,13 +156,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 + println("PyPlot Issues") + end return history_list end @@ -213,7 +222,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 + println("PyPlot Issues") + end return β_sweep, sol_list end diff --git a/test/examples/rendezvous_planar/tests.jl b/test/examples/rendezvous_planar/tests.jl index ccb9e1f..2a8f708 100644 --- a/test/examples/rendezvous_planar/tests.jl +++ b/test/examples/rendezvous_planar/tests.jl @@ -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 + println("PyPlot Issues") + end return nothing end diff --git a/test/examples/rocket_landing/tests.jl b/test/examples/rocket_landing/tests.jl index 48c3281..7b347a3 100644 --- a/test/examples/rocket_landing/tests.jl +++ b/test/examples/rocket_landing/tests.jl @@ -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 + println("PyPlot Issues") + end return nothing end diff --git a/test/examples/starship_flip/tests.jl b/test/examples/starship_flip/tests.jl index 467d552..2e01528 100644 --- a/test/examples/starship_flip/tests.jl +++ b/test/examples/starship_flip/tests.jl @@ -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 + println("PyPlot Issues") + end return nothing end