Skip to content

Conversation

@Akagi201
Copy link
Member

@Akagi201 Akagi201 commented Nov 14, 2025

🔧 Changes

Adds a comprehensive CI workflow using GitHub Actions.

📋 Workflow Steps

  1. Code Quality Checks

    • cargo fmt --check - Verify code formatting
    • cargo clippy - Lint with deny warnings
    • cargo test - Run all tests
  2. Build Process

    • Install JS dependencies with Bun
    • Build CSS with Tailwind (bun run build)
    • Build Rust project in release mode
    • Generate static site with SSG
  3. Artifacts

    • Upload site/** and style/output.css

⚡ Optimizations

  • Cargo registry/git/target caching
  • Bun cache and node_modules caching
  • Uses latest stable Rust toolchain
  • Uses latest Bun version

🎯 Triggers

  • Push to main branch
  • Pull requests targeting main

✅ Tested

The workflow configuration follows GitHub Actions best practices and should run successfully on the first execution.

Summary by CodeRabbit

  • Chores

    • Added CI workflow to run format/lint checks, tests, build CSS and Rust, and publish generated site artifact on pushes and PRs to main.
  • New Features

    • Atom feed improvements: feed and entry links include rel and mime types; author falls back to site author; categories derive from content tags; feed timestamps favor latest content dates when available.
  • Refactor

    • Internal code formatting and date-parsing simplifications (no behavior change).

@coderabbitai
Copy link

coderabbitai bot commented Nov 14, 2025

Walkthrough

Adds a GitHub Actions CI workflow and applies formatting/refactor and small behavioral improvements across the Rust project: changes touch build script, feed/date handling, renderer formatting, and the Cargo manifest.

Changes

Cohort / File(s) Summary
CI workflow
\.github/workflows/ci\.yml
New GitHub Actions workflow on push/PR to main: checks out code, sets Rust (stable + clippy/rustfmt), caches Cargo, runs cargo fmt -- --check, cargo clippy (deny warnings), cargo test --all-features, installs Bun, caches JS deps, installs JS deps with bun, builds Tailwind CSS, builds Rust release, generates site with typstify-ssg, uploads site artifact.
Build script
typstify-ssg/build.rs
Consolidated imports and inlined bun version check; reformatted command invocation for Tailwind via bun x tailwindcss; adjusted error message formatting; preserved existing behavior and early-return when Bun missing.
Feed generation
typstify-ssg/src/feed.rs
Reordered imports; enriched feed and entry link metadata (rel/mime_type); content URL formatting expanded; author falls back to site author; feed updated time derived from latest content date with RFC3339 or YYYY-MM-DD parsing and fallbacks; categories built from tags.
Date parsing refactor
typstify-ssg/src/lib.rs
Simplified date parsing chaining for feed generation (refactored or_else closures) and minor formatting changes; logic and fallbacks preserved.
Renderers formatting
typstify-ssg/src/renderers.rs
Whitespace and formatting adjustments across renderer code (Typst→HTML conversion); no functional changes.
Manifest
Cargo.toml
Touched/updated (manifest-level changes present in diff).

Sequence Diagram(s)

sequenceDiagram
  participant Dev as Developer (push/PR)
  participant GH as GitHub Actions CI
  participant Rust as Rust toolchain
  participant Bun as Bun + JS toolchain
  participant Tailwind as Tailwind (bun x)
  participant Build as typstify-ssg build

  Dev->>GH: push / open PR to main
  GH->>GH: checkout repo
  GH->>Rust: setup rust (stable + clippy + rustfmt)
  GH->>GH: restore cargo cache
  GH->>Rust: run cargo fmt -- --check
  GH->>Rust: run cargo clippy (deny warnings)
  GH->>Rust: run cargo test --all-features
  GH->>Bun: setup Bun (latest)
  GH->>GH: restore node/bun cache
  GH->>Bun: bun install
  GH->>Tailwind: bun x tailwindcss build (CSS)
  GH->>Rust: cargo build --release
  GH->>Build: typstify-ssg generate site
  GH->>GH: upload artifact "site"
  Note right of GH: Workflow ends
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20–30 minutes

  • Pay attention to:
    • CI: clippy configured to deny warnings, rustfmt check, caching keys, Bun setup and caching.
    • build.rs: correctness of the bun availability check and Tailwind invocation arguments.
    • feed/lib: date parsing logic and fallbacks (RFC3339 vs YYYY-MM-DD) and author fallback behavior.
    • Cargo.toml: verify any dependency or metadata changes.

Poem

🐰
I hopped through code at break of dawn,
Linted leaves and tests were drawn,
Bun and Tailwind baked the bun,
Rust compiled—behold the sun! 🌱✨

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 77.78% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'ci: Add GitHub Actions workflow for CI' clearly and directly describes the primary change: adding a CI workflow via GitHub Actions. It is specific and concise.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch add-ci-workflow

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1398438 and e7d9ebb.

📒 Files selected for processing (4)
  • typstify-ssg/build.rs (2 hunks)
  • typstify-ssg/src/feed.rs (6 hunks)
  • typstify-ssg/src/lib.rs (1 hunks)
  • typstify-ssg/src/renderers.rs (8 hunks)
🧰 Additional context used
🧬 Code graph analysis (2)
typstify-ssg/src/lib.rs (1)
typstify-ssg/src/feed.rs (1)
  • create_feed (6-137)
typstify-ssg/src/feed.rs (2)
typstify-ssg/src/config.rs (8)
  • default (73-81)
  • default (85-92)
  • default (96-103)
  • default (107-114)
  • default (118-124)
  • default (128-134)
  • default (202-210)
  • base_url (182-184)
typstify-ssg/src/content.rs (1)
  • slug (109-111)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Lint, Test, Build

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

@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

🧹 Nitpick comments (1)
.github/workflows/ci.yml (1)

46-49: Consider pinning Bun to a specific version instead of "latest" for greater build determinism.

Using bun-version: latest means each workflow run may use a different Bun version. While your package.json specifies "engines": { "bun": ">=1.0.0" } to enforce a minimum version, pinning to a specific tested version (e.g., bun-version: 1.0.0) would ensure fully reproducible builds and reduce the risk of subtle incompatibilities from new Bun releases.

If pinning to latest is intentional, this can be documented in the workflow or README for team clarity.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a1954ca and 1398438.

📒 Files selected for processing (1)
  • .github/workflows/ci.yml (1 hunks)
🔇 Additional comments (5)
.github/workflows/ci.yml (5)

26-35: Cache configuration for Cargo looks good.

The Cargo registry, git, and target directories are properly cached with a cache key based on Cargo.lock, and fallback restore-keys are in place. This should significantly speed up subsequent workflow runs.


37-44: Linting and testing steps are well-configured.

  • cargo fmt --all -- --check correctly enforces code formatting
  • cargo clippy --workspace --all-targets -- -D warnings denies warnings, which is good for CI
  • cargo test --workspace --all-features --no-fail-fast ensures comprehensive testing

These are solid practices for maintaining code quality.


61-65: No issues found—the build script is correctly configured in package.json.

The verification confirms that the build script exists and is properly set up to run Tailwind CSS compilation with minification. The workflow on line 65 will execute successfully.


51-59: Bun/node_modules caching is well-configured.

The caching strategy for node_modules and Bun cache with bun.lock as the cache key is sound and mirrors Cargo caching best practices. Verification confirms bun.lock is committed to the repository, ensuring the cache key works reliably.


73-79: Artifact upload configuration is verified and correct.

Both paths are properly produced during the build process:

  • site/** is generated by the SSG step (default output_dir from config is "site")
  • style/output.css is produced by the Tailwind CSS build step (bun run build)

Copy link

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 introduces a comprehensive CI workflow using GitHub Actions to automate code quality checks, testing, and build processes for the Typstify project.

Key Changes:

  • Automated Rust code quality checks (formatting, linting, testing) on every push and PR to main
  • Automated CSS build pipeline using Bun and Tailwind CSS
  • Static site generation and artifact uploading for deployment readiness

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

@Akagi201 Akagi201 merged commit 3761067 into main Nov 17, 2025
1 of 2 checks passed
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.

2 participants