Skip to content

GitHub workflow #21

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open

GitHub workflow #21

wants to merge 9 commits into from

Conversation

TheCrossLegCoder
Copy link
Owner

@TheCrossLegCoder TheCrossLegCoder commented Apr 3, 2025

Summary by CodeRabbit

  • Chores

    • Introduced new automation workflows to streamline building, testing, and publishing releases across multiple environments.
    • Streamlined the project structure by removing legacy components for improved maintenance.
  • Documentation

    • Added a test status badge to provide immediate, visual quality feedback in the project documentation.
  • Bug Fixes

    • Removed several outdated source and test files, resulting in a cleaner codebase.

build-and-publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Copy link
Collaborator

Choose a reason for hiding this comment

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

@TheCrossLegCoder please use actions/checkout@v4

- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: "7.0.x" # Use a single version for publishing
Copy link
Collaborator

Choose a reason for hiding this comment

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

please use appropriate dotnet version

- uses: actions/checkout@v3

- name: Setup .NET
uses: actions/setup-dotnet@v3
Copy link
Collaborator

Choose a reason for hiding this comment

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

please use actions/setup-dotnet@v4

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
Copy link
Collaborator

Choose a reason for hiding this comment

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

please use actions/checkout@v4

- uses: actions/checkout@v3

- name: Setup .NET
uses: actions/setup-dotnet@v3
Copy link
Collaborator

Choose a reason for hiding this comment

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

please use actions/setup-dotnet@v4

- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: "7.0.x"
Copy link
Collaborator

Choose a reason for hiding this comment

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

please use appropriate version

@sanamhub sanamhub requested a review from Copilot April 3, 2025 10:01
Copy link

@Copilot 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 pull request introduces two new GitHub workflows to run tests and publish the NuGet package, as well as updates the README badge to reflect passing tests.

  • Added a "Run Tests" workflow to build and test the project on multiple .NET frameworks and configurations.
  • Added a "Build and Publish NuGet Package" workflow that builds, packages, and pushes the NuGet package on tag pushes.
  • Updated README.md to include a badge indicating that tests are passing.

Reviewed Changes

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

File Description
README.md Added a badge for test status.
.github/workflows/test.yml Introduced a test workflow with matrix configurations for Debug/Release builds across multiple frameworks.
.github/workflows/publish.yml Introduced a publish workflow to build, pack, and push the NuGet package upon version tag push.
Files not reviewed (2)
  • NepDate.sln: Language not supported
  • tatus -s: Language not supported

Copy link

coderabbitai bot commented Apr 3, 2025

Walkthrough

This pull request introduces two new GitHub Actions workflows to automate building, testing, and publishing a NuGet package using multiple .NET frameworks. The publish workflow triggers on version tags and publishes the NuGet package for .NET 7.0, while the test workflow runs on pushes and pull requests across different OS and .NET versions. Additionally, two projects have been removed from the solution file, a test status badge has been added to the README, and several source and test files have been deleted, reducing the overall codebase.

Changes

File(s) Change Summary
.github/workflows/publish.yml
.github/workflows/test.yml
Added new GitHub Actions workflows: one for building, testing, and publishing the NuGet package via a matrix of .NET versions, and another for testing the project on multiple OS environments.
NepDate.sln Removed two projects ("Private" and "Scrapper") along with their build configuration entries, resulting in a streamlined solution file.
README.md Added a badge indicating that tests are passing, linking to the GitHub Actions test results.
Multiple source & test files
(Formattable.cs, DictionaryBridge.cs, NepDateException.cs, Extensions.cs,
FiscalYear.cs, NepaliDate.cs, SmartDateParser.cs, MemoryOptimizationBenchmark.cs, MemoryUsageTests.cs,
NepDateComprehensiveTests.cs, NepaliDateRangeTests.cs, NepaliDateTests.cs, SerializationTests.cs, SmartDateParserTests.cs, Usings.cs)
Removed 15 files (1938 lines total) related to date handling, exception processing, and comprehensive testing, thereby reducing both the functional and testing components of the NepDate library.

Sequence Diagram(s)

sequenceDiagram
    participant U as User (Push Tag)
    participant R as Runner
    participant C as Codebase
    participant N as NuGet Repo
    U->>R: Push tag "v*"
    R->>C: Checkout code & set up .NET environment
    R->>C: Restore dependencies, Build, Run tests (matrix: .NET 4.7.2, 7.0, 9.0)
    R->>R: Extract version from tag
    alt Framework is .NET 7.0
      R->>N: Publish NuGet package using API key
    end
Loading
sequenceDiagram
    participant U as User (Push/PR)
    participant R as Runner
    participant C as Codebase
    participant T as Test Executor
    U->>R: Trigger test workflow on main branch
    R->>C: Checkout code & set up .NET (matrix of OS & versions)
    R->>C: Restore dependencies
    R->>C: Build solution (msbuild/dotnet build based on .NET version)
    R->>T: Run tests (msbuild for 4.7.2, dotnet test otherwise)
Loading

Poem

Hoppin' through workflows, I take a joyful leap,
From tag to build, my code secrets I keep.
Tests run in rhythm, smooth as a dance,
NuGet packs published at a glance.
With projects pruned and badges bright,
I, the coding rabbit, celebrate light! 🐰

Tip

⚡💬 Agentic Chat (Pro Plan, General Availability)
  • We're introducing multi-step agentic chat in review comments and issue comments, within and outside of PR's. This feature enhances review and issue discussions with the CodeRabbit agentic chat by enabling advanced interactions, including the ability to create pull requests directly from comments and add commits to existing pull requests.

📜 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 1b93f3a and 68f1943.

📒 Files selected for processing (1)
  • .github/workflows/publish.yml (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • .github/workflows/publish.yml

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai plan to trigger planning for file edits and PR creation.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

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