Skip to content

Commit 3f1d614

Browse files
authored
ci: standardise workflows using SciML's reusable workflows (#170)
* ci: update invalidations workflow to use centralised reusable workflow * ci: update format check workflow to use centralised reusable workflow * ci: update tests workflow to use centralised reusable workflow * test: fix depwarns * ci(Tests): run test with depwarn set to `yes` All the deprecations in the package itself have been appropriately fixed up. However, currently, tests fail when `depwarn` is set to error because of a transitive dependency's depwarn, which is not directly influenced by the package's primitives itself. ```julia WARNING: using deprecated binding Colors.RGB1 in PlotUtils. , use XRGB instead. PlotUtils.RGB1 is deprecated, use ColorTypes.XRGB{T} where T<:Union{AbstractFloat, FixedPointNumbers.FixedPoint{T, f} where f where T<:Integer} instead. WARNING: using deprecated binding Colors.RGB4 in PlotUtils. , use RGBX instead. PlotUtils.RGB4 is deprecated, use ColorTypes.RGBX{T} where T<:Union{AbstractFloat, FixedPointNumbers.FixedPoint{T, f} where f where T<:Integer} instead. ``` Thus, set `depwarn` to just `yes` while runnning the julia tests, so that CI can pass.
1 parent 69bbaf3 commit 3f1d614

File tree

5 files changed

+38
-169
lines changed

5 files changed

+38
-169
lines changed

.github/workflows/CI.yml

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

.github/workflows/FormatCheck.yml

Lines changed: 4 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: format-check
1+
name: "Format Check"
22

33
on:
44
push:
@@ -8,37 +8,6 @@ on:
88
pull_request:
99

1010
jobs:
11-
build:
12-
runs-on: ${{ matrix.os }}
13-
strategy:
14-
matrix:
15-
julia-version: [1]
16-
julia-arch: [x86]
17-
os: [ubuntu-latest]
18-
steps:
19-
- uses: julia-actions/setup-julia@latest
20-
with:
21-
version: ${{ matrix.julia-version }}
22-
23-
- uses: actions/checkout@v4
24-
- name: Install JuliaFormatter and format
25-
# This will use the latest version by default but you can set the version like so:
26-
#
27-
# julia -e 'using Pkg; Pkg.add(PackageSpec(name="JuliaFormatter", version="0.13.0"))'
28-
#
29-
# The last version before the SciML style changed significantly is
30-
# julia -e 'using Pkg; Pkg.add(PackageSpec(name = "JuliaFormatter", version = v"1.0.32"))'
31-
run: |
32-
julia -e 'using Pkg; Pkg.add(PackageSpec(name = "JuliaFormatter", version="1.0.45"))'
33-
julia -e 'using JuliaFormatter; format(".", verbose = true)'
34-
- name: Format check
35-
run: |
36-
julia -e '
37-
out = Cmd(`git diff --name-only`) |> read |> String
38-
if out == ""
39-
exit(0)
40-
else
41-
@error "Some files have not been formatted !!!"
42-
write(stdout, out)
43-
exit(1)
44-
end'
11+
format-check:
12+
name: "Format Check"
13+
uses: "SciML/.github/.github/workflows/format-check.yml@v1"
Lines changed: 4 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Invalidations
1+
name: "Invalidations"
22

33
on:
44
pull_request:
@@ -10,31 +10,6 @@ concurrency:
1010
cancel-in-progress: true
1111

1212
jobs:
13-
evaluate:
14-
# Only run on PRs to the default branch.
15-
# In the PR trigger above branches can be specified only explicitly whereas this check should work for master, main, or any other default branch
16-
if: github.base_ref == github.event.repository.default_branch
17-
runs-on: ubuntu-latest
18-
steps:
19-
- uses: julia-actions/setup-julia@v2
20-
with:
21-
version: '1'
22-
- uses: actions/checkout@v4
23-
- uses: julia-actions/julia-buildpkg@v1
24-
- uses: julia-actions/julia-invalidations@v1
25-
id: invs_pr
26-
27-
- uses: actions/checkout@v4
28-
with:
29-
ref: ${{ github.event.repository.default_branch }}
30-
- uses: julia-actions/julia-buildpkg@v1
31-
- uses: julia-actions/julia-invalidations@v1
32-
id: invs_default
33-
34-
- name: Report invalidation counts
35-
run: |
36-
echo "Invalidations on default branch: ${{ steps.invs_default.outputs.total }} (${{ steps.invs_default.outputs.deps }} via deps)" >> $GITHUB_STEP_SUMMARY
37-
echo "This branch: ${{ steps.invs_pr.outputs.total }} (${{ steps.invs_pr.outputs.deps }} via deps)" >> $GITHUB_STEP_SUMMARY
38-
- name: Check if the PR does increase number of invalidations
39-
if: steps.invs_pr.outputs.total > steps.invs_default.outputs.total
40-
run: exit 1
13+
evaluate-invalidations:
14+
name: "Evaluate Invalidations"
15+
uses: "SciML/.github/.github/workflows/invalidations.yml@v1"

.github/workflows/Tests.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: "Tests"
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
push:
8+
branches:
9+
- main
10+
11+
concurrency:
12+
group: ${{ github.workflow }}-${{ github.ref }}
13+
cancel-in-progress: ${{ github.ref_name != github.event.repository.default_branch || github.ref != 'refs/tags/v*' }}
14+
15+
jobs:
16+
tests:
17+
name: "Tests"
18+
strategy:
19+
fail-fast: false
20+
matrix:
21+
version:
22+
- "1"
23+
- "1.6"
24+
uses: "SciML/.github/.github/workflows/tests.yml@v1"
25+
with:
26+
julia-version: "${{ matrix.version }}"
27+
julia-runtest-depwarn: "yes"
28+
secrets: "inherit"

test/runtests.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1594,8 +1594,8 @@ using Aqua: Aqua
15941594
let order = 4
15951595
for t in RootedTreeIterator(order)
15961596
@test elementary_weight(t, rk.A, rk.b, rk.c) elementary_weight(t, rk)
1597-
@test derivative_weight(t, rk.A, rk.b, rk.c) derivative_weight(t, rk)
1598-
@test residual_order_condition(t, rk.A, rk.b, rk.c)
1597+
@test derivative_weight(t, RungeKuttaMethod(rk.A, rk.b, rk.c)) derivative_weight(t, rk)
1598+
@test residual_order_condition(t, RungeKuttaMethod(rk.A, rk.b, rk.c))
15991599
residual_order_condition(t, rk)
16001600
end
16011601
end

0 commit comments

Comments
 (0)