Skip to content

Add TeXLive setup and document generation to CI workflow.#602

Merged
rultor merged 19 commits intomasterfrom
600
Jan 20, 2026
Merged

Add TeXLive setup and document generation to CI workflow.#602
rultor merged 19 commits intomasterfrom
600

Conversation

@yegor256
Copy link
Member

@yegor256 yegor256 commented Jan 19, 2026

closes #600

Summary by CodeRabbit

  • Chores
    • CI now installs TeX tooling and runs an automated verification that produces LaTeX output from the project and compiles it, helping catch document-generation regressions early.
    • Local clean target enhanced to remove additional local build artifacts for a more thorough workspace cleanup.

✏️ Tip: You can customize this high-level summary in your review settings.

Copilot AI review requested due to automatic review settings January 19, 2026 15:59
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 19, 2026

Warning

Rate limit exceeded

@yegor256 has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 12 minutes and 12 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between edccb21 and 9b6a0f0.

📒 Files selected for processing (1)
  • .github/workflows/cabal.yml

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

📝 Walkthrough

Walkthrough

Adds a Linux CI step in .github/workflows/cabal.yml to install TeX Live, run phino explain --normalize to produce LaTeX, and compile the generated article.tex with pdflatex. Also extends the Makefile clean target to remove .stack-work.

Changes

Cohort / File(s) Summary
CI Workflow: LaTeX verification
/.github/workflows/cabal.yml
Adds installation of TeX Live via zauguin/install-texlive@v4.0.0 (scheme-basic, eolang, texlive_version: 2025). Adds a Linux run step that builds with cabal, locates the phino executable, writes a minimal LaTeX file including the eolang package and two macros, runs phino explain --normalize to generate LaTeX output, and compiles article.tex with pdflatex.
Build cleanup
Makefile
Extends the clean target to remove .stack-work by adding rm -rf .stack-work after the existing cabal clean.

Sequence Diagram(s)

sequenceDiagram
  participant Runner as Runner
  participant Installer as TeX Installer
  participant Repo as Repository
  participant Phino as phino CLI
  participant LaTeX as pdflatex

  Runner->>Installer: install TeX Live (scheme-basic, eolang, 2025)
  Runner->>Repo: checkout code
  Runner->>Repo: run cabal build
  Repo-->>Runner: locate `phino` binary
  Runner->>Repo: write minimal LaTeX (eolang + macros) to article.tex
  Runner->>Phino: run `phino explain --normalize` and pipe rewrite -> LaTeX
  Phino-->>Repo: emit LaTeX content into article.tex
  Runner->>LaTeX: run `pdflatex article.tex`
  LaTeX-->>Runner: compilation result (PDF or errors)
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Poem

🐇 I hopped into CI with a twitch and grin,

I fetched TeX Live and told phino to begin.
It chewed on ideas and spat out a tex line,
pdflatex hummed — a PDF for my shrine.
I twitched my nose and danced on a pin.

🚥 Pre-merge checks | ✅ 4 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Out of Scope Changes check ⚠️ Warning The Makefile change to clean .stack-work appears out of scope relative to the linked issue #600, which focuses only on CI workflow for LaTeX document generation. Remove the .stack-work cleanup from Makefile or address it in a separate pull request linked to an appropriate issue.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically summarizes the main change: adding TeXLive setup and document generation to the CI workflow, which matches the changeset content.
Linked Issues check ✅ Passed The pull request successfully implements all three objectives from issue #600: installs TeXLive via the workflow, invokes phino to generate LaTeX documents, and compiles them with pdflatex to detect errors.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds TeXLive setup and LaTeX document generation testing to the CI workflow to ensure that the phino tool generates valid LaTeX output that can be compiled successfully.

Changes:

  • Added TeXLive setup action to install required LaTeX packages
  • Added a test step that generates a LaTeX document using phino's explain and rewrite commands
  • Added pdflatex compilation to validate the generated LaTeX

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

echo '{[[ x -> [[ y -> ? ]].y ]]}' | "${e}" rewrite --normalize --output=latex --sequence
echo "\end{document}"
) > article.tex
pdflatex article
Copy link

Copilot AI Jan 19, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The pdflatex command is missing error handling. If the LaTeX compilation fails, the step should fail. Add set -e at the beginning of the script or use pdflatex -halt-on-error article to ensure the step fails on compilation errors.

Suggested change
pdflatex article
pdflatex -halt-on-error article

Copilot uses AI. Check for mistakes.
Comment on lines 26 to 29
- uses: teatimeguest/setup-texlive-action@v3.3.4
with:
update-all-packages: true
packages: scheme-basic geometry xcolor naive-ebnf microtype eolang
Copy link

Copilot AI Jan 19, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The TeXLive setup action is being run unconditionally on all platforms including Windows. If the LaTeX document generation step is only intended to run on Unix-like systems (due to comment ID 002), consider adding a platform condition to this step as well to avoid unnecessary setup on Windows.

