ROAR DocumentationROAR Documentation
  • Databases
  • Workflows
  • Application
  • GitHub Actions
  • Dashboard Components
  • Firebase App Check
  • Cloud Functions
  • Backend Architecture
  • Internationalization
  • Integrating New Apps
  • Optimizing Assets
  • ROAR Redivis Instance
  • Logging and Querying
  • Emulation
  • Data Guidelines
  • Data Organization
  • Data Requests
GitHub
  • Databases
  • Workflows
  • Application
  • GitHub Actions
  • Dashboard Components
  • Firebase App Check
  • Cloud Functions
  • Backend Architecture
  • Internationalization
  • Integrating New Apps
  • Optimizing Assets
  • ROAR Redivis Instance
  • Logging and Querying
  • Emulation
  • Data Guidelines
  • Data Organization
  • Data Requests
GitHub
  • Databases
    • Database Information
    • gse-roar-admin
    • gse-roar-assessment
  • BigQuery
    • Querying Assessment Data
    • BigQuery schema: classes
    • BigQuery schema: districts
    • BigQuery schema: families
    • BigQuery schema: groups
    • BigQuery schema: schools
    • BigQuery schema: user_runs
    • BigQuery schema: user_trials
    • BigQuery schema: users
  • Workflows
    • Workflows
    • Creating an Assignment
    • Authentication
    • Creating new Users
    • User Roster Changes
    • How to Impersonate a Clever User on Localhost
  • Application

    • Auth
  • GitHub Actions
    • ROAR Apps GitHub Actions
      • GitHub Actions in ROAR Apps
      • firebase-deploy-preview.yml
      • firebase-hosting-merge.yml
      • publish-to-npm-create-new-release.yml
      • submit-dashboard-pr.yml
    • ROAR Dashboard GitHub Actions
      • GitHub Actions in the ROAR Dashboard
  • Dashboard Components
    • Dashboard Components
    • Organization Score Reports
  • Firebase App Check
    • Firebase App Check Configuration for roar-firekit and roar-dashboard
  • Backend Architecture
    • Architecture
      • Backend Architecture in ROAR
      • Data Models
      • Database Implementations
      • Error Handling Architecture in ROAR
      • Repository Layer Architecture
      • Service Layer Architecture
    • API
      • Classes
        • Class: AdministrationServiceError
        • Class: FirebaseClientError
        • Class: FirebaseImplementationError
        • Class: FirestoreAdministrationRepository
        • Class: FirestoreAdministrationRepositoryError
        • Class: abstract FirestoreBaseRepository<T>
        • Class: FirestoreFilterAdapter
        • Class: FirestoreIdentityProviderRepository
        • Class: FirestoreIdentityProviderRepositoryError
        • Class: FirestoreOrgRepository
        • Class: FirestoreOrgRepositoryError
        • Class: FirestoreRepositoryError
        • Class: FirestoreUserClaimRepository
        • Class: FirestoreUserClaimRepositoryError
        • Class: FirestoreUserRepository
        • Class: FirestoreUserRepositoryError
        • Class: IdentityProviderServiceError
        • Classes
      • Enumerations
        • Enumeration: CollectionType
        • Enumeration: IdentityProviderType
        • Enumeration: Operator
        • Enumerations
      • Functions
        • Functions
        • Function: chunkOrgs()
        • Function: createAdministrationService()
        • Function: createFirestoreImplementation()
        • Function: createIdentityProviderService()
        • Function: isEmptyOrgs()
      • Interfaces
        • Interface: Administration
        • Interface: AdministrationBaseRepository
        • Interface: AdministrationService
        • Interface: AssentConsent
        • Interface: Assessment
        • Interface: BaseModel
        • Interface: BaseRepository<T>
        • Interface: Claims
        • Interface: CompositeCondition
        • Interface: CompositeFilter
        • Interface: CreateAdministrationServiceParams<AdminRepo, OrgRepo, UserClaimRepo>
        • Interface: CreateParams
        • Interface: DeleteParams
        • Interface: EducationalOrgsList
        • Interface: FieldCondition
        • Interface: FilterAdapter<T>
        • Interface: FirestoreCreateParams
        • Interface: FirestoreDeleteParams
        • Interface: FirestoreFetchDocumentParams
        • Interface: FirestoreGetAllParams
        • Interface: FirestoreGetByIdParams
        • Interface: FirestoreGetByNameParams
        • Interface: FirestoreGetByRoarUidParams
        • Interface: FirestoreGetParams
        • Interface: FirestoreGetWithFiltersParams
        • Interface: FirestoreImplementation
        • Interface: FirestoreRunTransactionParams<T>
        • Interface: FirestoreUpdateParams
        • Interface: FutureParams
        • Interface: GetAdministrationIdsForAdministratorParams
        • Interface: GetAdministrationIdsFromOrgsParams
        • Interface: GetAllParams
        • Interface: GetByNameParams
        • Interface: GetByProviderIdParams
        • Interface: GetByRoarUidParams
        • Interface: GetParams
        • Interface: GetRoarUidParams
        • Interface: IdentityProvider
        • Interface: IdentityProviderBaseRepository
        • Interface: IdentityProviderService
        • Interface: Legal
        • Interface: OrgBase
        • Interface: OrgBaseRepository
        • Interface: OrgsList
        • Interfaces
        • Interface: Result<T>
        • Interface: RunTransactionParams<T>
        • Interface: SingleFilter
        • Interface: UpdateParams
        • Interface: User
        • Interface: UserBaseRepository
        • Interface: UserClaim
        • Interface: UserClaimBaseRepository
        • Interface: createIdentityProviderServiceParams<IDPRepo, UserClaimRepo, UserRepo>
        • Interface: getAdministrationIdsFromOrgsParams
        • Interface: _setAdministrationIdsParams
      • Type Aliases
        • Type Alias: BaseFilter
        • Type Alias: ComparisonOperator
        • Type Alias: Condition
        • Type Alias: DocumentCreatedEvent
        • Type Alias: DocumentDeletedEvent
        • Type Alias: DocumentUpdatedEvent
        • Type Alias: DocumentWrittenEvent
        • Type Alias: ParameterValue
        • Type Aliases
        • Type Alias: SelectAllCondition
      • Variables
        • Variable: FirebaseAppClient
        • Variable: FirebaseAuthClient
        • Variable: FirestoreClient
        • Variable: ORG_NAMES
        • Variables API Documentation
    • Examples
      • Examples
    • Guides
      • Guides
  • Cloud Functions
    • gse-roar-admin
      • Admin Database
      • appendToAdminClaims()
      • associateassessmentuid()
      • createAdministratorAccount()
      • createGuestDocsForGoogleUsers()
      • createLevanteGroup()
      • createLevanteUsers()
      • createnewfamily()
      • createstudentaccount()
      • mirrorClasses()
      • mirrorCustomClaims
      • mirrorDistricts()
      • mirrorFamilies()
      • mirrorGroups()
      • mirrorSchools()
      • removefromadminclaims()
      • saveSurveyResponses()
      • setuidcustomclaims()
      • softDeleteUserAssignment()
      • softDeleteUserExternalData
      • softDeleteUser()
      • syncAssignmentCreated()
      • syncAssignmentDeleted()
      • syncAssignmentUpdated()
      • syncAssignmentsOnAdministrationUpdate()
      • syncAssignmentsOnUserUpdate()
      • syncCleverOrgs()
      • syncCleverUser()
    • gse-roar-assessment
      • Assessment Database
      • organizeBucketLogsByDate()
      • setuidclaims()
      • softDeleteGuestTrial()
      • softDeleteGuest()
      • softDeleteUserRun()
      • softDeleteUserTrial()
      • syncOnRunDocUpdate()
  • Internationalization
    • ROAM Fluency
    • ROAR Letter
    • ROAR Phoneme
    • Internationalization of ROAR Apps
    • ROAR Sentence
    • ROAR Word
  • Integrating New Apps
    • Integrating Roar Apps into the Dashboard
    • Dashboard Integration
    • Monitoring and Testing
    • Preparing the App for Packaging and Deployment
    • Packaging and Publishing to npm
    • Secrets in the GitHub Repository
  • Assets Optimization
    • Optimizing Assets
    • Audio Optimization Guide
    • Image Optimization Guide
  • ROAR Redivis Instance
    • ROAR Redivis Instance
    • ROAR Data Validator Trigger
    • ROAR Data Validator
  • Logging and Querying
    • ROAR Logging
  • Emulation
    • Running the Emulator
      • Commands
    • Emulator Configuration Guide
      • Configuration
      • Cypress Configuration
      • Setup and Dependencies
      • Firebase CLI Configuration
      • Firebase Emulator Configuration
      • GitHub Secrets and Workflows
      • Importing and Exporting Data
      • Local Environment Variables
  • Clowder Implementation
    • Clowder Integration
    • Letter - Clowder
    • Multichoice - Clowder
    • Phoneme - Clowder
    • ARF & CALF - Clowder

