This directory contains CI/CD workflows for the Firebase Functions Dart runtime.
Triggers:
- Push to
mainordevelopbranches - Pull requests to
mainordevelop - Manual workflow dispatch
Jobs:
Runs Dart package analysis and unit tests on multiple SDK versions.
- Matrix: Dart stable and beta SDKs
- Steps:
- Verify code formatting (stable only)
- Run
dart analyzewith fatal infos - Run unit tests (excluding snapshot and integration tests)
Validates the build_runner code generation system.
- Steps:
- Run build_runner on example project
- Verify
functions.yamlis generated - Validate YAML syntax
- Upload generated manifest as artifact
Compares Dart-generated manifest with Node.js reference.
- Dependencies: Requires
builder-teststo complete - Steps:
- Generate Dart manifest via build_runner
- Install Node.js dependencies
- Start firebase-functions HTTP server
- Fetch Node.js manifest from
/__/functions.yamlendpoint - Run snapshot comparison tests
- Upload manifests on failure for debugging
Aggregates results from all test jobs.
- Dependencies: Runs after all test jobs
- Purpose: Single source of truth for overall test status
Triggers:
- Pull request opened, synchronized, or reopened
Features:
- Concurrency control: Cancels in-progress runs when new commits are pushed
- Fast feedback: Optimized for quick iteration
Jobs:
Essential code quality checks.
- Formatting verification
- Static analysis
- Unit tests with GitHub reporter
Ensures builder generates valid manifests.
- Runs build_runner
- Verifies manifest file exists
- Validates basic manifest structure (specVersion, endpoints)
Full snapshot tests (only for PRs to main).
- Conditional execution based on base branch
- Generates both Dart and Node.js manifests
- Runs compatibility tests
Aggregated PR status check.
Name: dart-manifest
Retention: 7 days
Contains: Generated functions.yaml from builder
Name: manifests-comparison
Retention: 30 days
Contains: Both Dart and Node.js manifests for debugging
GCLOUD_PROJECT="test-project"
PORT="8080"
FUNCTIONS_CONTROL_API="true"These enable the firebase-functions HTTP endpoint for manifest extraction.
- Dart packages: Automatic via
dart-lang/setup-dart - Node.js packages: Via
setup-nodewith npm cache
Add to README.md:
[](https://github.com/invertase/firebase-functions-dart/actions/workflows/test.yml)
[](https://github.com/invertase/firebase-functions-dart/actions/workflows/pr-checks.yml)- Download the
dart-manifestartifact - Check the generated YAML for syntax errors
- Verify all functions were discovered
- Compare with expected structure in
CLAUDE.md
- Download the
manifests-comparisonartifact - Compare the two manifests side-by-side
- Check for structural differences:
- Function naming (hyphens vs underscores)
- Trigger formats (eventFilters vs resource)
- Missing fields (retry, platform, etc.)
- Review
example/MANIFEST_COMPARISON.mdfor known differences
If "Server failed to start" error occurs:
- Check Node.js version (should be 18+)
- Verify firebase-functions package is installed
- Look for port conflicts (8080)
If YAML syntax errors:
- Check for unquoted special characters
- Verify indentation is consistent
- Ensure all strings are properly quoted
If functions.yaml doesn't exist:
- Check build_runner output for errors
- Verify example code has no syntax errors
- Ensure builder is registered in
build.yaml
Reproduce CI environment locally:
# Run formatting check
dart format --output=none --set-exit-if-changed .
# Run analyzer
dart analyze --fatal-infos
# Run unit tests
dart test --exclude-tags=snapshot,integration
# Generate Dart manifest
cd test/fixtures/dart_reference
dart run build_runner build --delete-conflicting-outputs
cd ../../..
# Generate Node.js manifest
cd test/fixtures/nodejs_reference
GCLOUD_PROJECT="test-project" \
PORT="8080" \
FUNCTIONS_CONTROL_API="true" \
npx firebase-functions &
sleep 3
curl -s http://localhost:8080/__/functions.yaml | python3 -m json.tool > nodejs_manifest.json
pkill -f firebase-functions
cd ../..
# Run snapshot tests
dart test test/snapshots/manifest_snapshot_test.dart- Add code coverage reporting
- Integration tests with Firebase Emulator Suite
- Performance benchmarks (cold start, memory usage)
- E2E deployment tests
- Nightly builds against Node.js SDK latest
- Auto-update Node.js reference on upstream releases
- Publish to pub.dev on release tags