Skip to content

canary-tests

canary-tests #386

Workflow file for this run

# 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"
jobs:
test:
name: Run E2E Smoke Tests
runs-on: ubuntu-latest
defaults:
run:
# Run any command steps in the /e2e subdir
working-directory: './e2e'
steps:
- name: Checkout Repo
uses: actions/checkout@master
- name: Set up Node (20)
uses: actions/setup-node@master
with:
node-version: 20.x
- name: install Chrome stable
run: |
sudo apt-get update
sudo apt-get install google-chrome-stable
- 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: Yarn install
run: |
echo "Installing firebase@${{ github.event.client_payload.versionOrTag }}"
yarn add firebase@${{ github.event.client_payload.versionOrTag }}
yarn
- name: Deploy "callTest" cloud function
run: |
pushd functions
npm install
popd
npx firebase-tools@13.0.2 deploy --only functions:callTest --project jscore-sandbox-141b5 --token $FIREBASE_CLI_TOKEN
working-directory: ./config
env:
FIREBASE_CLI_TOKEN: ${{ secrets.FIREBASE_CLI_TOKEN }}
- 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: 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 }}
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 }}
VERSION_OR_TAG: ${{ github.event.client_payload.versionOrTag }}
# run in root
working-directory: '.'