Skip to content

Commit 918ee95

Browse files
authored
Merge pull request #87 from JuliaStats/dw/ci
Update CI setup, add dependabot, and update Julia compat to 1.10
2 parents 76a23a7 + 9e38229 commit 918ee95

File tree

6 files changed

+32
-40
lines changed

6 files changed

+32
-40
lines changed

.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: 19 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
# from https://discourse.julialang.org/t/easy-workflow-file-for-setting-up-github-actions-ci-for-your-julia-package/49765
2-
31
name: CI
2+
43
on:
54
pull_request:
65
branches:
@@ -9,49 +8,45 @@ on:
98
branches:
109
- master
1110
tags: '*'
11+
12+
# needed to allow julia-actions/cache to delete old caches that it has created
13+
permissions:
14+
actions: write
15+
contents: read
16+
1217
jobs:
1318
test:
14-
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }}
19+
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ github.event_name }}
1520
runs-on: ${{ matrix.os }}
1621
strategy:
1722
fail-fast: false
1823
matrix:
1924
version:
20-
- '1.0' # 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' # Leave this line unchanged. '1' will automatically expand to the latest stable 1.x release of Julia.
22-
- 'nightly'
25+
- 'min'
26+
- '1'
27+
- 'pre'
2328
os:
2429
- ubuntu-latest
25-
arch:
26-
- x64
2730
steps:
28-
- uses: actions/checkout@v2
29-
- uses: julia-actions/setup-julia@v1
31+
- uses: actions/checkout@v4
32+
- uses: julia-actions/setup-julia@v2
3033
with:
3134
version: ${{ matrix.version }}
32-
arch: ${{ matrix.arch }}
33-
- uses: actions/cache@v1
34-
env:
35-
cache-name: cache-artifacts
36-
with:
37-
path: ~/.julia/artifacts
38-
key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }}
39-
restore-keys: |
40-
${{ runner.os }}-test-${{ env.cache-name }}-
41-
${{ runner.os }}-test-
42-
${{ runner.os }}-
35+
- uses: julia-actions/cache@v2
4336
- uses: julia-actions/julia-buildpkg@v1
4437
- uses: julia-actions/julia-runtest@v1
4538
- uses: julia-actions/julia-processcoverage@v1
46-
- uses: codecov/codecov-action@v1
39+
- uses: codecov/codecov-action@v5
4740
with:
48-
file: lcov.info
41+
files: lcov.info
42+
token: ${{ secrets.CODECOV_TOKEN }}
43+
fail_ci_if_error: true
4944
docs:
5045
name: Documentation
5146
runs-on: ubuntu-latest
5247
steps:
5348
- uses: actions/checkout@v2
54-
- uses: julia-actions/setup-julia@v1
49+
- uses: julia-actions/setup-julia@v2
5550
with:
5651
version: '1'
5752
- run: |

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ ChangesOfVariables = "0.1"
2727
DocStringExtensions = "0.8, 0.9"
2828
InverseFunctions = "0.1"
2929
IrrationalConstants = "0.1, 0.2"
30-
julia = "1"
30+
julia = "1.10"
3131

3232
[extras]
3333
ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4"

src/LogExpFunctions.jl

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,6 @@ export xlogx, xlogy, xlog1py, xexpx, xexpy, logistic, logit, log1psq, log1pexp,
1111
softmax!, logcosh, logabssinh, cloglog, cexpexp,
1212
loglogistic, logitexp, log1mlogistic, logit1mexp
1313

14-
# expm1(::Float16) is not defined in older Julia versions,
15-
# hence for better Float16 support we use an internal function instead
16-
# https://github.com/JuliaLang/julia/pull/40867
17-
if VERSION < v"1.7.0-DEV.1172"
18-
_expm1(x) = expm1(x)
19-
_expm1(x::Float16) = Float16(expm1(Float32(x)))
20-
else
21-
const _expm1 = expm1
22-
end
23-
2414
include("basicfuns.jl")
2515
include("logsumexp.jl")
2616

src/basicfuns.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ function log1mexp(x::Real)
240240
if x < oftype(float(x), IrrationalConstants.loghalf)
241241
return log1p(-exp(x))
242242
else
243-
return log(-_expm1(x))
243+
return log(-expm1(x))
244244
end
245245
end
246246

@@ -249,15 +249,15 @@ $(SIGNATURES)
249249
250250
Return `log(2 - exp(x))` evaluated as `log1p(-expm1(x))`
251251
"""
252-
log2mexp(x::Real) = log1p(-_expm1(x))
252+
log2mexp(x::Real) = log1p(-expm1(x))
253253

254254
"""
255255
$(SIGNATURES)
256256
257257
Return `log(exp(x) - 1)` or the “invsoftplus” function. It is the inverse of
258258
[`log1pexp`](@ref) (aka “softplus”).
259259
"""
260-
logexpm1(x::Real) = x <= 18.0 ? log(_expm1(x)) : x <= 33.3 ? x - exp(-x) : oftype(exp(-x), x)
260+
logexpm1(x::Real) = x <= 18.0 ? log(expm1(x)) : x <= 33.3 ? x - exp(-x) : oftype(exp(-x), x)
261261
logexpm1(x::Float32) = x <= 9f0 ? log(expm1(x)) : x <= 16f0 ? x - exp(-x) : oftype(exp(-x), x)
262262

263263
"""
@@ -462,7 +462,7 @@ $(SIGNATURES)
462462
463463
Compute the complementary double exponential, `1 - exp(-exp(x))`.
464464
"""
465-
cexpexp(x) = -_expm1(-exp(x))
465+
cexpexp(x) = -expm1(-exp(x))
466466

467467
#=
468468
this uses the identity:

test/basicfuns.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -468,7 +468,7 @@ end
468468
@test cloglog(T(x)) cloglog_big(T(x))
469469
# Julia bug for Float32 and Float16 initially introduced in https://github.com/JuliaLang/julia/pull/37440
470470
# and fixed in https://github.com/JuliaLang/julia/pull/50989
471-
if T === Float64 || VERSION < v"1.7.0-DEV.887" || VERSION >= v"1.11.0-DEV.310"
471+
if T === Float64 || VERSION >= v"1.11.0-DEV.310"
472472
@test cexpexp(T(x)) cexpexp_big(T(x))
473473
end
474474
end

0 commit comments

Comments
 (0)