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

Added GitHub Actions CI for Backend Build and Testing #38

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Naman-B-Parlecha
Copy link

This PR adds a GitHub Actions workflow (backend-ci.yml) to automate the backend CI process. The workflow ensures that every code change meets quality standards by running tests, checking for linting issues, and verifying the build process before merging into main.

Why is this needed?

  • Ensures code reliability: Running tests on every commit and pull request helps catch potential issues early.
  • Maintains code quality: Enforcing linting (golangci-lint) ensures best practices and prevents technical debt.
  • Prevents broken builds: The backend is built and verified to avoid merging code that does not compile.
  • Speeds up development: Automating these checks reduces manual effort and provides immediate feedback on changes.

Workflow Overview

This CI workflow runs on push and pull_request events for the main branch. It performs the following checks:

  1. Dependency Management

    • Runs go mod tidy and go mod download to ensure all dependencies are correctly installed and updated.
  2. Unit Testing

    • Executes go test -v ./... to run all test cases across the backend, ensuring functionality is intact.
  3. Build Verification

    • Compiles the backend service (cmd/server/main.go) to verify there are no compilation errors.
  4. Linting

    • Installs golangci-lint and runs it to enforce coding standards and detect potential issues.

This CI pipeline helps maintain a stable, clean, and well-tested backend, improving overall project maintainability and developer experience.

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.

1 participant