Copilot uses AI. Check for mistakes.
- run: cabal install hpc-codecov-0.6.3.0 --overwrite-policy=always
- run: make clean coverage
- run: |
e=$(find .stack-work/install/ -name phino | head -1)
Copy link

Copilot AI Jan 19, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The script is searching for the phino executable in .stack-work/install/, but this is a cabal workflow that builds with cabal, not stack. Cabal builds executables in the dist-newstyle directory. Use cabal list-bin phino to get the correct path to the executable, as done in the release-binary.yml workflow.

Suggested change
e=$(find .stack-work/install/ -name phino | head -1)
e=$(cabal list-bin phino | head -1)

Copilot uses AI. Check for mistakes.
Comment on lines 60 to 72
- run: |
e=$(find .stack-work/install/ -name phino | head -1)
(
echo "\documentclass{article}"
echo "\usepackage{eolang}"
echo "\begin{document}"
echo "\newcommand\scopeof[1]{#1}"
echo "\newcommand\isnormal[1]{#1}"
"${e}" explain --normalize
echo '{[[ x -> [[ y -> ? ]].y ]]}' | "${e}" rewrite --normalize --output=latex --sequence
echo "\end{document}"
) > article.tex
pdflatex article
Copy link

Copilot AI Jan 19, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The workflow runs on multiple operating systems (macOS, Ubuntu, Windows) according to the matrix strategy, but this script uses bash-specific syntax without specifying a shell. On Windows, this will fail because the default shell is PowerShell. Add a conditional to skip this step on Windows or specify shell: bash for the step.

Copilot uses AI. Check for mistakes.
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Fix all issues with AI agents
In @.github/workflows/cabal.yml:
- Around line 60-72: The run step that builds article.tex and calls pdflatex
uses bash-specific constructs (e.g., $(find .stack-work/install/ -name phino |
head -1), command substitution and pipes) so add a top-level "shell: bash" entry
to that step so the commands execute on Windows runners; update the job step
containing the multi-line run block (the block that defines e, constructs
article.tex with echo and calls pdflatex) to include "shell: bash" immediately
alongside the existing "run:" key.
- Around line 63-70: Replace the multiple echo calls that emit the LaTeX
preamble/postamble and the dynamic printed LaTeX line with a heredoc for the
static block and printf for the dynamic string to address shellcheck SC2028 and
improve portability: wrap the static lines (the lines producing
"\documentclass{article}" through "\newcommand\isnormal[1]{`#1`}" and the final
"\end{document}") in a single cat <<'EOF' heredoc so backslashes are preserved,
and replace the echo that pipes '{[[ x -> [[ y -> ? ]].y ]]}' into "${e}"
rewrite with printf '%s\n' '{[[ x -> [[ y -> ? ]].y ]]}' so the "${e}"
explain/rewrite invocations remain unchanged and behavior of the e variable and
its flags (--normalize, --output=latex, --sequence) is preserved.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In @.github/workflows/cabal.yml:
- Around line 68-77: The printf invocations that build article.tex are missing
trailing newlines, causing the LaTeX to be emitted on one line; update each
printf (the '\\documentclass{article}', '\\usepackage{eolang}',
'\\begin{document}', '\\newcommand\\scopeof[1]{`#1`}',
'\\newcommand\\isnormal[1]{`#1`}', and '\\end{document}' calls) to include a
terminating '\n' (or replace the whole block with a heredoc that preserves
newlines) so article.tex contains proper line breaks and readable LaTeX for
easier debugging.
♻️ Duplicate comments (1)
.github/workflows/cabal.yml (1)

78-78: Consider adding -halt-on-error for more reliable failure detection.

While set -e on line 63 helps, pdflatex doesn't always return non-zero for all LaTeX errors. Using -halt-on-error ensures immediate failure on the first error.

-          pdflatex article
+          pdflatex -halt-on-error article
🧹 Nitpick comments (1)
.github/workflows/cabal.yml (1)

65-66: Consider using cabal list-bin for a more idiomatic executable lookup.

The find approach works but is fragile if multiple builds exist. cabal list-bin phino returns the correct path directly and is consistent with other workflows in this repository.

-          e=$(find ./dist-newstyle/ -name phino -type f | head -1)
-          if [ -z "${e}" ]; then exit 1; fi
+          e=$(cabal list-bin phino)

@yegor256
Copy link
Member Author

@maxonfjvipon take a look

@maxonfjvipon
Copy link
Member

@rultor merge

@rultor
Copy link
Contributor

rultor commented Jan 20, 2026

@rultor merge

@maxonfjvipon OK, I'll try to merge now. You can check the progress of the merge here.

@rultor rultor merged commit 839d950 into master Jan 20, 2026
19 checks passed
@rultor rultor deleted the 600 branch January 20, 2026 07:54
@rultor
Copy link
Contributor

rultor commented Jan 20, 2026

@rultor merge

@maxonfjvipon Done! FYI, the full log is here (took me 17min).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

latex workflow is missing

3 participants