diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4854e87d..9bad3b7b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -397,7 +397,16 @@ jobs: - name: Run validated-statistics tests first env: R_LIBS_SITE: /usr/local/lib/R/site-library:/usr/lib/R/site-library:/usr/lib/R/library - run: julia --project=. -t2 --compiled-modules=no test/runtests.jl numeric_policy exact_summaries high_precision derived_analyses validated_statistics + shell: bash + run: | + set +e + julia --project=. -t2 --compiled-modules=no test/runtests.jl numeric_policy exact_summaries high_precision derived_analyses validated_statistics 2>&1 | tee /tmp/validated-statistics-tests.log + status="${PIPESTATUS[0]}" + if [ "$status" -ne 0 ]; then + enc() { head -c 3500 | sed -e 's/%/%25/g' -e 's/\r/%0D/g' | awk '{printf "%s%%0A", $0}'; } + echo "::error title=Validated-statistics tests failed::$(tail -n 120 /tmp/validated-statistics-tests.log | enc)" + fi + exit "$status" - name: Run tests env: diff --git a/scripts/check-julia-syntax.jl b/scripts/check-julia-syntax.jl index 5b70d0a9..bc8a9d60 100644 --- a/scripts/check-julia-syntax.jl +++ b/scripts/check-julia-syntax.jl @@ -2,16 +2,35 @@ # Parse every tracked Julia source with the pinned runtime before CI spends time # installing scientific/frontend dependencies. This checks syntax only; package # loading and behavior remain covered by the test suite. +# +# Meta.parseall does not throw for every parser failure: an unterminated block +# can be returned as Expr(:incomplete), which a bare try/catch would accept. +# Parse each expression explicitly and reject both error and incomplete results. files = sort(filter(f -> endswith(f, ".jl"), split(read(`git ls-files -z`, String), '\0'))) failed = false for file in files + issue = nothing try - Meta.parseall(read(file, String)) + source = read(file, String) + position = 1 + while position <= ncodeunits(source) + ex, next_position = Meta.parse(source, position; filename=file) + if Meta.isexpr(ex, :error) || Meta.isexpr(ex, :incomplete) + issue = ex + break + end + next_position > position || + error("Julia parser made no progress at code unit $position") + position = next_position + end catch err + issue = err + end + if !isnothing(issue) failed = true println(stderr, "Julia parse failed in $file:") - println(stderr, sprint(showerror, err)) + println(stderr, sprint(showerror, issue)) end end failed && exit(1) diff --git a/src/core/doi.jl b/src/core/doi.jl index 86efc408..f5b0bd95 100644 --- a/src/core/doi.jl +++ b/src/core/doi.jl @@ -680,4 +680,4 @@ function publish_study(config::DOIConfig, study::AbstractString, run::AbstractSt return receipt end -end +end # module DOI