Skip to content

Commit

Permalink
Improves CI/CD
Browse files Browse the repository at this point in the history
Improve Spell checking

Improve Spell checking 2

Improve Spell checking 3

Improve Spell checking 4

Improve Spell checking 5

Improve Spell checking 6

Improve Spell checking
  • Loading branch information
Azzaare committed Aug 13, 2024
1 parent b962ed4 commit 07fa957
Show file tree
Hide file tree
Showing 11 changed files with 328 additions and 95 deletions.
10 changes: 10 additions & 0 deletions .SpellCheck.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[default]
extend-ignore-identifiers-re = [
# Match any identifier that contains "OT"
".*OT.*"
]

[default.extend-identifiers]
# Explicitly accept "OT"
OT = "OT"
arrayNd = "arrayNd"
43 changes: 43 additions & 0 deletions .github/workflows/CompatHelper.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
on:
schedule:
- cron: 0 0 * * *
workflow_dispatch:
permissions:
contents: write
pull-requests: write
jobs:
CompatHelper:
runs-on: ubuntu-latest
steps:
- name: Check if Julia is already available in the PATH
id: julia_in_path
run: which julia
continue-on-error: true
- name: Install Julia, but only if it is not already available in the PATH
uses: julia-actions/setup-julia@v2
with:
version: "1"
arch: ${{ runner.arch }}
if: steps.julia_in_path.outcome != 'success'
- name: "Add the General registry via Git"
run: |
import Pkg
ENV["JULIA_PKG_SERVER"] = ""
Pkg.Registry.add("General")
shell: julia --color=yes {0}
- name: "Install CompatHelper"
run: |
import Pkg
name = "CompatHelper"
uuid = "aa819f21-2bde-4658-8897-bab36330d9b7"
version = "3"
Pkg.add(; name, uuid, version)
shell: julia --color=yes {0}
- name: "Run CompatHelper"
run: |
import CompatHelper
CompatHelper.main()
shell: julia --color=yes {0}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COMPATHELPER_PRIV: ${{ secrets.DOCUMENTER_KEY }}
4 changes: 2 additions & 2 deletions .github/workflows/Documenter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@latest
with:
version: '1.6'
version: '1'
- name: Install dependencies
run: julia --project=docs/ -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate()'
- name: Build and deploy
Expand Down
61 changes: 55 additions & 6 deletions .github/workflows/GitHubCI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,30 +3,79 @@ on:
pull_request:
branches:
- master
- dev
paths-ignore:
- "docs/**"
push:
branches:
- master
tags: '*'
paths-ignore:
- "docs/**"
jobs:
# formatter:
# runs-on: ${{ matrix.os }}
# strategy:
# matrix:
# julia-version: [1]
# julia-arch: [x86]
# os: [ubuntu-latest]
# steps:
# - uses: julia-actions/setup-julia@latest
# with:
# version: ${{ matrix.julia-version }}

# - uses: actions/checkout@v4
# - name: Install JuliaFormatter and format
# # This will use the latest version by default but you can set the version like so:
# #
# # julia -e 'using Pkg; Pkg.add(PackageSpec(name="JuliaFormatter", version="0.13.0"))'
# run: |
# julia -e 'using Pkg; Pkg.add(PackageSpec(name="JuliaFormatter", version="1.0.50"))'
# julia -e 'using JuliaFormatter; format(".", verbose=true)'
# - name: Format check
# run: |
# julia -e '
# out = Cmd(`git diff`) |> read |> String
# if out == ""
# exit(0)
# else
# @error "Some files have not been formatted !!!"
# write(stdout, out)
# exit(1)
# end'
test:
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
version:
- '1.6'
- 'lts'
- '1'
- 'pre'
os:
- ubuntu-latest
arch:
- x64
- x86
include:
# test macOS and Windows with latest Julia only
- os: macOS-latest
arch: x64
version: 1
- os: windows-latest
arch: x64
version: 1
- os: windows-latest
arch: x86
version: 1
steps:
- uses: actions/checkout@v2
- uses: julia-actions/setup-julia@v1
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v2
with:
version: ${{ matrix.version }}
arch: ${{ matrix.arch }}
- uses: actions/cache@v1
- uses: actions/cache@v4
env:
cache-name: cache-artifacts
with:
Expand All @@ -39,7 +88,7 @@ jobs:
- uses: julia-actions/julia-buildpkg@v1
- uses: julia-actions/julia-runtest@v1
- uses: julia-actions/julia-processcoverage@v1
- uses: codecov/codecov-action@v1
- uses: codecov/codecov-action@v4
with:
file: lcov.info
- uses: coverallsapp/github-action@master
Expand Down
15 changes: 15 additions & 0 deletions .github/workflows/SpellCheck.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Spell Check

