Skip to content

Commit e7b5517

Browse files
committed
Fixing CI
1 parent 6b05e09 commit e7b5517

File tree

5 files changed

+160
-8
lines changed

5 files changed

+160
-8
lines changed

.github/workflows/ci.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,20 +17,20 @@ jobs:
1717
fail-fast: false
1818
matrix:
1919
version:
20-
- '1'
20+
- '1' # Leave this line unchanged. '1' will automatically expand to the latest stable 1.x release of Julia.
2121
os:
2222
- ubuntu-latest
23-
- macOS-latest
2423
- windows-latest
2524
arch:
2625
- x64
2726
steps:
28-
- uses: actions/checkout@v2
29-
- uses: julia-actions/setup-julia@v1
27+
- uses: actions/checkout@v4
28+
- uses: julia-actions/setup-julia@v2
3029
with:
3130
version: ${{ matrix.version }}
3231
arch: ${{ matrix.arch }}
33-
- uses: actions/cache@v1
32+
- uses: julia-actions/cache@v2
33+
- uses: actions/cache@v4
3434
env:
3535
cache-name: cache-artifacts
3636
with:
@@ -43,17 +43,17 @@ jobs:
4343
- uses: julia-actions/julia-buildpkg@v1
4444
- uses: julia-actions/julia-runtest@v1
4545
- uses: julia-actions/julia-processcoverage@v1
46-
- uses: codecov/codecov-action@v1
46+
- uses: codecov/codecov-action@v5
4747
with:
4848
file: lcov.info
4949
docs:
5050
name: Documentation
5151
runs-on: ubuntu-latest
5252
steps:
53-
- uses: actions/checkout@v2
53+
- uses: actions/checkout@v4
5454
- uses: julia-actions/setup-julia@v1
5555
with:
56-
version: '1.6'
56+
version: '1.10'
5757
- run: |
5858
julia --project=docs -e '
5959
using Pkg

.github/workflows/ci.yml.bak

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
name: CI
2+
on:
3+
pull_request:
4+
branches:
5+
- master
6+
- main
7+
push:
8+
branches:
9+
- master
10+
- main
11+
tags: '*'
12+
jobs:
13+
test:
14+
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }}
15+
runs-on: ${{ matrix.os }}
16+
strategy:
17+
fail-fast: false
18+
matrix:
19+
version:
20+
- '1.5' # Replace this with the minimum Julia version that your package supports. E.g. if your package requires Julia 1.5 or higher, change this to '1.5'.
21+
- '1.10'
22+
os:
23+
- ubuntu-latest
24+
- macOS-latest
25+
- windows-latest
26+
arch:
27+
- x64
28+
steps:
29+
- uses: actions/checkout@v2
30+
- uses: julia-actions/setup-julia@v1
31+
with:
32+
version: ${{ matrix.version }}
33+
arch: ${{ matrix.arch }}
34+
- uses: actions/cache@v1
35+
env:
36+
cache-name: cache-artifacts
37+
with:
38+
path: ~/.julia/artifacts
39+
key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }}
40+
restore-keys: |
41+
${{ runner.os }}-test-${{ env.cache-name }}-
42+
${{ runner.os }}-test-
43+
${{ runner.os }}-
44+
- uses: julia-actions/julia-buildpkg@v1
45+
- uses: julia-actions/julia-runtest@v1
46+
- uses: julia-actions/julia-processcoverage@v1
47+
- uses: codecov/codecov-action@v1
48+
with:
49+
file: lcov.info
50+
docs:
51+
name: Documentation
52+
runs-on: ubuntu-latest
53+
steps:
54+
- uses: actions/checkout@v2
55+
- uses: julia-actions/setup-julia@v1
56+
with:
57+
version: '1.6'
58+
- run: |
59+
julia --project=docs -e '
60+
using Pkg
61+
Pkg.develop(PackageSpec(path=pwd()))
62+
Pkg.instantiate()'
63+
- run: |
64+
julia --project=docs -e '
65+
using Documenter: doctest
66+
using FixedPointAcceleration
67+
doctest(FixedPointAcceleration)' # change MYPACKAGE to the name of your package
68+
- run: julia --project=docs docs/make.jl
69+
env:
70+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
71+
DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }}

.vscode/settings.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}

