diff --git a/.JuliaFormatter.toml b/.JuliaFormatter.toml new file mode 100644 index 0000000..15fa654 --- /dev/null +++ b/.JuliaFormatter.toml @@ -0,0 +1,7 @@ +margin = 100 +indent = 2 +whitespace_typedefs = true +whitespace_ops_in_indices = true +remove_extra_newlines = true +annotate_untyped_fields_with_any = false +normalize_line_endings = "unix" \ No newline at end of file diff --git a/.github/workflows/Documentation.yml b/.github/workflows/Documentation.yml new file mode 100644 index 0000000..931a045 --- /dev/null +++ b/.github/workflows/Documentation.yml @@ -0,0 +1,23 @@ +name: Documentation +on: + push: + branches: + - master + tags: '*' + pull_request: + types: [opened, synchronize, reopened] +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: julia-actions/setup-julia@latest + with: + version: '1' + - name: Install dependencies + run: julia --project=docs -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate()' + - name: Build and deploy + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }} + run: julia --project=docs --color=yes docs/make.jl diff --git a/.github/workflows/TagBot.yml b/.github/workflows/TagBot.yml index e72d645..083baf9 100644 --- a/.github/workflows/TagBot.yml +++ b/.github/workflows/TagBot.yml @@ -1,13 +1,15 @@ -name: TagBot -on: - schedule: - - cron: 0 0 * * * - workflow_dispatch: -jobs: - TagBot: - runs-on: ubuntu-latest - steps: - - uses: JuliaRegistries/TagBot@v1 - with: - token: ${{ secrets.GITHUB_TOKEN }} - ssh: ${{ secrets.DOCUMENTER_KEY }} +name: TagBot +on: + issue_comment: + types: + - created + workflow_dispatch: +jobs: + TagBot: + if: github.event_name == 'workflow_dispatch' || github.actor == 'JuliaTagBot' + runs-on: ubuntu-latest + steps: + - uses: JuliaRegistries/TagBot@v1 + with: + token: ${{ secrets.GITHUB_TOKEN }} + ssh: ${{ secrets.DOCUMENTER_KEY }} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..ec74b25 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,54 @@ +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 }} + continue-on-error: ${{ matrix.allow_failure }} + strategy: + fail-fast: false + matrix: + version: ['1.3', '1'] + os: [ubuntu-latest, macOS-latest, windows-latest] + arch: [x64] + allow_failure: [false] + include: + - version: 'nightly' + os: ubuntu-latest + arch: x64 + allow_failure: true + - version: 'nightly' + os: macOS-latest + arch: x64 + allow_failure: true + - version: 'nightly' + os: windows-latest + arch: x64 + allow_failure: true + 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/.github/workflows/format_pr.yml b/.github/workflows/format_pr.yml new file mode 100644 index 0000000..60382f1 --- /dev/null +++ b/.github/workflows/format_pr.yml @@ -0,0 +1,32 @@ +# https://github.com/julia-actions/julia-format/blob/master/workflows/format_pr.yml +name: format-pr +on: + push: + branches: + - master + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Install JuliaFormatter and format + run: | + julia -e 'import Pkg; Pkg.add("JuliaFormatter")' + julia -e 'using JuliaFormatter; format(".")' + # https://github.com/marketplace/actions/create-pull-request + # https://github.com/peter-evans/create-pull-request#reference-example + - name: Create Pull Request + id: cpr + uses: peter-evans/create-pull-request@v3 + with: + token: ${{ secrets.GITHUB_TOKEN }} + commit-message: ":robot: Format .jl files" + title: '[AUTO] JuliaFormatter.jl run' + branch: auto-juliaformatter-pr + delete-branch: true + labels: formatting, automated pr, no changelog + - name: Check outputs + run: | + echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}" + echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}" \ No newline at end of file diff --git a/docs/Project.toml b/docs/Project.toml new file mode 100644 index 0000000..ed025f5 --- /dev/null +++ b/docs/Project.toml @@ -0,0 +1,5 @@ +[deps] +Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4" + +[compat] +Documenter = "~0.25" diff --git a/docs/make.jl b/docs/make.jl new file mode 100644 index 0000000..05cdf97 --- /dev/null +++ b/docs/make.jl @@ -0,0 +1,15 @@ +using Documenter, QuadraticModelsGurobi + +makedocs( + modules = [QuadraticModelsGurobi], + doctest = true, + # linkcheck = true, + strict = true, + format = Documenter.HTML(assets = ["assets/style.css"], prettyurls = get(ENV, "CI", nothing) == "true"), + sitename = "QuadraticModelsGurobi.jl", + pages = Any["Home" => "index.md", + "Tutorial" => "tutorial.md", + "Reference" => "reference.md"] +) + +deploydocs(repo = "github.com/JuliaSmoothOptimizers/QuadraticModelsGurobi.jl.git") diff --git a/docs/src/assets/logo.png b/docs/src/assets/logo.png new file mode 100644 index 0000000..f1947e9 Binary files /dev/null and b/docs/src/assets/logo.png differ diff --git a/docs/src/assets/style.css b/docs/src/assets/style.css new file mode 100644 index 0000000..7f1fab0 --- /dev/null +++ b/docs/src/assets/style.css @@ -0,0 +1,27 @@ +#documenter .docs-sidebar, +html.theme--documenter-dark #documenter .docs-sidebar { + border-right: 4px solid #640000; + background-color: #8c1515; + color: #fff; +} + +.mi, .mo, .mn { + color: #317293; +} + +a { + color: #3091d1; +} + +a:visited { + color: #3091d1; +} + +a:hover { + color: #ff5722; +} + +nav.toc .logo { + max-width: 256px; + max-height: 256px; +} \ No newline at end of file diff --git a/docs/src/index.md b/docs/src/index.md new file mode 100644 index 0000000..a0dd49f --- /dev/null +++ b/docs/src/index.md @@ -0,0 +1 @@ +# QuadraticModelsGurobi.jl \ No newline at end of file diff --git a/docs/src/reference.md b/docs/src/reference.md new file mode 100644 index 0000000..4bfb8b6 --- /dev/null +++ b/docs/src/reference.md @@ -0,0 +1,17 @@ +# Reference +​ +## Contents +​ +```@contents +Pages = ["reference.md"] +``` +​ +## Index +​ +```@index +Pages = ["reference.md"] +``` +​ +```@autodocs +Modules = [QuadraticModelsGurobi] +``` \ No newline at end of file diff --git a/docs/src/tutorial.md b/docs/src/tutorial.md new file mode 100644 index 0000000..c6dffa8 --- /dev/null +++ b/docs/src/tutorial.md @@ -0,0 +1 @@ +# QuadraticModelsGurobi.jl Tutorial \ No newline at end of file