CI/CD Pipeline

Comprehensive documentation for the continuous integration and deployment pipeline.

Overview

Remind Tools uses a multi-layered CI/CD approach:
  • GitHub Actions: Primary CI for testing and validation
  • Codemagic: Multi-platform builds and deployment
  • Automated releases: Semantic versioning with changelog

GitHub Actions

Main Workflow

name: CI Pipeline

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

jobs:
  analyze:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - uses: subosito/flutter-action@v2
        with:
          flutter-version: '3.19.0'
      - run: melos bootstrap
      - run: melos run analyze

  test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - uses: subosito/flutter-action@v2
      - run: melos bootstrap
      - run: melos test
      - uses: codecov/codecov-action@v3
        with:
          files: ./coverage/lcov.info

  build:
    needs: [analyze, test]
    runs-on: ubuntu-latest
    strategy:
      matrix:
        platform: [android, web]
    steps:
      - uses: actions/checkout@v3
      - uses: subosito/flutter-action@v2
      - run: melos bootstrap
      - run: melos run build:${{ matrix.platform }}

Branch Protection

  • Require PR reviews (2)
  • Dismiss stale reviews
  • Require status checks
  • Require up-to-date branches
  • Include administrators

Automated Testing

Test Matrix

Test TypeTriggerCoverageTime
Unit TestsEvery push80%+~2 min
Widget TestsEvery push70%+~3 min
IntegrationPR to mainCritical~5 min
Golden TestsPR to mainUI~2 min

Coverage Reports

# Generate coverage
- run: melos run coverage

# Upload to Codecov
- uses: codecov/codecov-action@v3
  with:
    token: ${{ secrets.CODECOV_TOKEN }}
    files: ./coverage/lcov.info
    fail_ci_if_error: true

Release Process

Semantic Versioning

1

Create Release Branch

git checkout -b release/v1.2.0
2

Version Bump

melos version
# Interactive version selection
3

Generate Changelog

Automatically generated from conventional commits
4

Create PR

PR from release branch to main
5

Tag & Release

git tag v1.2.0
git push origin v1.2.0

Conventional Commits

# Features
feat: add expense tracking to trips

# Fixes
fix: resolve map loading issue

# Breaking changes
feat!: new authentication flow

# Documentation
docs: update API documentation

# Performance
perf: optimize image loading

Deployment

Environment Strategy

BranchEnvironmentTriggerDeployment
mainProductionTag/ReleaseAutomatic
developStagingPushAutomatic
feature/*PreviewPRManual

Platform Deployments

iOS

TestFlight
  • Automated via Codemagic
  • Internal testing first
  • Phased rollout

Android

Play Console
  • Internal track first
  • Open testing
  • Production release

Web

Firebase Hosting
  • Preview URLs for PRs
  • Staging deployment
  • Production CDN

Monitoring

Build Status

# Slack notifications
- uses: 8398a7/action-slack@v3
  with:
    status: ${{ job.status }}
    text: 'Build ${{ job.status }}'
  if: always()

Deployment Tracking

  • Build times
  • Success rates
  • Artifact sizes
  • Error logs

Rollback Procedures

Always test rollback procedures in staging first.

Quick Rollback

# Revert last deployment
git revert HEAD
git push origin main

# Or use previous tag
git checkout v1.1.0
git tag v1.2.1
git push origin v1.2.1

Platform-Specific

  • iOS: Resubmit previous build
  • Android: Upload previous APK
  • Web: Redeploy previous version

Best Practices

  1. Never skip tests for hotfixes
  2. Use feature flags for gradual rollouts
  3. Monitor metrics after deployment
  4. Keep artifacts for 90 days
  5. Document deployment issues
  6. Automate repetitive tasks