From d27d8c8f6a4a34c151ae111b54c8dad6fbf9eaf1 Mon Sep 17 00:00:00 2001 From: govindchari Date: Sun, 6 Aug 2023 16:37:06 -0700 Subject: [PATCH] Add CI --- .github/workflows/CI.yml | 19 +++++++++++++ test/examples/rendezvous_3d/tests.jl | 41 ++++++++++++++++++---------- 2 files changed, 46 insertions(+), 14 deletions(-) create mode 100644 .github/workflows/CI.yml diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml new file mode 100644 index 0000000..c5feb2d --- /dev/null +++ b/.github/workflows/CI.yml @@ -0,0 +1,19 @@ +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: + - 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/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