Skip to content

Actions 設定#17

Merged
TwoSquirrels merged 6 commits into
mainfrom
ci-setup
Jun 9, 2026
Merged

Actions 設定#17
TwoSquirrels merged 6 commits into
mainfrom
ci-setup

Conversation

@TwoSquirrels

@TwoSquirrels TwoSquirrels commented Jun 9, 2026

Copy link
Copy Markdown
Owner

close #12

Summary by CodeRabbit

  • New Features

    • Automated CI/CD pipeline with tests, linting, coverage, packaging, audits, and release automation.
    • Automated dependency updates via Dependabot on a weekly schedule.
  • Documentation

    • Added CI and coverage status badges to README.
  • Style

    • Code formatting and minor refactors to improve readability without behavioral changes.

@coderabbitai

coderabbitai Bot commented Jun 9, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@TwoSquirrels, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 26 minutes and 49 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, 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 include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 4701279b-edae-41cd-8354-9c6c2c9f2f9b

📥 Commits

Reviewing files that changed from the base of the PR and between d63c3fc and b869e1d.

📒 Files selected for processing (2)
  • .github/workflows/ci.yml
  • .github/workflows/release.yml
📝 Walkthrough

Walkthrough

Adds Dependabot and comprehensive CI/CD: a multi-job CI workflow (fmt, clippy, cross-platform tests, coverage, pages deploy, package check, audit), a release workflow (validate tag, publish crate, build/upload binaries), README badges, and non-functional code formatting/error-context reflows across several Rust modules.

Changes

GitHub Actions CI/CD Infrastructure

Layer / File(s) Summary
Dependabot Configuration
.github/dependabot.yml
Schedules weekly Dependabot checks for Cargo and GitHub Actions at the repo root with grouped update policies.
CI Workflow Foundation and Formatting/Lint Jobs
.github/workflows/ci.yml
Adds CI metadata, concurrency, permissions; fmt job and clippy job (warnings-as-errors).
Cross-Platform Test Matrix
.github/workflows/ci.yml
Adds test job running cargo test --locked --all-features --bins across macOS/Windows matrix (includes macos-26-intel).
Coverage Report Generation and Pages Deployment
.github/workflows/ci.yml
Adds coverage job using cargo-llvm-cov to generate HTML and _site/badge.json and uploads _site; adds deploy-pages job to publish Pages on pushes to main.
Packaging Validation and Security Audit
.github/workflows/ci.yml
Adds package job (cargo publish --locked --dry-run) and audit job running rustsec/audit-check.
Release: validate → publish → binaries
.github/workflows/release.yml
Implements tag-triggered release flow: validate checks tag vs crate version, publish authenticates and publishes, binaries builds archives and uploads to the GitHub release.
README Status Badges
README.md
Adds CI and coverage badges to the README header.

Code Formatting and Error Context Consistency

Layer / File(s) Summary
Configuration module (find/load)
src/config.rs
Reflows with_context/format! usage in find_config_file and load TOML parsing; behavior and error messages unchanged.
Filesystem relpath UTF-8 validation
src/fs/relpath.rs
Reformats to_slash UTF-8 conversion and with_context error construction without changing validation semantics.
Bundle inventory and rewrite formatting
src/bundle/inventory.rs, src/bundle/rewrite.rs
Reformats Inventory::verify hash context and rewrite's push_line argument layout; logic unchanged.
Local store discovery and tags serialization
src/library/local.rs, src/library/tags.rs
Splits context formatting in LocalStore::discover() and consolidates Tags::to_json/Tags::save calls; serialization/write semantics preserved.
Commands: bail!/show/test expectation
src/commands/library.rs
Reformats bail! invocations and show output; updates test expectation for parse_search_dirs to use canonicalize; behavior preserved.

🎯 3 (Moderate) | ⏱️ ~20 minutes

🐰 In tidy lines and CI bright,

