Skip to content

Commit 8a39ded

Browse files
Update CI and add Aqua tests (#47)
* Update CI and add Aqua tests * Update test/runtests.jl Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * Update CompatHelper.yml --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
1 parent c806c5b commit 8a39ded

10 files changed

Lines changed: 74 additions & 69 deletions

File tree

.github/dependabot.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
2+
version: 2
3+
updates:
4+
- package-ecosystem: "github-actions"
5+
directory: "/" # Location of package manifests
6+
schedule:
7+
interval: "monthly"

.github/workflows/CI.yml

Lines changed: 11 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,14 @@ name: CI
33
on:
44
push:
55
branches:
6-
# This is where pull requests from "bors r+" are built.
7-
- staging
8-
# This is where pull requests from "bors try" are built.
9-
- trying
10-
# Build default branch.
116
- main
7+
pull_request:
8+
9+
concurrency:
10+
# Skip intermediate builds: always.
11+
# Cancel intermediate builds: only if it is a pull request build.
12+
group: ${{ github.workflow }}-${{ github.ref }}
13+
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
1214

1315
jobs:
1416
test:
@@ -33,32 +35,23 @@ jobs:
3335
os: windows-latest
3436
arch: x64
3537
steps:
36-
- uses: actions/checkout@v2
38+
- uses: actions/checkout@v3
3739
- uses: julia-actions/setup-julia@v1
3840
with:
3941
version: ${{ matrix.version }}
4042
arch: ${{ matrix.arch }}
41-
- uses: actions/cache@v1
42-
env:
43-
cache-name: cache-artifacts
44-
with:
45-
path: ~/.julia/artifacts
46-
key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }}
47-
restore-keys: |
48-
${{ runner.os }}-test-${{ env.cache-name }}-
49-
${{ runner.os }}-test-
50-
${{ runner.os }}-
43+
- uses: julia-actions/cache@v1
5144
- uses: julia-actions/julia-buildpkg@v1
5245
- uses: julia-actions/julia-runtest@v1
5346
with:
5447
coverage: ${{ matrix.version == '1' && matrix.os == 'ubuntu-latest' }}
5548
- uses: julia-actions/julia-processcoverage@v1
5649
if: matrix.version == '1' && matrix.os == 'ubuntu-latest'
57-
- uses: codecov/codecov-action@v1
50+
- uses: codecov/codecov-action@v3
5851
if: matrix.version == '1' && matrix.os == 'ubuntu-latest'
5952
with:
6053
file: lcov.info
61-
- uses: coverallsapp/github-action@master
54+
- uses: coverallsapp/github-action@v2
6255
if: matrix.version == '1' && matrix.os == 'ubuntu-latest'
6356
with:
6457
github-token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/CompatHelper.yml

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,34 @@
11
name: CompatHelper
2+
23
on:
34
schedule:
4-
- cron: '00 00 * * *'
5+
- cron: 0 0 * * *
56
workflow_dispatch:
7+
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+
- uses: actions/checkout@v3
13+
- name: "Add the General registry via Git"
14+
run: |
15+
import Pkg
16+
ENV["JULIA_PKG_SERVER"] = ""
17+
Pkg.Registry.add("General")
18+
shell: julia --color=yes {0}
19+
- name: "Install CompatHelper"
20+
run: |
21+
import Pkg
22+
name = "CompatHelper"
23+
uuid = "aa819f21-2bde-4658-8897-bab36330d9b7"
24+
version = "3"
25+
Pkg.add(; name, uuid, version)
26+
shell: julia --color=yes {0}
27+
- name: "Run CompatHelper"
28+
run: |
29+
import CompatHelper
30+
CompatHelper.main()
31+
shell: julia --color=yes {0}
1332
env:
1433
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
15-
COMPATHELPER_PRIV: ${{ secrets.COMPATHELPER_PRIV }}
16-
run: julia -e 'using CompatHelper; CompatHelper.main(; subdirs = ["", "test"])'
34+
COMPATHELPER_PRIV: ${{ secrets.DOCUMENTER_KEY }}