GitHub Secrets and Workflows

Running the Firebase Emulator requires the use of GitHub Workflows and Secrets. This section will explain how to set up the GitHub Workflows and Secrets for the ROAR app.

Secrets

The following secrets are required to run the Firebase Emulator in the GitHub Workflow:

Firebase Secrets

  • APPCHECK_DEBUG_TOKEN
  • FIREBASE_SERVICE_ACCOUNT_GSE_ROAR_ASSESSMENT
  • FIREBASE_SERVICE_ACCOUNT_GSE_ROAR_ASSESSMENT_DEV

Testing Secrets

  • CYPRESS_BASE_URL
  • CYPRESS_RECORD_KEY
  • SUPER_ADMIN_USERNAME
  • SUPER_ADMIN_PASSWORD
  • SUPER_ADMIN_EMAIL
  • SUPER_ADMIN_ID

Sentry Secrets

  • SENTRY_AUTH_TOKEN
  • SENTRY_ORG
  • SENTRY_PROJECT

Other Secrets

  • DASHBOARD_REPO_TOKEN
  • NPM_TOKEN

Workflows

The following GitHub Workflows are used to run the Firebase Emulator:

firebase-emulation-tests.yml

This workflow runs the Firebase Emulator and executes the tests using the Cypress testing framework. The workflow is triggered on push and pull request events.