Dependabot hums through the night,
Workflows march and badges gleam,
Errors framed in a cleaner scheme,
Releases wait at the versioned beam.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Out of Scope Changes check ⚠️ Warning Most changes are in-scope GitHub Actions and configuration files; however, code formatting changes in multiple source files appear unrelated to the CI/release objectives. Remove formatting-only changes (bundle/inventory.rs, bundle/rewrite.rs, commands/library.rs, config.rs, fs/relpath.rs, library/local.rs, library/tags.rs) unless they are required for the CI/release setup.
✅ 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 'Actions 設定' (Actions Configuration) is directly related to the main changes: adding GitHub Actions workflows (CI, release) and Dependabot configuration.
Linked Issues check ✅ Passed The PR comprehensively addresses issue #12 requirements: CI pipeline validates code quality via fmt/clippy/test/coverage jobs, and release workflow automates crates.io publishing when tags are created.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ci-setup

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/release.yml:
- Around line 6-7: Update the push tag filters so tags containing SemVer build
metadata also trigger the workflow: adjust the on.push.tags entries (the two
patterns currently listed: "v[0-9]+.[0-9]+.[0-9]+" and
"v[0-9]+.[0-9]+.[0-9]+-*") to allow an optional "+..." build suffix (e.g.,
"+build" or "+build.*") so tags like v1.2.3+build.1 match; keep the stricter
SemVer validation step as the single source of truth in the validate job. Ensure
both occurrences (the pair at lines referenced and the similar block at 29-33)
are updated consistently.
- Around line 68-69: The binaries job is currently gated only on validate;
modify the binaries job to depend on the publish job and only run when publish
succeeded—update the job's needs to include "publish" (e.g., needs: [validate,
publish] or replace needs: validate with needs: publish) and change the if
condition to check the publish result (e.g., if: needs.publish.result ==
'success' or, if publish sets an output like release, use if:
needs.publish.outputs.release == 'true') so that binary creation/upload only
runs after a successful crates.io publish; reference the "binaries" job and the
"publish" job when making this change.

In `@README.md`:
- Line 5: The CI badge in README.md points to "ci.yaml" but the workflow file is
named "ci.yml", so update the badge target to use "ci.yml" (or rename the
workflow file to match) so the URL matches the actual workflow filename;
specifically change the badge reference string "ci.yaml" to "ci.yml" in the
README.md badge line to restore the badge link.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 1d0622f2-5103-47c0-9576-d9f6a59ecb47

📥 Commits

Reviewing files that changed from the base of the PR and between f4af8f9 and 00e0798.

📒 Files selected for processing (11)
  • .github/dependabot.yml
  • .github/workflows/ci.yml
  • .github/workflows/release.yml
  • README.md
  • src/bundle/inventory.rs
  • src/bundle/rewrite.rs
  • src/commands/library.rs
  • src/config.rs
  • src/fs/relpath.rs
  • src/library/local.rs
  • src/library/tags.rs

Comment thread .github/workflows/release.yml Outdated
Comment thread .github/workflows/release.yml Outdated
Comment thread README.md Outdated

Copilot AI left a comment

Copy link
Copy Markdown

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 GitHub Actions automation for CI, coverage reporting to GitHub Pages (with a README badge), Dependabot updates, and a tag-driven release workflow for publishing to crates.io and attaching prebuilt binaries. It also includes several Rust formatting-only refactors and a small test expectation tweak for cross-platform path normalization.

Changes:

  • Added CI workflow with formatting, clippy, tests, coverage report + Pages deploy, publish dry-run, and cargo-audit.
  • Added release workflow triggered by version tags to publish to crates.io and upload platform binaries to a GitHub Release.
  • Added Dependabot configuration and README badges for CI and coverage.

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
src/library/tags.rs Formatting-only changes to JSON serialization/write error context chaining.
src/library/local.rs Formatting-only change around dirs::data_local_dir() error context.
src/fs/relpath.rs Formatting-only change to UTF-8 validation error context formatting.
src/config.rs Formatting-only change to absolute path error context and TOML parsing line breaks.
src/commands/library.rs Formatting of error messages; test assertion adjusted to compare canonicalized paths consistently across OSes.
src/bundle/rewrite.rs Formatting-only change to push_line call layout.
src/bundle/inventory.rs Formatting-only change to hash recomputation error context chaining.
README.md Added CI and coverage badges.
.github/workflows/release.yml New release pipeline for crates.io publish + binary build/upload on tags.
.github/workflows/ci.yml New CI pipeline including rustfmt/clippy/test/coverage/pages/audit/package checks.
.github/dependabot.yml New weekly Dependabot updates for Cargo and GitHub Actions.

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

Comment thread README.md Outdated
Comment thread .github/workflows/release.yml Outdated
Comment thread .github/workflows/release.yml Outdated
Comment thread .github/workflows/ci.yml

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 11 out of 11 changed files in this pull request and generated 1 comment.

Comment thread .github/workflows/release.yml
TwoSquirrels and others added 2 commits June 9, 2026 22:04
rustsec/audit-check compiled cargo-audit from source on every run (~3 min).
Install the prebuilt binary via taiki-e/install-action and run `cargo audit`
directly, cutting the job to seconds. The checks:write permission (only
needed for the action's check annotations) is no longer required.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@TwoSquirrels TwoSquirrels merged commit 54def0d into main Jun 9, 2026
9 checks passed
@TwoSquirrels TwoSquirrels deleted the ci-setup branch June 9, 2026 13:28
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.

CI

2 participants