on: [pull_request]

jobs:
typos-check:
name: Spell Check with Typos
runs-on: ubuntu-latest
steps:
- name: Checkout Actions Repository
uses: actions/checkout@v4
- name: Check spelling
uses: crate-ci/typos@master
with:
config: ./.SpellCheck.toml
18 changes: 17 additions & 1 deletion .github/workflows/TagBot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,22 @@ on:
types:
- created
workflow_dispatch:
inputs:
lookback:
default: "3"
permissions:
actions: read
checks: read
contents: write
deployments: read
issues: read
discussions: read
packages: read
pages: read
pull-requests: read
repository-projects: read
security-events: read
statuses: read
jobs:
TagBot:
if: github.event_name == 'workflow_dispatch' || github.actor == 'JuliaTagBot'
Expand All @@ -12,4 +28,4 @@ jobs:
- uses: JuliaRegistries/TagBot@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
ssh: ${{ secrets.DOCUMENTER_KEY }}
ssh: ${{ secrets.DOCUMENTER_KEY }}
16 changes: 16 additions & 0 deletions .github/workflows/register.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Register Package
on:
workflow_dispatch:
inputs:
version:
description: Version to register or component to bump
required: true
jobs:
register:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: julia-actions/RegisterAction@latest
with:
token: ${{ secrets.GITHUB_TOKEN }}
27 changes: 12 additions & 15 deletions docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,18 @@ using Documenter, ConstraintProgrammingExtensions

