Skip to content

Commit a0e7bf4

Browse files
committed
Add Aqua
1 parent 8da01d7 commit a0e7bf4

File tree

10 files changed

+172
-25
lines changed

10 files changed

+172
-25
lines changed

.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: 56 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,81 @@
11
name: CI
22
on:
3+
pull_request:
4+
branches:
5+
- main
6+
- dev
7+
paths-ignore:
8+
- "docs/**"
39
push:
410
branches:
511
- main
6-
tags: '*'
7-
pull_request:
8-
concurrency:
9-
# Skip intermediate builds: always.
10-
# Cancel intermediate builds: only if it is a pull request build.
11-
group: ${{ github.workflow }}-${{ github.ref }}
12-
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
12+
paths-ignore:
13+
- "docs/**"
1314
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'
1446
test:
1547
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }}
1648
runs-on: ${{ matrix.os }}
1749
strategy:
1850
fail-fast: false
1951
matrix:
2052
version:
21-
- '1.10'
22-
- 'nightly'
53+
- "1.8"
54+
- "1" # automatically expands to the latest stable 1.x release of Julia
55+
- nightly
2356
os:
2457
- ubuntu-latest
25-
- macOS-latest
26-
- windows-latest
2758
arch:
2859
- x64
2960
- x86
30-
exclude:
61+
include:
62+
# test macOS and Windows with latest Julia only
3163
- os: macOS-latest
32-
arch: x86
64+
arch: x64
65+
version: 1
66+
- os: windows-latest
67+
arch: x64
68+
version: 1
3369
- os: windows-latest
3470
arch: x86
71+
version: 1
3572
steps:
36-
- uses: actions/checkout@v3
73+
- uses: actions/checkout@v4
3774
- uses: julia-actions/setup-julia@v1
3875
with:
3976
version: ${{ matrix.version }}
4077
arch: ${{ matrix.arch }}
41-
- uses: actions/cache@v1
78+
- uses: actions/cache@v4
4279
env:
4380
cache-name: cache-artifacts
4481
with:
@@ -51,14 +88,14 @@ jobs:
5188
- uses: julia-actions/julia-buildpkg@v1
5289
- uses: julia-actions/julia-runtest@v1
5390
- uses: julia-actions/julia-processcoverage@v1
54-
- uses: codecov/codecov-action@v1
91+
- uses: codecov/codecov-action@v4
5592
with:
5693
file: lcov.info
5794
docs:
5895
name: Documentation
5996
runs-on: ubuntu-latest
6097
steps:
61-
- uses: actions/checkout@v3
98+
- uses: actions/checkout@v4
6299
- uses: julia-actions/setup-julia@v1
63100
with:
64101
version: "1"
@@ -69,8 +106,9 @@ jobs:
69106
Pkg.instantiate()'
70107
- run: |
71108
julia --project=docs -e '
72-
using Documenter: doctest
109+
using Documenter: DocMeta, doctest
73110
using ConstraintDomains
111+
DocMeta.setdocmeta!(ConstraintDomains, :DocTestSetup, :(using ConstraintDomains); recursive=true)
74112
doctest(ConstraintDomains)'
75113
- run: julia --project=docs docs/make.jl
76114
env:

.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 }}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
*.jl.cov
33
*.jl.mem
44
/docs/build/
5+
/docs/Manifest.toml
56

67
_git2_*
78
.gitignore

Project.toml

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

2525
[extras]
26+
Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"
2627
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
2728

2829
[targets]
29-
test = ["Test"]
30+
test = ["Aqua", "Test"]

test/Aqua.jl

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
@testset "Aqua.jl" begin
2+
import Aqua
3+
import ConstraintDomains
4+
import Dictionaries
5+
6+
# TODO: Fix the broken tests and remove the `broken = true` flag
7+
Aqua.test_all(
8+
ConstraintDomains;
9+
ambiguities = (broken = false,),
10+
deps_compat = false,
11+
piracies = (broken = false,),
12+
)
13+
14+
@testset "Ambiguities: ConstraintDomains" begin
15+
Aqua.test_ambiguities(ConstraintDomains;)
16+
end
17+
18+
@testset "Piracies: ConstraintDomains" begin
19+
Aqua.test_piracies(ConstraintDomains;)
20+
end
21+
22+
@testset "Dependencies compatibility (no extras)" begin
23+
Aqua.test_deps_compat(
24+
ConstraintDomains;
25+
check_extras = false, # ignore = [:Random]
26+
)
27+
end
28+
end

test/TestItemRunner.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
@testset "TestItemRunner" begin
2+
@run_package_tests
3+
end

test/runtests.jl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
using Test
12
using TestItemRunner
23

3-
@run_package_tests
4+
@testset "Package tests: ConstraintDomains" begin
5+
include("Aqua.jl")
6+
include("TestItemRunner.jl")
7+
end

0 commit comments

Comments
 (0)