Skip to content

Commit b90b54a

Browse files
authored
CI improvements (and cleaning) (#44)
* Add Aqua and other CI. Clean unused learning scripts. * Clean old format icn output * Spelling
1 parent aeecbec commit b90b54a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+509
-674
lines changed

.JuliaFormatter.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
style = "sciml"

.github/workflows/CompatHelper.yml

Lines changed: 32 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,43 @@
1-
name: CompatHelper
21
on:
32
schedule:
43
- cron: 0 0 * * *
54
workflow_dispatch:
5+
permissions:
6+
contents: write
7+
pull-requests: write
68
jobs:
79
CompatHelper:
810
runs-on: ubuntu-latest
911
steps:
10-
- name: Pkg.add("CompatHelper")
11-
run: julia -e 'using Pkg; Pkg.add("CompatHelper")'
12-
- name: CompatHelper.main()
12+
- name: Check if Julia is already available in the PATH
13+
id: julia_in_path
14+
run: which julia
15+
continue-on-error: true
16+
- name: Install Julia, but only if it is not already available in the PATH
17+
uses: julia-actions/setup-julia@v1
18+
with:
19+
version: "1"
20+
arch: ${{ runner.arch }}
21+
if: steps.julia_in_path.outcome != 'success'
22+
- name: "Add the General registry via Git"
23+
run: |
24+
import Pkg
25+
ENV["JULIA_PKG_SERVER"] = ""
26+
Pkg.Registry.add("General")
27+
shell: julia --color=yes {0}
28+
- name: "Install CompatHelper"
29+
run: |
30+
import Pkg
31+
name = "CompatHelper"
32+
uuid = "aa819f21-2bde-4658-8897-bab36330d9b7"
33+
version = "3"
34+
Pkg.add(; name, uuid, version)
35+
shell: julia --color=yes {0}
36+
- name: "Run CompatHelper"
37+
run: |
38+
import CompatHelper
39+
CompatHelper.main()
40+
shell: julia --color=yes {0}
1341
env:
1442
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1543
COMPATHELPER_PRIV: ${{ secrets.DOCUMENTER_KEY }}
16-
run: julia -e 'using CompatHelper; CompatHelper.main()'

.github/workflows/SpellCheck.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name: Spell Check
2+
3+
on: [pull_request]
4+
5+
jobs:
6+
typos-check:
7+
name: Spell Check with Typos
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Checkout Actions Repository
11+
uses: actions/checkout@v4
12+
- name: Check spelling
13+
uses: crate-ci/typos@v1.18.0

.github/workflows/TagBot.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,22 @@ on:
44
types:
55
- created
66
workflow_dispatch:
7+
inputs:
8+
lookback:
9+
default: "3"
10+
permissions:
11+
actions: read
12+
checks: read
13+
contents: write
14+
deployments: read
15+
issues: read
16+
discussions: read
17+
packages: read
18+
pages: read
19+
pull-requests: read
20+
repository-projects: read
21+
security-events: read
22+
statuses: read
723
jobs:
824
TagBot:
925
if: github.event_name == 'workflow_dispatch' || github.actor == 'JuliaTagBot'

.github/workflows/ci.yml

Lines changed: 79 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,81 @@
11
name: CI
22
on:
3-
- pull_request
3+
pull_request:
4+
branches:
5+
- main
6+
- dev
7+
paths-ignore:
8+
- "docs/**"
9+
push:
10+
branches:
11+
- main
12+
paths-ignore:
13+
- "docs/**"
414
jobs:
15+
formatter:
16+
runs-on: ${{ matrix.os }}
17+
strategy:
18+
matrix:
19+
julia-version: [1]
20+
julia-arch: [x86]
21+
os: [ubuntu-latest]
22+
steps:
23+
- uses: julia-actions/setup-julia@latest
24+
with:
25+
version: ${{ matrix.julia-version }}
26+
27+
- uses: actions/checkout@v4
28+
- name: Install JuliaFormatter and format
29+
# This will use the latest version by default but you can set the version like so:
30+
#
31+
# julia -e 'using Pkg; Pkg.add(PackageSpec(name="JuliaFormatter", version="0.13.0"))'
32+
run: |
33+
julia -e 'using Pkg; Pkg.add(PackageSpec(name="JuliaFormatter", version="1.0.50"))'
34+
julia -e 'using JuliaFormatter; format(".", verbose=true)'
35+
- name: Format check
36+
run: |
37+
julia -e '
38+
out = Cmd(`git diff`) |> read |> String
39+
if out == ""
40+
exit(0)
41+
else
42+
@error "Some files have not been formatted !!!"
43+
write(stdout, out)
44+
exit(1)
45+
end'
546
test:
647
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }}
748
runs-on: ${{ matrix.os }}
849
strategy:
950
fail-fast: false
1051
matrix:
1152
version:
12-
- "1.10"
13-
- 'nightly'
53+
- "1.8"
54+
- "1" # automatically expands to the latest stable 1.x release of Julia
55+
- nightly
1456
os:
1557
- ubuntu-latest
16-
- macOS-latest
17-
- windows-latest
1858
arch:
1959
- x64
2060
- x86
21-
exclude:
61+
include:
62+
# test macOS and Windows with latest Julia only
2263
- os: macOS-latest
23-
arch: x86
64+
arch: x64
65+
version: 1
66+
- os: windows-latest
67+
arch: x64
68+
version: 1
2469
- os: windows-latest
2570
arch: x86
71+
version: 1
2672
steps:
27-
- uses: actions/checkout@v3
73+
- uses: actions/checkout@v4
2874
- uses: julia-actions/setup-julia@v1
2975
with:
3076
version: ${{ matrix.version }}
3177
arch: ${{ matrix.arch }}
32-
- uses: actions/cache@v1
78+
- uses: actions/cache@v4
3379
env:
3480
cache-name: cache-artifacts
3581
with:
@@ -42,28 +88,29 @@ jobs:
4288
- uses: julia-actions/julia-buildpkg@v1
4389
- uses: julia-actions/julia-runtest@v1
4490
- uses: julia-actions/julia-processcoverage@v1
45-
- uses: codecov/codecov-action@v1
91+
- uses: codecov/codecov-action@v4
4692
with:
4793
file: lcov.info
48-
docs:
49-
name: Documentation
50-
runs-on: ubuntu-latest
51-
steps:
52-
- uses: actions/checkout@v3
53-
- uses: julia-actions/setup-julia@v1
54-
with:
55-
version: "1"
56-
- run: |
57-
julia --project=docs -e '
58-
using Pkg
59-
Pkg.develop(PackageSpec(path=pwd()))
60-
Pkg.instantiate()'
61-
- run: |
62-
julia --project=docs -e '
63-
using Documenter: doctest
64-
using Constraints
65-
doctest(Constraints)'
66-
- run: julia --project=docs docs/make.jl
67-
env:
68-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
69-
DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }}
94+
# docs:
95+
# name: Documentation
96+
# runs-on: ubuntu-latest
97+
# steps:
98+
# - uses: actions/checkout@v4
99+
# - uses: julia-actions/setup-julia@v1
100+
# with:
101+
# version: "1"
102+
# - run: |
103+
# julia --project=docs -e '
104+
# using Pkg
105+
# Pkg.develop(PackageSpec(path=pwd()))
106+
# Pkg.instantiate()'
107+
# - run: |
108+
# julia --project=docs -e '
109+
# using Documenter: DocMeta, doctest
110+
# using Constraints
111+
# DocMeta.setdocmeta!(Constraints, :DocTestSetup, :(using Constraints); recursive=true)
112+
# doctest(Constraints)'
113+
# - run: julia --project=docs docs/make.jl
114+
# env:
115+
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
116+
# DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }}

