diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 391d16c2..e93ae5df 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,7 +17,7 @@ permissions: jobs: test: - name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ github.event_name }} + name: Julia ${{ matrix.version }} - ${{ matrix.os }} - NaN-safe mode ${{ matrix.nansafe && 'enabled' || 'disabled' }} - ${{ github.event_name }} runs-on: ${{ matrix.os }} strategy: fail-fast: false @@ -30,12 +30,21 @@ jobs: - ubuntu-latest - windows-latest - macOS-latest + nansafe: + - true + - false steps: - uses: actions/checkout@v5 - uses: julia-actions/setup-julia@v2 with: version: ${{ matrix.version }} - uses: julia-actions/cache@v2 + - name: Set NaN-safe mode preference + run: | + open(joinpath(pwd(), "Project.toml"), "a") do io + println(io, "\n[preferences.ForwardDiff]\nnansafe_mode = ${{ matrix.nansafe }}\n") + end + shell: julia --color=yes {0} - uses: julia-actions/julia-buildpkg@v1 - uses: julia-actions/julia-runtest@v1 - uses: julia-actions/julia-processcoverage@v1 diff --git a/test/runtests.jl b/test/runtests.jl index e440af65..0f6ba394 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -1,5 +1,7 @@ using ForwardDiff, Test, Random +@info "Testing ForwardDiff with NaN-safe mode $(ForwardDiff.NANSAFE_MODE_ENABLED ? "enabled" : "disabled")" + SEED = trunc(Int, time()) println("##### Random.seed!($SEED), on VERSION == $VERSION") Random.seed!(SEED)