Skip to content

πŸš€ CI/CD Pipeline for Automated TestingΒ #71

@mijinummi

Description

@mijinummi

πŸ“Œ Overview

Maintaining high code quality requires automated testing integrated into the development workflow. Manual testing is error-prone and slows down contributions. A CI/CD pipeline ensures that every commit is validated before merging.

This task introduces a CI/CD pipeline using GitHub Actions to automate testing, code linting, and optional deployment checks for GasGuard.


🎯 Objective

Build a pipeline that:

  • Automatically runs unit and integration tests on every push and pull request
  • Enforces coding standards via linting and formatting checks
  • Optionally builds Docker images to verify production readiness
  • Provides clear status feedback to contributors and maintainers

πŸ›  Scope of Work

1️⃣ Testing Automation

  • Run tests automatically on:

    • Push to main / development branches
    • Pull requests
    • Optional scheduled runs for nightly regression tests
  • Tests include:

    • Unit tests (Jest / Vitest)
    • Integration tests (API endpoints, database, RPC calls)
    • Optional end-to-end tests for dashboards or workflows

2️⃣ Linting and Formatting

  • Include ESLint and Prettier checks as part of the pipeline
  • Fail pipeline on lint or formatting errors
  • Optionally auto-fix simple issues

3️⃣ Build and Verification

  • Optional build step for:

    • Docker images
    • Compilation verification for TypeScript
    • Packaging for production deployment
  • Fail pipeline if build errors occur


4️⃣ GitHub Actions Workflow

  • Create workflow YAML (e.g., .github/workflows/ci.yml) including:
    • Checkout code
    • Setup Node.js environment
    • Install dependencies (npm ci)
    • Run lint, format check, and tests
    • Optional Docker build and push

Example workflow snippet:

name: CI Pipeline

on:
  push:
    branches: [main, develop]
  pull_request:
    branches: [main, develop]

jobs:
  build-and-test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - uses: actions/setup-node@v3
        with:
          node-version: 20
      - run: npm ci
      - run: npm run lint
      - run: npm test
      - run: npm run build

Metadata

Metadata

Assignees

No one assigned

    Labels

    Nest.jsStellar WaveIssues in the Stellar wave programbackendNew feature or request

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions