diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..1120606 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,43 @@ +name: CI +on: + push: + branches: [master] + pull_request: + types: [opened, synchronize, reopened] +jobs: + test: + name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }} + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + version: ['1'] # Test against LTS + os: [ubuntu-latest, macOS-latest, windows-latest] + arch: [x64] + include: + # Also test against 32-bit Linux + - version: '1' + os: ubuntu-latest + arch: x86 + steps: + - uses: actions/checkout@v2 + - uses: julia-actions/setup-julia@v1 + with: + version: ${{ matrix.version }} + arch: ${{ matrix.arch }} + - uses: actions/cache@v1 + env: + cache-name: cache-artifacts + with: + path: ~/.julia/artifacts + key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }} + restore-keys: | + ${{ runner.os }}-test-${{ env.cache-name }}- + ${{ runner.os }}-test- + ${{ runner.os }}- + - uses: julia-actions/julia-buildpkg@v1 + - uses: julia-actions/julia-runtest@v1 + - uses: julia-actions/julia-processcoverage@v1 + - uses: codecov/codecov-action@v1 + with: + file: lcov.info diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 3cecd3a..0000000 --- a/.travis.yml +++ /dev/null @@ -1,12 +0,0 @@ -language: julia -codecov: true -os: - - linux -# - osx # Disable to speed up CI. PolyJuMP has no binary dependency so the - # result with osx and linux should be similar. - - osx -julia: - - 1.0 - - 1 -notifications: - email: false diff --git a/Project.toml b/Project.toml index 56a69ea..7e120ad 100644 --- a/Project.toml +++ b/Project.toml @@ -13,7 +13,7 @@ MultivariatePolynomials = "102ac46a-7ee4-5c85-9060-abc95bfdeaa3" SemialgebraicSets = "8e049039-38e8-557d-ae3a-bc521ccf6204" [compat] -JuMP = "0.21" +JuMP = "0.21.7" MathOptInterface = "~0.9.6" MultivariateBases = "0.1.2" MultivariateMoments = "0.3" diff --git a/README.md b/README.md index f5481fe..1433466 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ | **Build Status** | |:----------------:| -| [![Build Status][build-img]][build-url] [![Build Status][winbuild-img]][winbuild-url] | +| [![Build Status][build-img]][build-url] | | [![Codecov branch][codecov-img]][codecov-url] | PolyJuMP is an extension to [JuMP](https://github.com/jump-dev/JuMP.jl) for formulating and solving polynomial optimization problems. These problems can then be solved using [Sum of Squares Programming](https://github.com/jump-dev/SumOfSquares.jl). @@ -26,9 +26,7 @@ Some presentations on, or using, PolyJuMP (see [here](https://github.com/blegat/ [docs-stable-url]: https://jump.dev/SumOfSquares.jl/stable [docs-latest-url]: https://jump.dev/SumOfSquares.jl/latest -[build-img]: https://travis-ci.org/jump-dev/PolyJuMP.jl.svg?branch=master -[build-url]: https://travis-ci.org/jump-dev/PolyJuMP.jl -[winbuild-img]: https://ci.appveyor.com/api/projects/status/2y6dc0j2xk4aa4v7?svg=true -[winbuild-url]: https://ci.appveyor.com/project/JuliaOpt/polyjump-jl +[build-img]: https://github.com/jump-dev/PolyJuMP.jl/workflows/CI/badge.svg?branch=master +[build-url]: https://github.com/jump-dev/PolyJuMP.jl/actions?query=workflow%3ACI [codecov-img]: http://codecov.io/github/jump-dev/PolyJuMP.jl/coverage.svg?branch=master [codecov-url]: http://codecov.io/github/jump-dev/PolyJuMP.jl?branch=master diff --git a/appveyor.yml b/appveyor.yml deleted file mode 100644 index 67004b7..0000000 --- a/appveyor.yml +++ /dev/null @@ -1,36 +0,0 @@ -environment: - matrix: - - julia_version: 1 - - julia_version: 1.3 - - julia_version: 1.4 - -platform: - - x86 # 32-bit - - x64 # 64-bit - -# This is left as an example for the next big version switch. -#matrix: -# allow_failures: -# - julia_version: latest - -branches: - only: - - master - - /release-.*/ - -notifications: - - provider: Email - on_build_success: false - on_build_failure: false - on_build_status_changed: false - -install: - - ps: iex ((new-object net.webclient).DownloadString("https://raw.githubusercontent.com/JuliaCI/Appveyor.jl/version-1/bin/install.ps1")) - -build_script: - - echo "%JL_BUILD_SCRIPT%" - - C:\julia\bin\julia -e "%JL_BUILD_SCRIPT%" - -test_script: - - echo "%JL_TEST_SCRIPT%" - - C:\julia\bin\julia -e "%JL_TEST_SCRIPT%" diff --git a/test/constraint.jl b/test/constraint.jl index b5ea273..f5ac224 100644 --- a/test/constraint.jl +++ b/test/constraint.jl @@ -33,9 +33,9 @@ end expected_str = string(JuMP.function_string(REPLMode, p), ' ', JuMP._math_symbol(REPLMode, :in), ' ', jump_set) @test sprint(show, MIME"text/plain"(), cref) == expected_str - expected_str = string("\$ ", JuMP.function_string(IJuliaMode, p), ' ', + expected_str = string("\$\$ ", JuMP.function_string(IJuliaMode, p), ' ', JuMP._math_symbol(IJuliaMode, :in), ' ', jump_set, - " \$") + " \$\$") @test sprint(show, MIME"text/latex"(), cref) == expected_str @test set.basis == basis if !isempty(kwargs) @@ -71,14 +71,14 @@ end in_sym = JuMP._math_symbol(REPLMode, :in) eqref = @constraint(m, p == q) @test sprint(show, MIME"text/plain"(), eqref) == "(β - α)x² + (α - β)xy + (-α)y² $in_sym PolyJuMP.ZeroPoly()" - @test sprint(show, MIME"text/latex"(), eqref) == "\$ (β - α)x^{2} + (α - β)xy + (-α)y^{2} \\in PolyJuMP.ZeroPoly() \$" + @test sprint(show, MIME"text/latex"(), eqref) == "\$\$ (β - α)x^{2} + (α - β)xy + (-α)y^{2} \\in PolyJuMP.ZeroPoly() \$\$" sdref = @constraint(m, [p q; q p] in PSDCone()) if VERSION < v"1.4-" @test sprint(show, MIME"text/plain"(), sdref) == "[(β)x² + (α)xy (α)x² + (β)xy + (α)y²;\n (α)x² + (β)xy + (α)y² (β)x² + (α)xy ] $in_sym Main.TestPolyModule.TestPosDefMatrix()" else @test sprint(show, MIME"text/plain"(), sdref) == "[(β)x² + (α)xy (α)x² + (β)xy + (α)y²;\n (α)x² + (β)xy + (α)y² (β)x² + (α)xy] $in_sym Main.TestPolyModule.TestPosDefMatrix()" end - @test sprint(show, MIME"text/latex"(), sdref) == "\$ \\begin{bmatrix}\n(β)x^{2} + (α)xy & (α)x^{2} + (β)xy + (α)y^{2}\\\\\n(α)x^{2} + (β)xy + (α)y^{2} & (β)x^{2} + (α)xy\\\\\n\\end{bmatrix} \\in Main.TestPolyModule.TestPosDefMatrix() \$" + @test sprint(show, MIME"text/latex"(), sdref) == "\$\$ \\begin{bmatrix}\n(β)x^{2} + (α)xy & (α)x^{2} + (β)xy + (α)y^{2}\\\\\n(α)x^{2} + (β)xy + (α)y^{2} & (β)x^{2} + (α)xy\\\\\n\\end{bmatrix} \\in Main.TestPolyModule.TestPosDefMatrix() \$\$" end @testset "NonNeg" begin