.github/workflows/register.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: Register Package
2+
on:
3+
workflow_dispatch:
4+
inputs:
5+
version:
6+
description: Version to register or component to bump
7+
required: true
8+
jobs:
9+
register:
10+
runs-on: ubuntu-latest
11+
permissions:
12+
contents: write
13+
steps:
14+
- uses: julia-actions/RegisterAction@latest
15+
with:
16+
token: ${{ secrets.GITHUB_TOKEN }}

Project.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ TestItems = "0.1"
2727
julia = "1.8"
2828

2929
[extras]
30+
Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"
3031
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
3132

3233
[targets]
33-
test = ["Test"]
34+
test = ["Aqua", "Test"]

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@
88

99
# Constraints.jl
1010

11-
A back-end pacage for JuliaConstraints front packages, such as `LocalSearchSolvers.jl`.
11+
A back-end package for JuliaConstraints front packages, such as `LocalSearchSolvers.jl`.
1212

1313
It provides the following features:
14-
- A dictionary to store usual constraint: `usual_contraint`, which contains the following entries
14+
- A dictionary to store usual constraint: `usual_constraint`, which contains the following entries
1515
- `:all_different`
1616
- `:dist_different`
1717
- `:eq`, `:all_equal`, `:all_equal_param`
@@ -23,7 +23,7 @@ It provides the following features:
2323
- error (a function that evaluate how much `c` is violated)
2424
- parameters length
2525
- known symmetries of `c`
26-
- A learning function using `CompositionalNetworks.jl`. If no error function is given when instanciating `c`, it will check the existence of a composition related to `c` and set the error to it.
26+
- A learning function using `CompositionalNetworks.jl`. If no error function is given when instantiating `c`, it will check the existence of a composition related to `c` and set the error to it.
2727

2828
## Contributing
2929

docs/Project.toml

Lines changed: 0 additions & 5 deletions
This file was deleted.

docs/make.jl

Lines changed: 0 additions & 33 deletions
This file was deleted.

docs/src/domain.md

Lines changed: 0 additions & 7 deletions
This file was deleted.

docs/src/icn.md

Lines changed: 0 additions & 58 deletions
This file was deleted.

0 commit comments

Comments
 (0)