Firebase JS SDK Nightly #84
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Copyright 2024 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: Firebase JS SDK Nightly | |
on: | |
schedule: | |
- cron: "0 0 * * *" | |
pull_request: | |
branches: | |
- main | |
workflow_dispatch: | |
jobs: | |
run: | |
name: Execute JS SDK Playwright tests | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repo | |
uses: actions/checkout@v4 | |
- name: Set up Node (20) | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20.x | |
cache: 'npm' | |
cache-dependency-path: yarn.lock | |
- name: Restore cached node_modules | |
uses: actions/cache@v4 | |
id: node_modules | |
with: | |
path: "./node_modules" | |
key: node_modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }} | |
- name: Write Project Config | |
env: | |
PROJECT_CONFIG: ${{ secrets.PROJECT_CONFIG }} | |
run: echo "export const firebaseConfig = $PROJECT_CONFIG;" > src/lib/app_tests/firebase.ts | |
- name: Yarn install | |
run: yarn --frozen-lockfile | |
- name: Restore yarn build cache | |
uses: actions/cache@v4 | |
with: | |
path: | | |
~/.npm | |
${{ github.workspace }}/.next/cache | |
# Generate a new cache whenever packages or source files change. | |
key: ${{ runner.os }}-nextjs-${{ hashFiles('yarn.lock') }}-${{ hashFiles('**/*.js', '**/*.jsx', '**/*.ts', '**/*.tsx') }} | |
# If source files changed but packages didn't, rebuild from a prior cache. | |
restore-keys: | | |
${{ runner.os }}-nextjs-${{ hashFiles('yarn.lock') }}- | |
- name: Yarn build | |
run: yarn build | |
- name: Restore cached playwright browsers | |
uses: actions/cache@v4 | |
with: | |
path: ~/.cache/ms-playwright | |
key: playwright-${{ hashFiles('playwright.config.ts') }} | |
- name: Install Playwright browsers | |
run: yarn playwright install --with-deps | |
- name: Launch E2E tests workflow | |
run: yarn test | |
- name: Send email on failure | |
if: failure() | |
uses: ./.github/actions/send-email | |
with: | |
api-key: ${{ secrets.OSS_BOT_MAILGUN_KEY }} | |
domain: ${{ secrets.OSS_BOT_MAILGUN_DOMAIN }} | |
from: 'GitHub <admin-github@${{ secrets.OSS_BOT_MAILGUN_DOMAIN }}>' | |
to: ${{ secrets.FIREBASE_NEXTJS_TESTS_GITHUB_EMAILS }} | |
subject: 'Nightly build of ${{github.repository}} failed!' | |
html: > | |
<b>The nightly workflow to test the Firebase JS SDK failed on: ${{github.repository}}</b> | |
<br /><br />Navigate to the | |
<a href="https://github.com/FirebaseExtended/firebase-sdk-nextjs-tests/actions/runs/${{github.run_id}}">failed workflow</a> | |
to look further into what went wrong. | |
continue-on-error: true |