docs/src/6_api.md.bak

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
```@meta
2+
CurrentModule = FixedPointAcceleration
3+
```
4+
5+
# Function API
6+
7+
```@index
8+
Pages = ["api.md"]
9+
```
10+
11+
### Main fixed point seeking function
12+
13+
```@docs
14+
fixed_point
15+
fixed_point_new_input
16+
```
17+
18+
### Structs
19+
20+
```@docs
21+
FunctionEvaluationResult
22+
FixedPointResults
23+
```
24+
25+
### Internal Functions
26+
27+
```@docs
28+
put_together_without_jumps
29+
execute_function_safely
30+
```

test/SimpleVectorFunction.jl.bak

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
using Test
2+
@testset "Simple Vector Function" begin
3+
func(x) = [0.5*sqrt(abs(x[1] + x[2])), 1.5*x[1] + 0.5*x[2]]
4+
Inputs = [0.3,900.0]
5+
fp_simple = fixed_point(func, Inputs; Algorithm = :Simple)
6+
@test fp_simple.Convergence_ < 1e-10
7+
fp_anderson = fixed_point(func, Inputs; Algorithm = :Anderson)
8+
@test fp_anderson.Convergence_ < 1e-10
9+
fp_aitken = fixed_point(func, Inputs; Algorithm = :Aitken)
10+
@test fp_aitken.Convergence_ < 1e-10
11+
fp_newton = fixed_point(func, Inputs; Algorithm = :Newton)
12+
@test fp_newton.Convergence_ < 1e-10
13+
fp_VEA = fixed_point(func, Inputs; Algorithm = :VEA)
14+
@test fp_VEA.Convergence_ < 1e-10
15+
fp_SEA = fixed_point(func, Inputs; Algorithm = :SEA)
16+
@test fp_SEA.Convergence_ < 1e-10
17+
fp_MPE = fixed_point(func, Inputs; Algorithm = :MPE)
18+
@test fp_MPE.Convergence_ < 1e-10
19+
fp_RRE = fixed_point(func, Inputs; Algorithm = :RRE)
20+
@test fp_RRE.Convergence_ < 1e-10
21+
22+
# Now trying a function with a typeswitch from Int to Float
23+
Inputs = [1,4]
24+
fp_simple = fixed_point(func, Inputs; Algorithm = :Simple)
25+
@test fp_simple.Convergence_ < 1e-10
26+
fp_anderson = fixed_point(func, Inputs; Algorithm = :Anderson)
27+
@test fp_anderson.Convergence_ < 1e-10
28+
29+
# And finally printing a couple of them to test printing.
30+
fp_anderson2 = fixed_point(func, Inputs; Algorithm = :Anderson, PrintReports = true)
31+
@test fp_anderson2.Convergence_ < 1e-10
32+
fp_simple2 = fixed_point(func, Inputs; Algorithm = :Simple, PrintReports = true)
33+
@test fp_simple2.Convergence_ < 1e-10
34+
35+
# Testing function that returns a missing
36+
f(x) = [missing, missing]
37+
fp_simple3 = fixed_point(f, Inputs; Algorithm = :Simple, PrintReports = true)
38+
@test fp_simple3.TerminationCondition_ == :InvalidInputOrOutputOfIteration
39+
f(x) = [1, missing]
40+
fp_simple4 = fixed_point(f, Inputs; Algorithm = :Simple, PrintReports = true)
41+
@test fp_simple4.TerminationCondition_ == :InvalidInputOrOutputOfIteration
42+
43+
# Testing the outputting of a tuple
44+
f(x) = (a = [1.0, 1.0], b = :goodProgressInFunction)
45+
@test_throws ErrorException("This function returned a NamedTuple{(:a, :b),Tuple{Array{Float64,1},Symbol}}. The Fixedpoint function can only return a vector or a tuple of which the first entry is the vector for which a fixedpoint is sought and the second is a namedtuple (the contents of which are output for the user but are not used in fixed point acceleration).") fixed_point(f, Inputs; Algorithm = :Simple, PrintReports = true)
46+
# And doing side effects properly.
47+
f(x) = ([1.0, 1.0], (b = :goodProgressInFunction,))
48+
fp_simple5 = fixed_point(f, Inputs; Algorithm = :Simple, PrintReports = true)
49+
@test fp_simple5.Convergence_ < 1e-10
50+
end

0 commit comments

Comments
 (0)