# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. name: E2E Smoke Tests # Allows REST trigger. Currently triggered by release-cli script during a staging run. on: repository_dispatch: types: [staging-tests,canary-tests] env: # Bump Node memory limit NODE_OPTIONS: "--max_old_space_size=4096" permissions: contents: read jobs: test: name: Run E2E Smoke Tests runs-on: ubuntu-latest if: github.server_url == 'https://github.com' defaults: run: # Run any command steps in the /e2e/smoke-tests subdir working-directory: './e2e/smoke-tests' steps: - name: Checkout Repo uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # ratchet:actions/checkout@v7 with: persist-credentials: false - name: Set up Node (24) uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # ratchet:actions/setup-node@v7 with: node-version: 24.22.1 - name: Write project config env: PROJECT_CONFIG: ${{ secrets.TEST_PROJECT_CONFIG }} TEST_ACCOUNT: ${{ secrets.TEST_ACCOUNT }} run: | echo "export const config = $PROJECT_CONFIG; export const testAccount = $TEST_ACCOUNT" > firebase-config.js - name: Poll npm until version to test is available for install run: | echo "Polling npm for firebase@${GITHUB_EVENT_CLIENT_PAYLOAD_VERSIONORTAG}" node ./scripts/release/poll-npm-publish.js # run in root working-directory: '.' env: VERSION: ${{ github.event.client_payload.versionOrTag }} GITHUB_EVENT_CLIENT_PAYLOAD_VERSIONORTAG: ${{ github.event.client_payload.versionOrTag }} - name: Yarn install run: | echo "Installing firebase@${GITHUB_EVENT_CLIENT_PAYLOAD_VERSIONORTAG}" yarn add firebase@${GITHUB_EVENT_CLIENT_PAYLOAD_VERSIONORTAG} yarn env: GITHUB_EVENT_CLIENT_PAYLOAD_VERSIONORTAG: ${{ github.event.client_payload.versionOrTag }} - name: Do modular build run: yarn build:modular - name: Do compat build run: yarn build:compat - name: Run modular tests env: APP_CHECK_DEBUG_TOKEN: ${{ secrets.APP_CHECK_DEBUG_TOKEN }} run: xvfb-run yarn test:modular - name: Run compat tests env: APP_CHECK_DEBUG_TOKEN: ${{ secrets.APP_CHECK_DEBUG_TOKEN }} run: xvfb-run yarn test:compat - name: Authenticate to Google Cloud (Release Tracker) if: always() id: release-tracker-auth uses: google-github-actions/auth@fc2174804b84f912b1f6d334e9463f484f1c552d with: credentials_json: ${{ secrets.RELEASE_TRACKER_SA_KEY }} token_format: 'id_token' id_token_audience: ${{ secrets.RELEASE_TRACKER_URL }}/logE2EResult - name: Tests succeeded if: success() run: node scripts/ci/notify-test-result.js success # we don't want THIS step erroring to trigger the failure notification continue-on-error: true env: WEBHOOK_URL: ${{ secrets.JSCORE_CHAT_WEBHOOK_URL }} RELEASE_TRACKER_URL: ${{ secrets.RELEASE_TRACKER_URL }} RELEASE_TRACKER_ID_TOKEN: ${{ steps.release-tracker-auth.outputs.id_token }} VERSION_OR_TAG: ${{ github.event.client_payload.versionOrTag }} # run in root working-directory: '.' - name: Tests failed if: failure() run: node scripts/ci/notify-test-result.js fail env: WEBHOOK_URL: ${{ secrets.JSCORE_CHAT_WEBHOOK_URL }} RELEASE_TRACKER_URL: ${{ secrets.RELEASE_TRACKER_URL }} RELEASE_TRACKER_ID_TOKEN: ${{ steps.release-tracker-auth.outputs.id_token }} VERSION_OR_TAG: ${{ github.event.client_payload.versionOrTag }} # run in root working-directory: '.'