Skip to content

Conversation

Bolu1
Copy link
Member

@Bolu1 Bolu1 commented Feb 26, 2025

CI Pipeline Implementation for DefiFundr Backend

Overview

This PR implements a continuous integration (CI) pipeline using GitHub Actions for the DefiFundr backend project. The pipeline automates code quality checks, testing, and build verification on all branches and pull requests.

Changes

  • Added GitHub Actions workflow configuration in
  • Configured linting with golangci-lint
  • Set up automated testing with PostgreSQL integration
  • Implemented build verification and artifact storage

Features

Linting

  • Uses golangci-lint to check code quality and ensure consistent coding standards
  • Configured with essential linters for Go projects
  • Runs automatically on all branches and PRs

Testing

  • Executes all unit and integration tests
  • Sets up PostgreSQL service container for database-dependent tests
  • Collects and reports code coverage
  • Configures proper database connection for test environment

Build Verification

  • Ensures the application builds successfully
  • Creates and stores build artifacts for reference
  • Runs after successful lint and test jobs

Documentation

  • Added detailed documentation on the CI pipeline structure
  • Included instructions for troubleshooting CI issues
  • Provided guidelines for running CI checks locally

Related Issue

Closes #43

Copy link
Member

@demola234 demola234 left a comment

Choose a reason for hiding this comment

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

Please kindly review and make the changes
@Bolu1


- name: Run tests
run: go test -v -race -coverprofile=coverage.txt -covermode=atomic ./...
env:
Copy link
Member

Choose a reason for hiding this comment

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

check previous CI implementation. Use similar strategies, avoid exposing sensitive data in CI implementation

- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.21'
Copy link
Member

Choose a reason for hiding this comment

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

Use version of golang used in the project or upgrade project to current version

image: postgres:15-alpine
env:
POSTGRES_USER: root
POSTGRES_PASSWORD: secret
Copy link
Member

Choose a reason for hiding this comment

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

Postgres is used but migration test in ci is not done

@@ -0,0 +1,39 @@
linters:
enable:
Copy link
Member

Choose a reason for hiding this comment

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

reduce sensitivity of linter for now

@Bolu1
Copy link
Member Author

Bolu1 commented Feb 27, 2025

Hi @demola234, i've made the requested changes can you take a look now

@demola234 demola234 merged commit ce7718f into main Feb 27, 2025
7 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.

DefiFundr - 005: CI/CD Pipeline Setup

2 participants