Skip to content
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

Feat(app): #11 Workflows Setup #32

Merged
merged 4 commits into from
Oct 20, 2024

Conversation

mohit-nagaraj
Copy link
Contributor

@mohit-nagaraj mohit-nagaraj commented Oct 19, 2024

Add CI/CD Workflows for Linting, Testing, Building, Static Analysis, and Dependency Checking

Description:

Fixes #11
DUE TO EXISTING FMT ISSUE, FORMATTED ALL THE FILES WHICH IS RESULTING IN SO MANY CHANGES. BUT ALL OF THEM ARE JUST FORMATTING CHANGES ONLY
This PR introduces several workflows to automate the CI/CD process for the Go backend repository. These workflows ensure that every pull request (PR) is properly tested, linted, built, analyzed, and checked for dependency issues before merging into the main branches.

The workflows added/mofied include:

  1. Linting Workflow
  2. Testing Workflow (Unit and Integration Tests) = modified
  3. Build Workflow
  4. Static Analysis Workflow
  5. Dependency Check Workflow

Workflow Details:

  1. Linting Workflow (.github/workflows/lint.yml)

    • Purpose: Enforces code quality standards and best practices by running golangci-lint on every PR.
    • Trigger: Runs on pull requests and pushes to master branches.
    • Tool: Uses golangci-lint to check for code style issues, unused variables, and other linting problems.
    • Benefit: Ensures the code adheres to style guidelines and eliminates basic errors before review.
  2. Testing Workflow (.github/workflows/tests.yml)

    • Purpose: Automatically runs unit tests and integration tests to ensure the functionality of individual components and the overall system. Uses the exsisting file
    • Trigger: Runs on pull requests and pushes to master branches.
    • Commands:
      • go test ./... for unit tests.
    • Benefit: Ensures the code performs as expected and reduces the risk of introducing bugs with new changes.
  3. Build Workflow (.github/workflows/build.yml)

    • Purpose: Verifies that the codebase can be successfully compiled without errors.
    • Trigger: Runs on pull requests and pushes to master branches.
    • Command: go build ./... to compile the Go project.
    • Benefit: Ensures that the application builds successfully, preventing broken builds from being merged into the codebase.
  4. Static Analysis Workflow (.github/workflows/static-analysis.yml)

    • Purpose: Performs static code analysis using staticcheck to catch bugs, inefficiencies, and code quality issues before runtime.
    • Trigger: Runs on pull requests and pushes to master branches.
    • Tool: Uses staticcheck to perform deep code analysis and detect common issues in Go code.
    • Benefit: Improves code quality, maintainability, and catches potential issues early in the development cycle.
  5. Dependency Check Workflow (.github/workflows/dependency-check.yml)

    • Purpose: Ensures all Go module dependencies are up-to-date and properly managed.
    • Trigger: Runs on pull requests and pushes to master branches.
    • Commands:
      • go get -u -v to check for updates to dependencies.
      • go mod tidy to clean up the go.mod file.
    • Benefit: Ensures that the code uses the latest versions of dependencies and that the go.mod file remains clean and accurate.

@mohit-nagaraj
Copy link
Contributor Author

Hey @shivamsouravjha does this meet the needs specified in the issue?

@shivamsouravjha shivamsouravjha merged commit 855da21 into shivamsouravjha:master Oct 20, 2024
6 checks passed
Copy link

sentry-io bot commented Oct 27, 2024

Suspect Issues

This pull request was deployed and Sentry observed the following issues:

  • ‼️ *errors.errorString: mongo: no documents in result stockbackend/services in (*fileService).ParseXL... View Issue

Did you find this useful? React with a 👍 or 👎

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

Successfully merging this pull request may close these issues.

add: pipelines
2 participants