name: Firebase Emulation Tests
on:
  pull_request:
    types: [opened, reopened, synchronize]

concurrency:
  group: $ {{ env.CYPRESS_PARALLEL_GROUP }}
  cancel-in-progress: true

jobs:
  firebase_emulate_and_cypress_run:
    runs-on: ubuntu-latest
    timeout-minutes: 120
    container:
      image: cypress/browsers:latest
      options: --user 1001
    strategy:
      fail-fast: false
      matrix:
        containers: [1, 2]

    env:
      CYPRESS_BASE_URL: 'http://localhost:8000'
      CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
      CYPRESS_PARALLEL_GROUP: ci-preview-tests-${{ github.run_id }}-${{ github.ref }}
      COMMIT_INFO_MESSAGE: E2E Tests for PR ${{ github.event.number }} "${{ github.event.pull_request.title }}" from commit "${{ github.event.pull_request.head.sha }}"
      COMMIT_INFO_SHA: ${{ github.event.pull_request.head.sha }}
      SUPER_ADMIN_USERNAME: ${{ secrets.SUPER_ADMIN_USERNAME }}
      SUPER_ADMIN_PASSWORD: ${{ secrets.SUPER_ADMIN_PASSWORD }}
      SUPER_ADMIN_EMAIL: ${{ secrets.SUPER_ADMIN_EMAIL }}
      SUPER_ADMIN_ID: ${{ secrets.SUPER_ADMIN_ID }}
      GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
      APPCHECK_DEBUG_TOKEN: ${{ secrets.APPCHECK_DEBUG_TOKEN }}
      EXPORT_BUCKET: gs://roar-assessment-dev-export
      EXPORT_DIR: emulator-exports-ci-${{ matrix.browser }}-${{ matrix.containers }}-${{ github.run_id }}-${{ github.job }}

    steps:
      - name: Checkout
        uses: actions/checkout@v4

      - name: Clean npm cache
        run: npm cache clean --force

      - name: Install Dependencies
        run: npm ci

      - name: Setup Java
        uses: actions/setup-java@v4
        with:
          distribution: 'temurin'
          java-version: '21'

      - name: Authenticate with Google Cloud SDK
        uses: google-github-actions/auth@v2
        with:
          credentials_json: ${{ secrets.FIREBASE_SERVICE_ACCOUNT_GSE_ROAR_ASSESSMENT_DEV }}

      - name: Set up Google Cloud SDK with Firebase Service Account
        uses: google-github-actions/setup-gcloud@v2
        with:
          project_id: gse-roar-assessment-dev

      - name: Export Firestore Data
        run: |
          gcloud firestore export $EXPORT_BUCKET/$EXPORT_DIR --collection-ids=tasks,variants

      - name: Download Firestore Data
        run: |
          gsutil -m cp -r $EXPORT_BUCKET/$EXPORT_DIR .

      - name: Start Firestore Emulator and Import Data
        run: |
          npx firebase emulators:start --project=gse-roar-assessment-dev --import=./$EXPORT_DIR &
          npx wait-on tcp:4000 --timeout 60000

      - name: Build the App
        run: npm run emulate:build

      - name: Serve the App
        run: |
          npm run emulate:serve-ci & 
          npx wait-on http://127.0.0.1:8000 --timeout 60000;

      - name: Generate Variant Tests
        uses: cypress-io/github-action@v6
        with:
          browser: electron
          headed: false,
          record: true
          parallel: false
          wait-on: ${{ env.CYPRESS_BASE_URL }}
          spec: 'cypress/e2e/generateVariantTests.cy.js'

      - name: Cypress Default Tests
        uses: cypress-io/github-action@v6
        with:
          browser: chrome
          headed: true
          record: true
          parallel: true
          start: npm run emulate:serve-ci
          wait-on: ${{ env.CYPRESS_BASE_URL }}
          spec: 'cypress/e2e/default-tests/**/*'
          wait-on-timeout: 300

      - name: Clean up Firestore Exports
        if: always()
        run: |
          gsutil -m -q rm -rf $EXPORT_BUCKET/$EXPORT_DIR || true
Edit this page
Last Updated:
Contributors: Elijah Kelly, Kyle
Prev
Firebase Emulator Configuration
Next
Importing and Exporting Data