makedocs(
sitename="ConstraintProgrammingExtensions",
format = Documenter.HTML(
format=Documenter.HTML(
# See https://github.com/JuliaDocs/Documenter.jl/issues/868
prettyurls = get(ENV, "CI", nothing) == "true",
mathengine = Documenter.MathJax2(),
collapselevel = 1,
prettyurls=get(ENV, "CI", nothing) == "true",
mathengine=Documenter.MathJax2(),
collapselevel=1,
),
strict = true,
modules = [ConstraintProgrammingExtensions],
checkdocs = :exports,
pages = [
strict=true,
modules=[ConstraintProgrammingExtensions],
checkdocs=:exports,
pages=[
"Introduction" => "index.md",
"Reference" => [
"reference/sets.md",
"reference/bridges_sets.md",
],
"Reference" => ["reference/sets.md", "reference/bridges_sets.md"],
"Comparison to other CP packages" => [
"mappings/constraintsolver.md",
"mappings/cplexcp.md",
Expand All @@ -30,11 +27,11 @@ makedocs(
"mappings/numberjack.md",
"mappings/sas.md",
"mappings/yalmip.md",
]
],
],
)

deploydocs(
push_preview = true,
repo = "github.com/dourouc05/ConstraintProgrammingExtensions.jl.git",
push_preview=true,
repo="github.com/JuliaConstraints/ConstraintProgrammingExtensions.jl.git",
)
20 changes: 10 additions & 10 deletions docs/src/mappings/minizinc.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@

MiniZinc has a similar goal to this project: a common modelling interface for many underlying solvers. It is based on a similar concept to that of bridges, but with much less flexibility: each high-level constraint is mapped in a fixed way onto lower-level constraints.

* Basic CP constraints:
* Domain:
* Basic CP constraints:
* Domain:
* Fixed: `CP.Domain`
* Variable: `CP.Membership`
* Multivalued: `CP.VectorDomain`
* [`table`](https://github.com/MiniZinc/libminizinc/blob/master/share/minizinc/std/table.mzn): [one binary variable per possible combination](https://github.com/MiniZinc/libminizinc/blob/master/share/minizinc/linear/fzn_table_int.mzn)
* All different:
* All different:
* Base: `CP.AllDifferent`
* [`all_different`](https://github.com/MiniZinc/libminizinc/blob/master/share/minizinc/std/all_different.mzn): mapped onto [a MILP-like model](https://github.com/MiniZinc/libminizinc/blob/master/share/minizinc/std/fzn_all_different_int.mzn).
* [`all_different_reif`](https://github.com/MiniZinc/libminizinc/blob/master/share/minizinc/std/all_different.mzn): similar, [with an equivalence](https://github.com/MiniZinc/libminizinc/blob/master/share/minizinc/std/fzn_all_different_int_reif.mzn).
* These constraints are available in two includes: `all_different.mzn` and `alldifferent.mzn`.
* These constraints are available in two includes: `all_different.mzn` and `alldifferent.mzn`.
* All different except constants: `CP.AllDifferentExceptConstants`
* [`alldifferent_except_0`](https://github.com/MiniZinc/libminizinc/blob/master/share/minizinc/std/alldifferent_except_0.mzn) (one excluded value: 0) and [`alldifferent_except`](https://github.com/MiniZinc/libminizinc/blob/master/share/minizinc/std/alldifferent_except.mzn) (set of excluded values): either mapped [onto neq and disjunctions or onto GCC](https://github.com/MiniZinc/libminizinc/blob/master/share/minizinc/std/fzn_alldifferent_except.mzn).
* [`alldifferent_except_0`](https://github.com/MiniZinc/libminizinc/blob/master/share/minizinc/std/alldifferent_except_0.mzn) (one excluded value: 0) and [`alldifferent_except`](https://github.com/MiniZinc/libminizinc/blob/master/share/minizinc/std/alldifferent_except.mzn) (set of excluded values): either mapped [onto neq and disjunctions or onto GCC](https://github.com/MiniZinc/libminizinc/blob/master/share/minizinc/std/fzn_alldifferent_except.mzn).
* [`alldifferent_except_0_reif`](https://github.com/MiniZinc/libminizinc/blob/master/share/minizinc/std/alldifferent_except_0.mzn) (one excluded value: 0) and [`alldifferent_except_reif`](https://github.com/MiniZinc/libminizinc/blob/master/share/minizinc/std/alldifferent_except.mzn) (set of excluded values): the reified versions are only mapped [onto neq and disjunctions](https://github.com/MiniZinc/libminizinc/blob/master/share/minizinc/std/fzn_alldifferent_except_reif.mzn).
* With symmetry: `SymmetricAllDifferent`
* [`symmetric_all_different`](https://github.com/MiniZinc/libminizinc/blob/master/share/minizinc/std/symmetric_all_different.mzn): [`all_different` and `inverse`](https://github.com/MiniZinc/libminizinc/blob/master/share/minizinc/std/fzn_symmetric_all_different.mzn)
Expand All @@ -37,7 +37,7 @@ MiniZinc has a similar goal to this project: a common modelling interface for ma
* [`nvalue_fn`](https://github.com/MiniZinc/libminizinc/blob/master/share/minizinc/std/nvalue_fn.mzn): function.
* Inversion: `CP.Inverse`
* [`inverse`](https://github.com/MiniZinc/libminizinc/blob/master/share/minizinc/std/inverse.mzn): [index computations](https://github.com/MiniZinc/libminizinc/blob/master/share/minizinc/std/fzn_inverse.mzn).
* [`inverse_reif`](https://github.com/MiniZinc/libminizinc/blob/master/share/minizinc/std/inverse.mzn): similar, [wih an equivalence](https://github.com/MiniZinc/libminizinc/blob/master/share/minizinc/std/fzn_inverse_reif.mzn).
* [`inverse_reif`](https://github.com/MiniZinc/libminizinc/blob/master/share/minizinc/std/inverse.mzn): similar, [with an equivalence](https://github.com/MiniZinc/libminizinc/blob/master/share/minizinc/std/fzn_inverse_reif.mzn).
* Also available [as a function](https://github.com/MiniZinc/libminizinc/blob/master/share/minizinc/std/inverse_fn.mzn).
* [`inverse_in_range`](https://github.com/MiniZinc/libminizinc/blob/master/share/minizinc/std/inverse_in_range.mzn): [?](https://github.com/MiniZinc/libminizinc/blob/master/share/minizinc/std/fzn_inverse_in_range.mzn).
* Sliding sum: `CP.SlidingSum`
Expand All @@ -47,9 +47,9 @@ MiniZinc has a similar goal to this project: a common modelling interface for ma
* [`value_precede`](https://github.com/MiniZinc/libminizinc/blob/master/share/minizinc/std/value_precede.mzn): [several reifications)(https://github.com/MiniZinc/libminizinc/blob/master/share/minizinc/std/fzn_value_precede_int.mzn).
* [No reified variant)(https://github.com/MiniZinc/libminizinc/blob/master/share/minizinc/std/fzn_value_precede_int_reif.mzn).
* Combinatorial sets:
* Bin packing:
* Bin packing:
* Raw: `CP.BinPacking` (with supplementary load variables)
* [`bin_packing`](https://github.com/MiniZinc/libminizinc/blob/master/share/minizinc/std/bin_packing.mzn): mapped onto [a MILP-like model](https://github.com/MiniZinc/libminizinc/blob/master/share/minizinc/std/fzn_bin_packing.mzn), but without binary variables (replaced by their definition in the capacity constraint: `bin[item] == value`).
* [`bin_packing`](https://github.com/MiniZinc/libminizinc/blob/master/share/minizinc/std/bin_packing.mzn): mapped onto [a MILP-like model](https://github.com/MiniZinc/libminizinc/blob/master/share/minizinc/std/fzn_bin_packing.mzn), but without binary variables (replaced by their definition in the capacity constraint: `bin[item] == value`).
* [`bin_packing_reif`](https://github.com/MiniZinc/libminizinc/blob/master/share/minizinc/std/bin_packing.mzn): similar, [with an equivalence](https://github.com/MiniZinc/libminizinc/blob/master/share/minizinc/std/fzn_bin_packing_reif.mzn).
* Capacitated: `CP.FixedCapacityBinPacking` and `CP.VariableCapacityBinPacking` (with supplementary load variables)
* [`bin_packing_capa`](https://github.com/MiniZinc/libminizinc/blob/master/share/minizinc/std/bin_packing_capa.mzn): same MILP-like model [with a linear capacity constraint](https://github.com/MiniZinc/libminizinc/blob/master/share/minizinc/std/fzn_bin_packing_capa.mzn).
Expand All @@ -62,7 +62,7 @@ MiniZinc has a similar goal to this project: a common modelling interface for ma
* Knapsack: `CP.Knapsack` with values
* [`knapsack`](https://github.com/MiniZinc/libminizinc/blob/master/share/minizinc/std/knapsack.mzn): mapped onto [a MILP model](https://github.com/MiniZinc/libminizinc/blob/master/share/minizinc/std/fzn_knapsack.mzn).
* [`knapsack_reif`](https://github.com/MiniZinc/libminizinc/blob/master/share/minizinc/std/knapsack.mzn): similar, [with an equivalence](https://github.com/MiniZinc/libminizinc/blob/master/share/minizinc/std/fzn_knapsack_reif.mzn).
* Sorting:
* Sorting:
* Maximum/minimum: `CP.MaximumAmong` and `CP.MinimumAmong`
* [`maximum`](https://github.com/MiniZinc/libminizinc/blob/master/share/minizinc/std/maximum.mzn): built-in, [except for linear solvers](https://github.com/MiniZinc/libminizinc/blob/master/share/minizinc/linear/redefinitions.mzn)
* [`minimum`](https://github.com/MiniZinc/libminizinc/blob/master/share/minizinc/std/minimum.mzn): built-in, [except for linear solvers](https://github.com/MiniZinc/libminizinc/blob/master/share/minizinc/linear/redefinitions.mzn)
Expand Down Expand Up @@ -90,7 +90,7 @@ MiniZinc has a similar goal to this project: a common modelling interface for ma
* [`lex2`](https://github.com/MiniZinc/libminizinc/blob/master/share/minizinc/std/lex2.mzn): in a matrix, have both rows and columns lexicographically sorted, [mapped to two chains](https://github.com/MiniZinc/libminizinc/blob/master/share/minizinc/std/fzn_lex2.mzn).
* [`strict_lex2`](https://github.com/MiniZinc/libminizinc/blob/master/share/minizinc/std/strict_lex2.mzn): in a matrix, have both rows and columns strictly lexicographically sorted, [mapped to two chains](https://github.com/MiniZinc/libminizinc/blob/master/share/minizinc/std/fzn_strict_lex2.mzn).
* Reifications are available.
* Scheduling:
* Scheduling:
* Rectangle overlapping: `CP.NonOverlappingOrthotopes`
* [`diffn`](https://github.com/MiniZinc/libminizinc/blob/master/share/minizinc/std/diffn.mzn): [mapped to a disjunction of linear inequalities](https://github.com/MiniZinc/libminizinc/blob/master/share/minizinc/std/fzn_diffn.mzn).
* [`diffn_k`](https://github.com/MiniZinc/libminizinc/blob/master/share/minizinc/std/diffn.mzn): generalisation to `k` dimensions.
Expand Down
Loading

0 comments on commit 07fa957

Please sign in to comment.