.github/workflows/Format.yml

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,15 @@ name: Format
33
on:
44
push:
55
branches:
6-
# This is where pull requests from "bors r+" are built.
7-
- staging
8-
# This is where pull requests from "bors try" are built.
9-
- trying
10-
# Build the master branch.
116
- main
127
pull_request:
138

149
jobs:
1510
format:
1611
runs-on: ubuntu-latest
1712
steps:
18-
- uses: actions/checkout@v2
19-
- uses: julia-actions/setup-julia@latest
13+
- uses: actions/checkout@v3
14+
- uses: julia-actions/setup-julia@v1
2015
with:
2116
version: 1
2217
- name: Format code

Project.toml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,13 @@ Reexport = "1"
2424
StatsFuns = "0.8, 0.9, 1"
2525
StructArrays = "0.5, 0.6"
2626
julia = "1.3"
27+
28+
[extras]
29+
Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"
30+
Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f"
31+
StableRNGs = "860ef19b-820b-49d6-a774-d7a799459cd3"
32+
StatsBase = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91"
33+
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
34+
35+
[targets]
36+
test = ["Aqua", "Distributions", "StableRNGs", "StatsBase", "Test"]

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Hypothesis tests of calibration.
77
[![Codecov](https://codecov.io/gh/devmotion/CalibrationTests.jl/branch/main/graph/badge.svg)](https://codecov.io/gh/devmotion/CalibrationTests.jl)
88
[![Coveralls](https://coveralls.io/repos/github/devmotion/CalibrationTests.jl/badge.svg?branch=main)](https://coveralls.io/github/devmotion/CalibrationTests.jl?branch=main)
99
[![Code Style: Blue](https://img.shields.io/badge/code%20style-blue-4495d1.svg)](https://github.com/invenia/BlueStyle)
10-
[![Bors enabled](https://bors.tech/images/badge_small.svg)](https://app.bors.tech/repositories/24613)
10+
[![Aqua QA](https://raw.githubusercontent.com/JuliaTesting/Aqua.jl/master/badge.svg)](https://github.com/JuliaTesting/Aqua.jl)
1111

1212
**There are also [Python](https://github.com/devmotion/pycalibration) and [R](https://github.com/devmotion/rcalibration) interfaces for this package**
1313

bors.toml

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

test/Project.toml

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

test/aqua.jl

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
@testset "Aqua" begin
2+
# Test ambiguities separately without Base and Core
3+
# Ref: https://github.com/JuliaTesting/Aqua.jl/issues/77
4+
# Only test Project.toml formatting on Julia > 1.6 when running Github action
5+
# Ref: https://github.com/JuliaTesting/Aqua.jl/issues/105
6+
Aqua.test_all(
7+
CalibrationTests;
8+
ambiguities=false,
9+
project_toml_formatting=VERSION >= v"1.7" || !haskey(ENV, "GITHUB_ACTIONS"),
10+
)
11+
Aqua.test_ambiguities([CalibrationTests])
12+
end

test/runtests.jl

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using CalibrationTests
2+
using Aqua
23
using CalibrationErrors
34
using Distributions
45
using StableRNGs
@@ -11,6 +12,9 @@ using Test
1112
Random.seed!(1234)
1213

1314
@testset "CalibrationTests" begin
15+
@testset "General" begin
16+
include("aqua.jl")
17+
end
1418
@testset "Binary trend" begin
1519
include("binary_trend.jl")
1620
end
@@ -20,15 +24,9 @@ Random.seed!(1234)
2024
end
2125

2226
@testset "SKCE" begin
23-
@testset "Asymptotic" begin
24-
include("skce/asymptotic.jl")
25-
end
26-
@testset "Asymptotic block" begin
27-
include("skce/asymptotic_block.jl")
28-
end
29-
@testset "Distribution-free" begin
30-
include("skce/distribution_free.jl")
31-
end
27+
include("skce/asymptotic.jl")
28+
include("skce/asymptotic_block.jl")
29+
include("skce/distribution_free.jl")
3230
end
3331

3432
@testset "Asymptotic CME" begin

0 commit comments

Comments
 (0)