Delete upstream workflows

This fork does not ship upstream's releases, and its hosted-runner jobs
never start here.

Claude-Session: https://claude.ai/code/session_01HuMDfgFssPUptYUzgZ6Cp8
This commit is contained in:
z
2026-09-24 09:59:05 -07:00
committed by GitHub
parent c9bddcc951
commit ba8a9104e5
20 changed files with 0 additions and 2172 deletions
-104
View File
@@ -1,104 +0,0 @@
# 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: Check Changeset
on:
pull_request:
branches:
- main
env:
GITHUB_PULL_REQUEST_HEAD_SHA: ${{ github.event.pull_request.head.sha }}
GITHUB_PULL_REQUEST_BASE_SHA: ${{ github.event.pull_request.base.sha }}
jobs:
check_changeset:
name: Check changeset vs changed files
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- name: Checkout Repo
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # ratchet:actions/checkout@v4
with:
# This makes Actions fetch all Git history so check_changeset script can diff properly.
fetch-depth: 0
persist-credentials: false
- name: Set up Node (22)
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # ratchet:actions/setup-node@v4
with:
node-version: 22.12.0
- name: Yarn install
run: yarn
- name: Run changeset script
# pull main so changeset can diff against it
run: |
git pull -f --no-rebase origin main:main
yarn ts-node-script scripts/ci/check_changeset.ts
id: check-changeset
- name: Print changeset checker output
run: |
cat << 'eof_delimiter_that_will_never_occur_in_CHANGESET_ERROR_MESSAGE'
${STEPS_CHECK_CHANGESET_OUTPUTS_CHANGESET_ERROR_MESSAGE}
eof_delimiter_that_will_never_occur_in_CHANGESET_ERROR_MESSAGE
env:
STEPS_CHECK_CHANGESET_OUTPUTS_CHANGESET_ERROR_MESSAGE: ${{steps.check-changeset.outputs.CHANGESET_ERROR_MESSAGE}}
- name: Print blocking failure status
run: echo "${STEPS_CHECK_CHANGESET_OUTPUTS_BLOCKING_FAILURE}"
env:
STEPS_CHECK_CHANGESET_OUTPUTS_BLOCKING_FAILURE: ${{steps.check-changeset.outputs.BLOCKING_FAILURE}}
- name: Find Comment
# This commit represents v3.1.0
uses: peter-evans/find-comment@a4ef349b8c29f841860ce94ed82b20f0a39b6961
id: fc
with:
issue-number: ${{github.event.number}}
body-includes: Changeset File Check
- name: Create comment (missing packages)
if: ${{!steps.fc.outputs.comment-id && steps.check-changeset.outputs.CHANGESET_ERROR_MESSAGE}}
# This commit represents v4.0.0
uses: peter-evans/create-or-update-comment@e2426b4b1346fd5e8c731c0bbe368063ea0286ac
with:
issue-number: ${{github.event.number}}
body: |
### Changeset File Check :warning:
${{steps.check-changeset.outputs.CHANGESET_ERROR_MESSAGE}}
- name: Update comment (missing packages)
if: ${{steps.fc.outputs.comment-id && steps.check-changeset.outputs.CHANGESET_ERROR_MESSAGE}}
# This commit represents v4.0.0
uses: peter-evans/create-or-update-comment@e2426b4b1346fd5e8c731c0bbe368063ea0286ac
with:
comment-id: ${{steps.fc.outputs.comment-id}}
edit-mode: replace
body: |
### Changeset File Check :warning:
${{steps.check-changeset.outputs.CHANGESET_ERROR_MESSAGE}}
- name: Update comment (no missing packages)
if: ${{steps.fc.outputs.comment-id && !steps.check-changeset.outputs.CHANGESET_ERROR_MESSAGE}}
# This commit represents v4.0.0
uses: peter-evans/create-or-update-comment@e2426b4b1346fd5e8c731c0bbe368063ea0286ac
with:
comment-id: ${{steps.fc.outputs.comment-id}}
edit-mode: replace
body: |
### Changeset File Check :white_check_mark:
- No modified packages are missing from the changeset file.
- No changeset formatting errors detected.
# Don't want it to throw before editing the comment.
- name: Fail if checker script logged a blocking failure
if: ${{steps.check-changeset.outputs.BLOCKING_FAILURE == 'true'}}
run: exit 1
-59
View File
@@ -1,59 +0,0 @@
# 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: Doc Change Check (Run "yarn docgen:all" if this fails)
on: pull_request
permissions:
contents: read
jobs:
doc-check:
name: Check if reference docs have changed
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # ratchet:actions/checkout@v4
with:
# get all history for the diff
fetch-depth: 0
persist-credentials: false
- name: Set up Node (22)
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # ratchet:actions/setup-node@v4
with:
node-version: 22.12.0
- name: Yarn install
run: yarn
- name: Run doc generation
run: yarn docgen:all
# Fail first if there are docs-devsite changes since running yarn docgen:all
# will also regenerate any API report changes.
- name: Check for changes in docs-devsite dir (fail if so)
run: |
if [[ -n "$(git status docs-devsite --porcelain)" ]]; then
echo "Unstaged changes detected in docs-devsite/:"
git status -s
echo "Changes in this PR affect the reference docs or API reports. Run \`yarn docgen:all\` locally to regenerate the changed files and add them to this PR."
exit 1
fi
- name: Check for changes in common/api-review dir (fail if so)
run: |
if [[ -n "$(git status common/api-review --porcelain)" ]]; then
echo "Unstaged changes detected in api-report(s):"
git status -s
echo "Changes in this PR affect the API reports. Run \`yarn build\` locally to regenerate the API reports and add them to this PR."
exit 1
fi
-45
View File
@@ -1,45 +0,0 @@
# 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: Test Package Paths
on: pull_request
permissions:
contents: read
jobs:
test:
name: Test Package Paths
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # ratchet:actions/checkout@v4
with:
# This makes Actions fetch all Git history so run-changed script can diff properly.
fetch-depth: 0
persist-credentials: false
- name: Set up Node (22)
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # ratchet:actions/setup-node@v4
with:
node-version: 22.12.0
- name: Yarn install
run: yarn
- name: Yarn build
run: yarn build
- name: Swap in public typings
run: yarn release:prepare
- name: Check paths
run: yarn ts-node scripts/ci-test/check-paths.ts
@@ -1,72 +0,0 @@
# 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: Check Vertex AI Responses
on:
pull_request:
paths:
- 'packages/ai/**'
jobs:
check-version:
runs-on: ubuntu-latest
# Allow GITHUB_TOKEN to have write permissions
permissions:
contents: write
pull-requests: write
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # ratchet:actions/checkout@v4
with:
persist-credentials: false
- name: Clone mock responses
run: scripts/update_vertexai_responses.sh
- name: Find cloned and latest versions
run: |
CLONED=$(git describe --tags)
LATEST=$(git tag --sort=v:refname | tail -n1)
echo "cloned_tag=$CLONED" >> $GITHUB_ENV
echo "latest_tag=$LATEST" >> $GITHUB_ENV
working-directory: packages/ai/test-utils/vertexai-sdk-test-data
- name: Find comment from previous run if exists
# This commit represents v3.1.0
uses: peter-evans/find-comment@a4ef349b8c29f841860ce94ed82b20f0a39b6961
id: fc
with:
issue-number: ${{github.event.number}}
body-includes: Vertex AI Mock Responses Check
- name: Comment on PR if newer version is available
if: ${{env.cloned_tag != env.latest_tag && !steps.fc.outputs.comment-id}}
# This commit represents v4.0.0
uses: peter-evans/create-or-update-comment@e2426b4b1346fd5e8c731c0bbe368063ea0286ac
with:
issue-number: ${{github.event.number}}
body: >
### Vertex AI Mock Responses Check :warning:
A newer major version of the mock responses for Vertex AI unit tests is available.
[update_vertexai_responses.sh](https://github.com/firebase/firebase-js-sdk/blob/main/scripts/update_vertexai_responses.sh)
should be updated to clone the latest version of the responses: `${{env.latest_tag}}`
- name: Delete comment when version gets updated
if: ${{env.cloned_tag == env.latest_tag && steps.fc.outputs.comment-id}}
uses: actions/github-script@f28e40c7f34bde8b3046d885e986cb6290c5673b # ratchet:actions/github-script@v7
with:
script: |
github.rest.issues.deleteComment({
owner: context.repo.owner,
repo: context.repo.repo,
comment_id: Number(process.env.COMMENT_ID),
})
env:
COMMENT_ID: ${{ steps.fc.outputs.comment-id }}
-57
View File
@@ -1,57 +0,0 @@
# 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: Deploy Project Config
on: pull_request
permissions:
contents: read
# Detects if any project config files (rules or functions) have changed,
# and deploys them to the test project used for CI if so.
# Run this in its own workflow instead of as a step before each test
# workflow to avoid too many deploys, possibly causing race conditions.
# Since the build step of each test workflow takes a long time, this
# this should finish before the tests begin running.
jobs:
test:
name: Deploy Firebase Project Rules and Functions
runs-on: ubuntu-latest
if: (github.actor != 'dependabot[bot]')
steps:
- name: Checkout Repo
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # ratchet:actions/checkout@v4
with:
# This makes Actions fetch all Git history so run-changed script can diff properly.
fetch-depth: 0
persist-credentials: false
- name: Set up node (22)
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # ratchet:actions/setup-node@v4
with:
node-version: 22.12.0
# firebase-tools has a minimum java version requirement
- name: Set up Java (22)
uses: actions/setup-java@03ad4de0992f5dab5e18fcb136590ce7c4a0ac95 # v5.6.0
with:
distribution: 'temurin'
java-version: '22'
- name: Yarn install
run: yarn
- name: Deploy project config if needed
run: yarn ts-node scripts/ci-test/deploy-if-needed.ts
env:
FIREBASE_CLI_TOKEN: ${{secrets.FIREBASE_CLI_TOKEN}}
-105
View File
@@ -1,105 +0,0 @@
# 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
defaults:
run:
# Run any command steps in the /e2e/smoke-tests subdir
working-directory: './e2e/smoke-tests'
steps:
- name: Checkout Repo
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # ratchet:actions/checkout@v4
with:
persist-credentials: false
- name: Set up Node (22)
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # ratchet:actions/setup-node@v4
with:
node-version: 22.12.0
- 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: 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: 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: '.'
-50
View File
@@ -1,50 +0,0 @@
# 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: Formatting Check (Run yarn format locally if this fails)
on: pull_request
env:
GITHUB_PULL_REQUEST_HEAD_SHA: ${{ github.event.pull_request.head.sha }}
GITHUB_PULL_REQUEST_BASE_SHA: ${{ github.event.pull_request.base.sha }}
permissions:
contents: read
jobs:
format:
name: Run license and prettier formatting tasks
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # ratchet:actions/checkout@v4
with:
# get all history for the diff
fetch-depth: 0
persist-credentials: false
- name: Set up node (22)
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # ratchet:actions/setup-node@v4
with:
node-version: 22.12.0
- name: Yarn install
run: yarn
- name: Run formatting script
run: yarn format
- name: Check for changes (fail if so)
run: git diff --exit-code
- name: Formatting needs to be updated. See message below.
if: ${{ failure() }}
run: echo "Something was changed by formatting. Run \`yarn format\` locally to do a prettier/license pass. Use \`yarn format --help\` to see options."
-38
View File
@@ -1,38 +0,0 @@
# 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: Lint All Packages
on: pull_request
permissions:
contents: read
jobs:
test:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # ratchet:actions/checkout@v4
with:
persist-credentials: false
- name: Set up node (22)
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # ratchet:actions/setup-node@v4
with:
node-version: 22.12.0
- name: yarn install
run: yarn
- name: yarn lint
run: yarn lint
@@ -1,103 +0,0 @@
# 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: Prerelease manual deploy
on:
workflow_dispatch:
inputs:
prereleaseName:
description: 'The prerelease name, as in 1.0.0-<prereleaseName>'
required: true
npmTag:
description: 'The npm tag to publish to, as in npm install firebase@<npmTag>'
required: true
permissions:
contents: read
jobs:
deploy:
environment: release
name: Prerelease Deploy
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # ratchet:actions/checkout@v4
with:
# Canary release script requires git history and tags.
fetch-depth: 0
persist-credentials: false
- name: Set up node (22)
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # ratchet:actions/setup-node@v4
with:
node-version: 22.12.0
- name: Yarn install
run: yarn
- name: Deploy prerelease
run: yarn release custom -p ${GITHUB_EVENT_INPUTS_PRERELEASENAME} -t ${GITHUB_EVENT_INPUTS_NPMTAG}
env:
NPM_TOKEN_ANALYTICS: ${{secrets.NPM_TOKEN_ANALYTICS}}
NPM_TOKEN_ANALYTICS_INTEROP_TYPES: ${{secrets.NPM_TOKEN_ANALYTICS_INTEROP_TYPES}}
NPM_TOKEN_ANALYTICS_TYPES: ${{secrets.NPM_TOKEN_ANALYTICS_TYPES}}
NPM_TOKEN_APP: ${{secrets.NPM_TOKEN_APP}}
NPM_TOKEN_APP_TYPES: ${{secrets.NPM_TOKEN_APP_TYPES}}
NPM_TOKEN_APP_CHECK: ${{secrets.NPM_TOKEN_APP_CHECK}}
NPM_TOKEN_APP_CHECK_INTEROP_TYPES: ${{secrets.NPM_TOKEN_APP_CHECK_INTEROP_TYPES}}
NPM_TOKEN_APP_CHECK_TYPES: ${{secrets.NPM_TOKEN_APP_CHECK_TYPES}}
NPM_TOKEN_AUTH: ${{secrets.NPM_TOKEN_AUTH}}
NPM_TOKEN_AUTH_INTEROP_TYPES: ${{secrets.NPM_TOKEN_AUTH_INTEROP_TYPES}}
NPM_TOKEN_AUTH_TYPES: ${{secrets.NPM_TOKEN_AUTH_TYPES}}
NPM_TOKEN_COMPONENT: ${{secrets.NPM_TOKEN_COMPONENT}}
NPM_TOKEN_DATA_CONNECT: ${{secrets.NPM_TOKEN_DATA_CONNECT}}
NPM_TOKEN_DATABASE: ${{secrets.NPM_TOKEN_DATABASE}}
NPM_TOKEN_DATABASE_TYPES: ${{secrets.NPM_TOKEN_DATABASE_TYPES}}
NPM_TOKEN_FIRESTORE: ${{secrets.NPM_TOKEN_FIRESTORE}}
NPM_TOKEN_FIRESTORE_TYPES: ${{secrets.NPM_TOKEN_FIRESTORE_TYPES}}
NPM_TOKEN_FUNCTIONS: ${{secrets.NPM_TOKEN_FUNCTIONS}}
NPM_TOKEN_FUNCTIONS_TYPES: ${{secrets.NPM_TOKEN_FUNCTIONS_TYPES}}
NPM_TOKEN_INSTALLATIONS: ${{secrets.NPM_TOKEN_INSTALLATIONS}}
NPM_TOKEN_INSTALLATIONS_TYPES: ${{secrets.NPM_TOKEN_INSTALLATIONS_TYPES}}
NPM_TOKEN_LOGGER: ${{secrets.NPM_TOKEN_LOGGER}}
NPM_TOKEN_MESSAGING: ${{secrets.NPM_TOKEN_MESSAGING}}
NPM_TOKEN_PERFORMANCE: ${{secrets.NPM_TOKEN_PERFORMANCE}}
NPM_TOKEN_PERFORMANCE_TYPES: ${{secrets.NPM_TOKEN_PERFORMANCE_TYPES}}
NPM_TOKEN_REMOTE_CONFIG: ${{secrets.NPM_TOKEN_REMOTE_CONFIG}}
NPM_TOKEN_REMOTE_CONFIG_TYPES: ${{secrets.NPM_TOKEN_REMOTE_CONFIG_TYPES}}
NPM_TOKEN_RULES_UNIT_TESTING: ${{secrets.NPM_TOKEN_RULES_UNIT_TESTING}}
NPM_TOKEN_STORAGE: ${{secrets.NPM_TOKEN_STORAGE}}
NPM_TOKEN_STORAGE_TYPES: ${{secrets.NPM_TOKEN_STORAGE_TYPES}}
NPM_TOKEN_UTIL: ${{secrets.NPM_TOKEN_UTIL}}
NPM_TOKEN_AI: ${{secrets.NPM_TOKEN_AI}}
NPM_TOKEN_VERTEXAI: ${{secrets.NPM_TOKEN_VERTEXAI}}
NPM_TOKEN_WEBCHANNEL_WRAPPER: ${{secrets.NPM_TOKEN_WEBCHANNEL_WRAPPER}}
NPM_TOKEN_FIREBASE: ${{secrets.NPM_TOKEN_FIREBASE}}
NPM_TOKEN_APP_COMPAT: ${{ secrets.NPM_TOKEN_APP_COMPAT }}
NPM_TOKEN_INSTALLATIONS_COMPAT: ${{ secrets.NPM_TOKEN_INSTALLATIONS_COMPAT }}
NPM_TOKEN_ANALYTICS_COMPAT: ${{ secrets.NPM_TOKEN_ANALYTICS_COMPAT }}
NPM_TOKEN_AUTH_COMPAT: ${{ secrets.NPM_TOKEN_AUTH_COMPAT }}
NPM_TOKEN_MESSAGING_INTEROP_TYPES: ${{ secrets.NPM_TOKEN_MESSAGING_INTEROP_TYPES }}
NPM_TOKEN_FUNCTIONS_COMPAT: ${{ secrets.NPM_TOKEN_FUNCTIONS_COMPAT }}
NPM_TOKEN_MESSAGING_COMPAT: ${{ secrets.NPM_TOKEN_MESSAGING_COMPAT }}
NPM_TOKEN_PERFORMANCE_COMPAT: ${{ secrets.NPM_TOKEN_PERFORMANCE_COMPAT }}
NPM_TOKEN_REMOTE_CONFIG_COMPAT: ${{ secrets.NPM_TOKEN_REMOTE_CONFIG_COMPAT }}
NPM_TOKEN_DATABASE_COMPAT: ${{ secrets.NPM_TOKEN_DATABASE_COMPAT }}
NPM_TOKEN_FIRESTORE_COMPAT: ${{ secrets.NPM_TOKEN_FIRESTORE_COMPAT }}
NPM_TOKEN_STORAGE_COMPAT: ${{ secrets.NPM_TOKEN_STORAGE_COMPAT }}
NPM_TOKEN_APP_CHECK_COMPAT: ${{ secrets.NPM_TOKEN_APP_CHECK_COMPAT }}
NPM_TOKEN_API_DOCUMENTER: ${{ secrets.NPM_TOKEN_API_DOCUMENTER }}
CI: true
GITHUB_EVENT_INPUTS_PRERELEASENAME: ${{ github.event.inputs.prereleaseName }}
GITHUB_EVENT_INPUTS_NPMTAG: ${{ github.event.inputs.npmTag }}
-44
View File
@@ -1,44 +0,0 @@
# 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: Log Release PR
on:
pull_request:
branches:
- release
- '*-releasebranch'
permissions:
contents: read
jobs:
release:
name: Send PR number to tracker endpoint
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # ratchet:actions/checkout@v4
with:
persist-credentials: false
- name: Setup Node.js 20.x
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # ratchet:actions/setup-node@v4
with:
node-version: 22.12.0
- name: Get PR number and send to tracker.
run: node scripts/ci/log-changesets.js
env:
RELEASE_TRACKER_URL: ${{ secrets.RELEASE_TRACKER_URL }}
-72
View File
@@ -1,72 +0,0 @@
# 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: Create Release PR
on:
push:
branches:
- release
- '*-releasebranch'
jobs:
release:
environment: release
name: Create Release PR
runs-on: ubuntu-latest
permissions:
pull-requests: write
contents: write
if: ${{ !startsWith(github.event.head_commit.message, 'Version Packages (#') }}
steps:
- name: Checkout Repo
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # ratchet:actions/checkout@v4
with:
# This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits
fetch-depth: 0
persist-credentials: false
- name: Setup Node.js 20.x
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # ratchet:actions/setup-node@v4
with:
node-version: 22.12.0
- name: Install Dependencies
run: yarn
# Ensures a new @firebase/app is published with every release.
# This keeps the SDK_VERSION variable up to date.
- name: Add a changeset for @firebase/app
# pull main so changeset can diff against it
run: |
git pull -f --no-rebase origin main:main
yarn ts-node-script scripts/ci/add_changeset.ts
# Configures git user as "google-oss-bot" for the next step
- name: Configure Git User
run: |
git config --global user.name "google-oss-bot"
git config --global user.email "[email protected]"
- name: Create Release Pull Request
uses: changesets/action@a45c4d594aa4e2c509dc14a9f2b3b67ba3780d0d # ratchet:changesets/action@v1
with:
# changesets action can automatically set up a git user
# but it will be google-actions[bot] which causes CLA problems
setupGitUser: false
env:
# This token affects who the opening of the PR is credited to
# while the git user (above) determines the commit author.
# We want to set them both to match github-oss-bot.
GITHUB_TOKEN: ${{ secrets.OSS_BOT_GITHUB_TOKEN }}
-170
View File
@@ -1,170 +0,0 @@
# 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: Production Release
on:
workflow_dispatch:
inputs:
release-branch:
description: 'Release branch'
type: string
default: 'release'
required: true
jobs:
deploy:
environment: release
name: Production Release
runs-on: ubuntu-latest
# Allow GITHUB_TOKEN to have write permissions
permissions:
contents: write
steps:
- name: Set up node (22)
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # ratchet:actions/setup-node@v4
with:
node-version: 22.12.0
- name: Checkout release branch (with history)
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # ratchet:actions/checkout@v4
with:
# Release script requires git history and tags.
fetch-depth: 0
ref: ${{ github.event.inputs.release-branch }}
persist-credentials: false
- name: Yarn install
run: yarn
- name: Publish to NPM
# --skipTests No need to run tests
# --skipReinstall Yarn install has already been run
# --ignoreUnstaged Adding the @firebase/app changeset file means
# there's unstaged changes. Ignore.
# TODO: Make these flags defaults in the release script.
run: yarn release --releaseType Production --ci --skipTests --skipReinstall --ignoreUnstaged
env:
NPM_TOKEN_ANALYTICS: ${{secrets.NPM_TOKEN_ANALYTICS}}
NPM_TOKEN_ANALYTICS_INTEROP_TYPES: ${{secrets.NPM_TOKEN_ANALYTICS_INTEROP_TYPES}}
NPM_TOKEN_ANALYTICS_TYPES: ${{secrets.NPM_TOKEN_ANALYTICS_TYPES}}
NPM_TOKEN_APP: ${{secrets.NPM_TOKEN_APP}}
NPM_TOKEN_APP_TYPES: ${{secrets.NPM_TOKEN_APP_TYPES}}
NPM_TOKEN_APP_CHECK: ${{secrets.NPM_TOKEN_APP_CHECK}}
NPM_TOKEN_APP_CHECK_INTEROP_TYPES: ${{secrets.NPM_TOKEN_APP_CHECK_INTEROP_TYPES}}
NPM_TOKEN_APP_CHECK_TYPES: ${{secrets.NPM_TOKEN_APP_CHECK_TYPES}}
NPM_TOKEN_AUTH: ${{secrets.NPM_TOKEN_AUTH}}
NPM_TOKEN_AUTH_INTEROP_TYPES: ${{secrets.NPM_TOKEN_AUTH_INTEROP_TYPES}}
NPM_TOKEN_AUTH_TYPES: ${{secrets.NPM_TOKEN_AUTH_TYPES}}
NPM_TOKEN_COMPONENT: ${{secrets.NPM_TOKEN_COMPONENT}}
NPM_TOKEN_DATA_CONNECT: ${{secrets.NPM_TOKEN_DATA_CONNECT}}
NPM_TOKEN_DATABASE: ${{secrets.NPM_TOKEN_DATABASE}}
NPM_TOKEN_DATABASE_TYPES: ${{secrets.NPM_TOKEN_DATABASE_TYPES}}
NPM_TOKEN_FIRESTORE: ${{secrets.NPM_TOKEN_FIRESTORE}}
NPM_TOKEN_FIRESTORE_TYPES: ${{secrets.NPM_TOKEN_FIRESTORE_TYPES}}
NPM_TOKEN_FUNCTIONS: ${{secrets.NPM_TOKEN_FUNCTIONS}}
NPM_TOKEN_FUNCTIONS_TYPES: ${{secrets.NPM_TOKEN_FUNCTIONS_TYPES}}
NPM_TOKEN_INSTALLATIONS: ${{secrets.NPM_TOKEN_INSTALLATIONS}}
NPM_TOKEN_INSTALLATIONS_TYPES: ${{secrets.NPM_TOKEN_INSTALLATIONS_TYPES}}
NPM_TOKEN_LOGGER: ${{secrets.NPM_TOKEN_LOGGER}}
NPM_TOKEN_MESSAGING: ${{secrets.NPM_TOKEN_MESSAGING}}
NPM_TOKEN_PERFORMANCE: ${{secrets.NPM_TOKEN_PERFORMANCE}}
NPM_TOKEN_PERFORMANCE_TYPES: ${{secrets.NPM_TOKEN_PERFORMANCE_TYPES}}
NPM_TOKEN_REMOTE_CONFIG: ${{secrets.NPM_TOKEN_REMOTE_CONFIG}}
NPM_TOKEN_REMOTE_CONFIG_TYPES: ${{secrets.NPM_TOKEN_REMOTE_CONFIG_TYPES}}
NPM_TOKEN_RULES_UNIT_TESTING: ${{secrets.NPM_TOKEN_RULES_UNIT_TESTING}}
NPM_TOKEN_STORAGE: ${{secrets.NPM_TOKEN_STORAGE}}
NPM_TOKEN_STORAGE_TYPES: ${{secrets.NPM_TOKEN_STORAGE_TYPES}}
NPM_TOKEN_UTIL: ${{secrets.NPM_TOKEN_UTIL}}
NPM_TOKEN_AI: ${{secrets.NPM_TOKEN_AI}}
NPM_TOKEN_VERTEXAI: ${{secrets.NPM_TOKEN_VERTEXAI}}
NPM_TOKEN_WEBCHANNEL_WRAPPER: ${{secrets.NPM_TOKEN_WEBCHANNEL_WRAPPER}}
NPM_TOKEN_FIREBASE: ${{secrets.NPM_TOKEN_FIREBASE}}
NPM_TOKEN_APP_COMPAT: ${{ secrets.NPM_TOKEN_APP_COMPAT }}
NPM_TOKEN_INSTALLATIONS_COMPAT: ${{ secrets.NPM_TOKEN_INSTALLATIONS_COMPAT }}
NPM_TOKEN_ANALYTICS_COMPAT: ${{ secrets.NPM_TOKEN_ANALYTICS_COMPAT }}
NPM_TOKEN_AUTH_COMPAT: ${{ secrets.NPM_TOKEN_AUTH_COMPAT }}
NPM_TOKEN_MESSAGING_INTEROP_TYPES: ${{ secrets.NPM_TOKEN_MESSAGING_INTEROP_TYPES }}
NPM_TOKEN_FUNCTIONS_COMPAT: ${{ secrets.NPM_TOKEN_FUNCTIONS_COMPAT }}
NPM_TOKEN_MESSAGING_COMPAT: ${{ secrets.NPM_TOKEN_MESSAGING_COMPAT }}
NPM_TOKEN_PERFORMANCE_COMPAT: ${{ secrets.NPM_TOKEN_PERFORMANCE_COMPAT }}
NPM_TOKEN_REMOTE_CONFIG_COMPAT: ${{ secrets.NPM_TOKEN_REMOTE_CONFIG_COMPAT }}
NPM_TOKEN_DATABASE_COMPAT: ${{ secrets.NPM_TOKEN_DATABASE_COMPAT }}
NPM_TOKEN_FIRESTORE_COMPAT: ${{ secrets.NPM_TOKEN_FIRESTORE_COMPAT }}
NPM_TOKEN_STORAGE_COMPAT: ${{ secrets.NPM_TOKEN_STORAGE_COMPAT }}
NPM_TOKEN_APP_CHECK_COMPAT: ${{ secrets.NPM_TOKEN_APP_CHECK_COMPAT }}
NPM_TOKEN_API_DOCUMENTER: ${{ secrets.NPM_TOKEN_API_DOCUMENTER }}
CI: true
- name: Get release version
id: get-version
# In production, there is only one version number
run: |
VERSION_SCRIPT="const pkg = require('./packages/firebase/package.json'); console.log(pkg.version);"
VERSION=`node -e "${VERSION_SCRIPT}"`
echo "BASE_VERSION=$VERSION" >> $GITHUB_OUTPUT
- name: Echo version in shell
run: |
echo "Base version: ${STEPS_GET_VERSION_OUTPUTS_BASE_VERSION}"
env:
STEPS_GET_VERSION_OUTPUTS_BASE_VERSION: ${{ steps.get-version.outputs.BASE_VERSION }}
- name: Log to release tracker
# Sends release information to cloud functions endpoint of release tracker.
run: |
DATE=$(date +'%m/%d/%Y')
BASE_VERSION=${STEPS_GET_VERSION_OUTPUTS_BASE_VERSION}
RELEASE_TRACKER_URL=${{ secrets.RELEASE_TRACKER_URL }}
curl -X POST -H "Content-Type:application/json" \
-d "{\"version\":\"$BASE_VERSION\",\"date\":\"$DATE\"}" \
$RELEASE_TRACKER_URL/logProduction
env:
STEPS_GET_VERSION_OUTPUTS_BASE_VERSION: ${{ steps.get-version.outputs.BASE_VERSION }}
- name: Publish git tags
# This commonly runs into permissions errors. Should not block the rest
# of the workflow. But should fail workflow so we notice it. So putting
# near the end.
run: yarn ts-node scripts/release/publish-git-tags.ts
# The script injects this token into the git push command
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create GitHub release
# Depends on generated tag above.
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
# Get the newest release tag for the firebase package (e.g. [email protected])
NEWEST_TAG=$(git describe --tags --match "firebase@[0-9]*.[0-9]*.[0-9]*" --abbrev=0)
# Get the release notes from the description of the most recent merged PR into the "release" branch
# See: https://github.com/firebase/firebase-js-sdk/pull/8236 for an example description
JSON_RELEASE_NOTES=$(gh pr list \
--repo "$GITHUB_REPOSITORY" \
--state "merged" \
--base "release" \
--limit 1 \
--json "body" \
| jq '.[].body | split("\n# Releases\n")[-1]' # Remove the generated changesets header
)
# Prepend the new release header
# We have to be careful to insert the new release header after a " character, since we're
# modifying the JSON string
JSON_RELEASE_NOTES="\"For more detailed release notes, see [Firebase JavaScript SDK Release Notes](https://firebase.google.com/support/release-notes/js).\n\n# What's Changed\n\n${JSON_RELEASE_NOTES:1}"
# Format the JSON string into a readable markdown string
RELEASE_NOTES=$(echo -E $JSON_RELEASE_NOTES | jq -r .)
# Create the GitHub release
gh release create "$NEWEST_TAG" \
--repo "$GITHUB_REPOSITORY" \
--title "$NEWEST_TAG" \
--notes "$RELEASE_NOTES" \
--verify-tag
-200
View File
@@ -1,200 +0,0 @@
# 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: Staging Release
permissions:
contents: read
on:
workflow_dispatch:
inputs:
release-branch:
description: 'Release branch'
type: string
default: 'release'
required: true
source-branch:
description: 'Branch to release from'
type: choice
default: 'main'
required: true
options:
- main
- v8
- at-11-7-1
verbose:
description: 'Enable verbose logging'
type: boolean
default: false
env:
# Bump Node memory limit
NODE_OPTIONS: "--max_old_space_size=4096"
jobs:
deploy:
environment: release
name: Staging Release
runs-on: ubuntu-latest
# Block this workflow if run on a non-release branch.
if: github.event.inputs.release-branch == 'release' || endsWith(github.event.inputs.release-branch, '-releasebranch')
steps:
- name: Set up node (22)
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # ratchet:actions/setup-node@v4
with:
node-version: 22.12.0
- name: Merge main into release
uses: actions/github-script@f28e40c7f34bde8b3046d885e986cb6290c5673b # ratchet:actions/github-script@v7
with:
github-token: ${{ secrets.OSS_BOT_GITHUB_TOKEN }}
script: |
const result = await github.rest.repos.merge({
owner: context.repo.owner,
repo: context.repo.repo,
base: process.env.RELEASE_BRANCH,
head: process.env.SOURCE_BRANCH
})
console.log(result)
env:
RELEASE_BRANCH: ${{ github.event.inputs.release-branch }}
SOURCE_BRANCH: ${{ github.event.inputs.source-branch }}
- name: Checkout current branch (with history)
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # ratchet:actions/checkout@v4
with:
# Release script requires git history and tags.
fetch-depth: 0
ref: ${{ github.event.inputs.release-branch }}
persist-credentials: false
- name: Yarn install
run: yarn
- name: Publish to NPM
# --skipTests No need to run tests
# --skipReinstall Yarn install has already been run
# --ignoreUnstaged Adding the @firebase/app changeset file means
# there's unstaged changes. Ignore.
# TODO: Make these flags defaults in the release script.
run: yarn release --releaseType Staging --ci --skipTests --skipReinstall --ignoreUnstaged
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN_ANALYTICS: ${{secrets.NPM_TOKEN_ANALYTICS}}
NPM_TOKEN_ANALYTICS_INTEROP_TYPES: ${{secrets.NPM_TOKEN_ANALYTICS_INTEROP_TYPES}}
NPM_TOKEN_ANALYTICS_TYPES: ${{secrets.NPM_TOKEN_ANALYTICS_TYPES}}
NPM_TOKEN_APP: ${{secrets.NPM_TOKEN_APP}}
NPM_TOKEN_APP_TYPES: ${{secrets.NPM_TOKEN_APP_TYPES}}
NPM_TOKEN_APP_CHECK: ${{secrets.NPM_TOKEN_APP_CHECK}}
NPM_TOKEN_APP_CHECK_INTEROP_TYPES: ${{secrets.NPM_TOKEN_APP_CHECK_INTEROP_TYPES}}
NPM_TOKEN_APP_CHECK_TYPES: ${{secrets.NPM_TOKEN_APP_CHECK_TYPES}}
NPM_TOKEN_AUTH: ${{secrets.NPM_TOKEN_AUTH}}
NPM_TOKEN_AUTH_INTEROP_TYPES: ${{secrets.NPM_TOKEN_AUTH_INTEROP_TYPES}}
NPM_TOKEN_AUTH_TYPES: ${{secrets.NPM_TOKEN_AUTH_TYPES}}
NPM_TOKEN_COMPONENT: ${{secrets.NPM_TOKEN_COMPONENT}}
NPM_TOKEN_DATA_CONNECT: ${{secrets.NPM_TOKEN_DATA_CONNECT}}
NPM_TOKEN_DATABASE: ${{secrets.NPM_TOKEN_DATABASE}}
NPM_TOKEN_DATABASE_TYPES: ${{secrets.NPM_TOKEN_DATABASE_TYPES}}
NPM_TOKEN_FIRESTORE: ${{secrets.NPM_TOKEN_FIRESTORE}}
NPM_TOKEN_FIRESTORE_TYPES: ${{secrets.NPM_TOKEN_FIRESTORE_TYPES}}
NPM_TOKEN_FUNCTIONS: ${{secrets.NPM_TOKEN_FUNCTIONS}}
NPM_TOKEN_FUNCTIONS_TYPES: ${{secrets.NPM_TOKEN_FUNCTIONS_TYPES}}
NPM_TOKEN_INSTALLATIONS: ${{secrets.NPM_TOKEN_INSTALLATIONS}}
NPM_TOKEN_INSTALLATIONS_TYPES: ${{secrets.NPM_TOKEN_INSTALLATIONS_TYPES}}
NPM_TOKEN_LOGGER: ${{secrets.NPM_TOKEN_LOGGER}}
NPM_TOKEN_MESSAGING: ${{secrets.NPM_TOKEN_MESSAGING}}
NPM_TOKEN_PERFORMANCE: ${{secrets.NPM_TOKEN_PERFORMANCE}}
NPM_TOKEN_PERFORMANCE_TYPES: ${{secrets.NPM_TOKEN_PERFORMANCE_TYPES}}
NPM_TOKEN_REMOTE_CONFIG: ${{secrets.NPM_TOKEN_REMOTE_CONFIG}}
NPM_TOKEN_REMOTE_CONFIG_TYPES: ${{secrets.NPM_TOKEN_REMOTE_CONFIG_TYPES}}
NPM_TOKEN_RULES_UNIT_TESTING: ${{secrets.NPM_TOKEN_RULES_UNIT_TESTING}}
NPM_TOKEN_STORAGE: ${{secrets.NPM_TOKEN_STORAGE}}
NPM_TOKEN_STORAGE_TYPES: ${{secrets.NPM_TOKEN_STORAGE_TYPES}}
NPM_TOKEN_UTIL: ${{secrets.NPM_TOKEN_UTIL}}
NPM_TOKEN_AI: ${{secrets.NPM_TOKEN_AI}}
NPM_TOKEN_VERTEXAI: ${{secrets.NPM_TOKEN_VERTEXAI}}
NPM_TOKEN_WEBCHANNEL_WRAPPER: ${{secrets.NPM_TOKEN_WEBCHANNEL_WRAPPER}}
NPM_TOKEN_FIREBASE: ${{secrets.NPM_TOKEN_FIREBASE}}
NPM_TOKEN_APP_COMPAT: ${{ secrets.NPM_TOKEN_APP_COMPAT }}
NPM_TOKEN_INSTALLATIONS_COMPAT: ${{ secrets.NPM_TOKEN_INSTALLATIONS_COMPAT }}
NPM_TOKEN_ANALYTICS_COMPAT: ${{ secrets.NPM_TOKEN_ANALYTICS_COMPAT }}
NPM_TOKEN_AUTH_COMPAT: ${{ secrets.NPM_TOKEN_AUTH_COMPAT }}
NPM_TOKEN_MESSAGING_INTEROP_TYPES: ${{ secrets.NPM_TOKEN_MESSAGING_INTEROP_TYPES }}
NPM_TOKEN_FUNCTIONS_COMPAT: ${{ secrets.NPM_TOKEN_FUNCTIONS_COMPAT }}
NPM_TOKEN_MESSAGING_COMPAT: ${{ secrets.NPM_TOKEN_MESSAGING_COMPAT }}
NPM_TOKEN_PERFORMANCE_COMPAT: ${{ secrets.NPM_TOKEN_PERFORMANCE_COMPAT }}
NPM_TOKEN_REMOTE_CONFIG_COMPAT: ${{ secrets.NPM_TOKEN_REMOTE_CONFIG_COMPAT }}
NPM_TOKEN_DATABASE_COMPAT: ${{ secrets.NPM_TOKEN_DATABASE_COMPAT }}
NPM_TOKEN_FIRESTORE_COMPAT: ${{ secrets.NPM_TOKEN_FIRESTORE_COMPAT }}
NPM_TOKEN_STORAGE_COMPAT: ${{ secrets.NPM_TOKEN_STORAGE_COMPAT }}
NPM_TOKEN_APP_CHECK_COMPAT: ${{ secrets.NPM_TOKEN_APP_CHECK_COMPAT }}
NPM_TOKEN_API_DOCUMENTER: ${{ secrets.NPM_TOKEN_API_DOCUMENTER }}
CI: true
VERBOSE_NPM_LOGGING: ${{github.event.inputs.verbose}}
- name: Get release version
id: get-version
# STAGING_VERSION = version with staging hash, e.g. 1.2.3-20430523
# BASE_VERSION = version without staging hash, e.g. 1.2.3
run: |
VERSION_SCRIPT="const pkg = require('./packages/firebase/package.json'); console.log(pkg.version);"
VERSION=`node -e "${VERSION_SCRIPT}"`
echo "STAGING_VERSION=$VERSION" >> $GITHUB_OUTPUT
BASE_VERSION=$(echo $VERSION | cut -d "-" -f 1)
echo "BASE_VERSION=$BASE_VERSION" >> $GITHUB_OUTPUT
- name: Echo versions in shell
run: |
echo "Staging release ${STEPS_GET_VERSION_OUTPUTS_STAGING_VERSION}"
echo "Base version: ${STEPS_GET_VERSION_OUTPUTS_BASE_VERSION}"
env:
STEPS_GET_VERSION_OUTPUTS_STAGING_VERSION: ${{ steps.get-version.outputs.STAGING_VERSION }}
STEPS_GET_VERSION_OUTPUTS_BASE_VERSION: ${{ steps.get-version.outputs.BASE_VERSION }}
- name: Launch E2E tests workflow
# Trigger e2e-test.yml
run: |
OSS_BOT_GITHUB_TOKEN=${{ secrets.OSS_BOT_GITHUB_TOKEN }}
VERSION_OR_TAG=${STEPS_GET_VERSION_OUTPUTS_STAGING_VERSION}
curl -X POST \
-H "Content-Type:application/json" \
-H "Accept:application/vnd.github.v3+json" \
-H "Authorization:Bearer $OSS_BOT_GITHUB_TOKEN" \
-d "{\"event_type\":\"staging-tests\", \"client_payload\":{\"versionOrTag\":\"$VERSION_OR_TAG\"}}" \
https://api.github.com/repos/firebase/firebase-js-sdk/dispatches
env:
STEPS_GET_VERSION_OUTPUTS_STAGING_VERSION: ${{ steps.get-version.outputs.STAGING_VERSION }}
- name: Check for changes requiring a reference doc publish
id: docs-check
# If a diff is found (length of DIFF_CONTENTS > 0) it will write DOCS_NEEDED=true
run: |
LAST_PUBLISHED_VERSION=$(npm info firebase version)
DIFF_CONTENTS=$(git diff firebase@$LAST_PUBLISHED_VERSION HEAD docs-devsite)
if [ -n "$DIFF_CONTENTS" ]
then
echo "DOCS_NEEDED=true" >> $GITHUB_OUTPUT
else
echo "DOCS_NEEDED=false" >> $GITHUB_OUTPUT
fi
- name: Log to release tracker
# Sends release information to cloud functions endpoint of release tracker.
if: ${{ always() }}
run: |
DATE=$(date +'%m/%d/%Y')
BASE_VERSION=${STEPS_GET_VERSION_OUTPUTS_BASE_VERSION}
STAGING_VERSION=${STEPS_GET_VERSION_OUTPUTS_STAGING_VERSION}
OPERATOR=${GITHUB_ACTOR}
RELEASE_TRACKER_URL=${{ secrets.RELEASE_TRACKER_URL }}
DOCS_NEEDED=${STEPS_DOCS_CHECK_OUTPUTS_DOCS_NEEDED}
curl -X POST -H "Content-Type:application/json" \
-d "{\"version\":\"$BASE_VERSION\",\"tag\":\"$STAGING_VERSION\",\"date\":\"$DATE\",\"operator\":\"$OPERATOR\",\"docs_needed\":\"$DOCS_NEEDED\"}" \
$RELEASE_TRACKER_URL/logStaging
env:
STEPS_GET_VERSION_OUTPUTS_BASE_VERSION: ${{ steps.get-version.outputs.BASE_VERSION }}
STEPS_GET_VERSION_OUTPUTS_STAGING_VERSION: ${{ steps.get-version.outputs.STAGING_VERSION }}
STEPS_DOCS_CHECK_OUTPUTS_DOCS_NEEDED: ${{ steps.docs-check.outputs.DOCS_NEEDED }}
-296
View File
@@ -1,296 +0,0 @@
# 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: Test All Packages
on:
pull_request:
push:
branches:
- main
permissions:
contents: read
env:
# make chromedriver detect installed Chrome version and download the corresponding driver
DETECT_CHROMEDRIVER_VERSION: true
# The default behavior of chromedriver uses the older Chrome download URLs. We need to override
# the behavior to use the new URLs.
CHROMEDRIVER_CDNURL: https://googlechromelabs.github.io/
CHROMEDRIVER_CDNBINARIESURL: https://storage.googleapis.com/chrome-for-testing-public
CHROME_VALIDATED_VERSION: linux-132.0.6834.110
CHROME_VERSION_MISMATCH_MESSAGE: "The Chrome version doesn't match the previously validated version. Consider updating CHROME_VALIDATED_VERSION in the GitHub workflow if tests pass, or rollback the installed Chrome version if tests fail."
artifactRetentionDays: 14
# Bump Node memory limit
NODE_OPTIONS: "--max_old_space_size=4096"
jobs:
build:
name: Build the SDK
runs-on: ubuntu-latest
steps:
# Install Chrome so the correct version of webdriver can be installed by chromedriver when
# setting up the repo. This must be done to build and execute Auth properly.
- name: install Chrome stable
run: |
npx @puppeteer/browsers install chrome@stable
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # ratchet:actions/checkout@v4
with:
persist-credentials: false
- name: Set up Node (22)
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # ratchet:actions/setup-node@v4
with:
node-version: 22.12.0
- name: Test setup and yarn install
run: |
cp config/ci.config.json config/project.json
yarn
- name: yarn build
run: yarn build
- name: Archive build
if: ${{ !cancelled() }}
run: |
tar -cf build.tar --exclude=.git .
gzip build.tar
- name: Upload build archive
if: ${{ !cancelled() }}
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # ratchet:actions/upload-artifact@v4
with:
name: build.tar.gz
path: build.tar.gz
retention-days: ${{ env.artifactRetentionDays }}
# Auth and Firestore are built and executed in their own jobs in an attempt to reduce flakiness.
test-the-rest:
name: (bulk) Node.js and Browser (Chrome) Tests
needs: build
runs-on: ubuntu-latest
steps:
# install Chrome first, so the correct version of webdriver can be installed by chromedriver when setting up the repo
- name: install Chrome stable
run: |
npx @puppeteer/browsers install chrome@stable
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # ratchet:actions/checkout@v4
with:
persist-credentials: false
- name: Download build archive
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # ratchet:actions/download-artifact@v4
with:
name: build.tar.gz
- name: Unzip build artifact
run: tar xf build.tar.gz
- name: Set up Node (22)
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # ratchet:actions/setup-node@v4
with:
node-version: 22.12.0
# firebase-tools has a minimum java version requirement and is called by
# rules-unit-testing tests
- name: Set up Java (22)
uses: actions/setup-java@03ad4de0992f5dab5e18fcb136590ce7c4a0ac95 # v5.6.0
with:
distribution: 'temurin'
java-version: '22'
- name: Test setup and yarn install
run: |
cp config/ci.config.json config/project.json
yarn
- name: Set start timestamp env var
run: echo "FIREBASE_CI_TEST_START_TIME=$(date +%s)" >> $GITHUB_ENV
- name: Run unit tests
# Ignore auth and firestore since they're handled in their own separate jobs.
run: |
xvfb-run yarn lerna run --ignore '{firebase-messaging-integration-test,@firebase/auth*,@firebase/firestore*,firebase-firestore-integration-test}' test:ci
node scripts/print_test_logs.js
env:
FIREBASE_TOKEN: ${{ secrets.FIREBASE_CLI_TOKEN }}
- name: Generate coverage file
run: yarn ci:coverage
- name: Merge and fix coverage files for test-the-rest
run: |
# Clear out any existing master file just in case
> ./lcov-all.info
# Find all LCOV files across all packages
find ./packages -type f -name "lcov.info" | while read lcov_file; do
# lcov_file looks like: ./packages/analytics/coverage/lcov.info
# Extract the package name (the 3rd part of the path split by '/')
PKG_NAME=$(echo "$lcov_file" | cut -d'/' -f3)
# Fix the path for this specific package and append it to the master file
sed "s|SF:src/|SF:packages/$PKG_NAME/src/|g" "$lcov_file" >> ./lcov-all.info
done
- name: Run coverage
uses: coverallsapp/github-action@09b709cf6a16e30b0808ba050c7a6e8a5ef13f8d # ratchet:coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: ./lcov-all.info
flag-name: test-the-rest-coverage
parallel: true
continue-on-error: true
test-auth:
name: (Auth) Node.js and Browser (Chrome) Tests
needs: build
runs-on: ubuntu-latest
steps:
# install Chrome first, so the correct version of webdriver can be installed by chromedriver
# when setting up the repo
- name: install Chrome stable
run: |
npx @puppeteer/browsers install chrome@stable
chromeVersionString=$(ls chrome)
if [ "$CHROME_VALIDATED_VERSION" != "$chromeVersionString" ]; then
echo "::warning ::${CHROME_VERSION_MISMATCH_MESSAGE}"
echo "::warning ::Previously validated version: ${CHROME_VALIDATED_VERSION} vs. Installed version: $chromeVersionString"
fi
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # ratchet:actions/checkout@v4
with:
persist-credentials: false
- name: Download build archive
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # ratchet:actions/download-artifact@v4
with:
name: build.tar.gz
- name: Unzip build artifact
run: tar xf build.tar.gz
- name: Set up Node (22)
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # ratchet:actions/setup-node@v4
with:
node-version: 22.12.0
- name: Test setup and yarn install
run: |
cp config/ci.config.json config/project.json
yarn
- name: Set start timestamp env var
run: echo "FIREBASE_CI_TEST_START_TIME=$(date +%s)" >> $GITHUB_ENV
- name: Run unit tests
run: |
xvfb-run yarn lerna run test:ci --scope '@firebase/auth*'
node scripts/print_test_logs.js
env:
FIREBASE_TOKEN: ${{ secrets.FIREBASE_CLI_TOKEN }}
- name: Generate coverage file
run: yarn ci:coverage
- name: Merge and fix coverage files for test-auth
run: |
# 1. Smash all Node and Browser coverage files into one giant file
find ./packages/auth/coverage -type f -name "lcov.info" -exec cat {} + > ./lcov-all-auth.info
# 2. Fix standard Node paths
sed -i 's|SF:src/|SF:packages/auth/src/|g' ./lcov-all-auth.info
- name: Run coverage
uses: coverallsapp/github-action@09b709cf6a16e30b0808ba050c7a6e8a5ef13f8d # ratchet:coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: ./lcov-all-auth.info
flag-name: test-auth-coverage
parallel: true
continue-on-error: true
test-firestore:
name: (Firestore) Node.js and Browser (Chrome) Tests
needs: build
runs-on: ubuntu-latest
steps:
# install Chrome so the correct version of webdriver can be installed by chromedriver when setting up the repo
- name: install Chrome stable
run: |
npx @puppeteer/browsers install chrome@stable
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # ratchet:actions/checkout@v4
with:
persist-credentials: false
- name: Download build archive
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # ratchet:actions/download-artifact@v4
with:
name: build.tar.gz
- name: Unzip build artifact
run: tar xf build.tar.gz
- name: Set up Node (22)
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # ratchet:actions/setup-node@v4
with:
node-version: 22.12.0
- name: Test setup and yarn install
run: |
cp config/ci.config.json config/project.json
yarn
- name: Set start timestamp env var
run: echo "FIREBASE_CI_TEST_START_TIME=$(date +%s)" >> $GITHUB_ENV
- name: Run unit tests
run: |
yarn lerna run test:all:ci --scope '@firebase/firestore*' --stream --concurrency 1
env:
FIREBASE_TOKEN: ${{ secrets.FIREBASE_CLI_TOKEN }}
EXPERIMENTAL_MODE: true
- name: Generate coverage file
run: yarn ci:coverage
- name: Merge and fix coverage files for test-firestore
run: |
# 1. Smash all Node and Browser coverage files into one giant file
find ./packages/firestore/coverage -type f -name "lcov.info" -exec cat {} + > ./lcov-all-firestore.info
# 2. Fix standard Node paths
sed -i 's|SF:src/|SF:packages/firestore/src/|g' ./lcov-all-firestore.info
- name: Run coverage
uses: coverallsapp/github-action@09b709cf6a16e30b0808ba050c7a6e8a5ef13f8d # ratchet:coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: ./lcov-all-firestore.info
flag-name: test-firestore-coverage
parallel: true
continue-on-error: true
test-firestore-integration:
strategy:
fail-fast: false
matrix:
persistence: ['memory', 'persistence']
name: Firestore Integration Tests (${{ matrix.persistence }})
needs: build
runs-on: ubuntu-latest
steps:
# install Chrome so the correct version of webdriver can be installed by chromedriver when setting up the repo
- name: install Chrome stable
run: |
npx @puppeteer/browsers install chrome@stable
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # ratchet:actions/checkout@v4
with:
persist-credentials: false
- name: Download build archive
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # ratchet:actions/download-artifact@v4
with:
name: build.tar.gz
- name: Unzip build artifact
run: tar xf build.tar.gz
- name: Set up Node (22)
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # ratchet:actions/setup-node@v4
with:
node-version: 22.12.0
- run: cp config/ci.config.json config/project.json
- run: yarn
- run: yarn build:${{ matrix.persistence }}
working-directory: integration/firestore
- run: xvfb-run yarn karma:singlerun
working-directory: integration/firestore
env:
FIREBASE_TOKEN: ${{ secrets.FIREBASE_CLI_TOKEN }}
coveralls-finish:
name: Finalize Coveralls
needs: [test-the-rest, test-auth, test-firestore]
runs-on: ubuntu-latest
steps:
- name: Coveralls Finished
uses: coverallsapp/github-action@09b709cf6a16e30b0808ba050c7a6e8a5ef13f8d # ratchet:coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
parallel-finished: true
-138
View File
@@ -1,138 +0,0 @@
# 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: Test Auth
on: pull_request
permissions:
contents: read
env:
# make chromedriver detect installed Chrome version and download the corresponding driver
DETECT_CHROMEDRIVER_VERSION: true
# The default behavior of chromedriver uses the older Chrome download URLs. We need to override
# the behavior to use the new URLs.
CHROMEDRIVER_CDNURL: https://googlechromelabs.github.io/
CHROMEDRIVER_CDNBINARIESURL: https://storage.googleapis.com/chrome-for-testing-public
CHROME_VALIDATED_VERSION: linux-120.0.6099.71
# Bump Node memory limit
NODE_OPTIONS: "--max_old_space_size=4096"
jobs:
test-chrome:
name: Test Auth on Chrome and Node If Changed
runs-on: ubuntu-latest
steps:
# install Chrome first, so the correct version of webdriver can be installed by chromedriver
# when setting up the repo
#
# Note: we only need to check the chrome version change in one job as the warning annotation
# is appended to the entire workflow results, not just this job's results.
- name: install Chrome stable
env:
CHROME_VERSION_MISMATCH_MESSAGE: "The Chrome version doesn't match the previously validated version. Consider updating CHROME_VALIDATED_VERSION in the GitHub workflow if tests pass."
run: |
npx @puppeteer/browsers install chrome@stable
chromeVersionString=$(ls chrome)
if [ "$CHROME_VALIDATED_VERSION" != "$chromeVersionString" ]; then
echo "::warning ::The Chrome version doesn't match the previously validated version. Consider updating CHROME_VALIDATED_VERSION in the GitHub workflow if tests pass."
echo "::warning ::Previously validated version: ${CHROME_VALIDATED_VERSION} vs. Installed version: $chromeVersionString"
echo "CHROME_VERSION_NOTES=$CHROME_VERSION_MISMATCH_MESSAGE" >> "$GITHUB_ENV"
fi
- name: Test Evn TEMP
run: |
echo $CHROME_VERSION_NOTES=$CHROME_VERSION_MISMATCH_MESSAGE
- name: Checkout Repo
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # ratchet:actions/checkout@v4
with:
# This makes Actions fetch all Git history so run-changed script can diff properly.
fetch-depth: 0
persist-credentials: false
- name: Set up Node (22)
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # ratchet:actions/setup-node@v4
with:
node-version: 22.12.0
# firebase-tools has a minimum java version requirement
- name: Set up Java (22)
uses: actions/setup-java@03ad4de0992f5dab5e18fcb136590ce7c4a0ac95 # v5.6.0
with:
distribution: 'temurin'
java-version: '22'
- name: Test setup and yarn install
run: |
cp config/ci.config.json config/project.json
yarn
- name: build
run: yarn build:changed auth
- name: Run tests on changed packages
run: xvfb-run yarn test:changed auth --concurrency 1
test-firefox:
name: Test Auth on Firefox If Changed
runs-on: ubuntu-latest
steps:
- name: install Firefox stable
run: npx @puppeteer/browsers install firefox@stable
- name: Checkout Repo
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # ratchet:actions/checkout@v4
with:
# This makes Actions fetch all Git history so run-changed script can diff properly.
fetch-depth: 0
persist-credentials: false
- name: Set up Node (22)
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # ratchet:actions/setup-node@v4
with:
node-version: 22.12.0
- name: Test setup and yarn install
env:
CHROMEDRIVER_SKIP_DOWNLOAD: true
run: |
cp config/ci.config.json config/project.json
yarn
- name: build
run: yarn build:changed auth
- name: Run tests on auth changed packages
run: xvfb-run yarn test:changed auth --concurrency 1
env:
BROWSERS: 'Firefox'
test-webkit:
name: Test Auth on Webkit if Changed
runs-on: macos-latest
steps:
- name: Checkout Repo
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # ratchet:actions/checkout@v4
with:
fetch-depth: 0
persist-credentials: false
- name: Set up Node (22)
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # ratchet:actions/setup-node@v4
with:
node-version: 22.12.0
- name: Test setup and yarn install
env:
CHROMEDRIVER_SKIP_DOWNLOAD: true
run: |
cp config/ci.config.json config/project.json
yarn
npx playwright install webkit
- name: build
run: yarn build:changed auth
- name: Run tests on changed packages
run: yarn test:changed auth --concurrency 1
env:
BROWSERS: 'WebkitHeadless'
@@ -1,56 +0,0 @@
# 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: Test FCM integration
on: pull_request
permissions:
contents: read
env:
# make chromedriver detect installed Chrome version and download the corresponding driver
DETECT_CHROMEDRIVER_VERSION: true
# Bump Node memory limit
NODE_OPTIONS: "--max_old_space_size=4096"
jobs:
test:
name: Test FCM integration If Changed
runs-on: ubuntu-latest
steps:
# install Chrome first, so the correct version of webdriver can be installed by chromedriver when setting up the repo
- name: install Chrome stable
run: |
sudo apt-get update
sudo apt-get install google-chrome-stable
- name: Checkout Repo
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # ratchet:actions/checkout@v4
with:
# This makes Actions fetch all Git history so run-changed script can diff properly.
fetch-depth: 0
persist-credentials: false
- name: Set up Node (22)
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # ratchet:actions/setup-node@v4
with:
node-version: 22.12.0
- name: Test setup and yarn install
run: |
cp config/ci.config.json config/project.json
yarn
- name: build
run: yarn build:changed fcm-integration
- name: Run tests if FCM or its dependencies has changed
run: xvfb-run yarn test:changed fcm-integration
@@ -1,90 +0,0 @@
# 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: Test Firestore Integration
on: pull_request
permissions:
contents: read
env:
# Bump Node memory limit
NODE_OPTIONS: "--max_old_space_size=4096"
jobs:
test:
name: Test Firestore Integration If Changed
runs-on: ubuntu-latest
env:
run_terraform_steps: ${{ secrets.JSSDK_ACTIONS_SA_KEY != '' }}
steps:
- name: Checkout Repo
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # ratchet:actions/checkout@v4
with:
# This makes Actions fetch all Git history so run-changed script can diff properly.
fetch-depth: 0
persist-credentials: false
# This commit represents v0.8.3
- uses: 'google-github-actions/auth@fc2174804b84f912b1f6d334e9463f484f1c552d'
if: ${{ fromJSON(env.run_terraform_steps) }}
with:
credentials_json: '${{ secrets.JSSDK_ACTIONS_SA_KEY }}'
# create composite indexes with Terraform
- name: Setup Terraform
if: ${{ fromJSON(env.run_terraform_steps) }}
# This commit represents v3.1.2
uses: hashicorp/setup-terraform@b9cd54a3c349d3f38e8881555d616ced269862dd
- name: Terraform Init
if: ${{ fromJSON(env.run_terraform_steps) }}
run: |
cp config/ci.config.json config/project.json
cd packages/firestore
terraform init
continue-on-error: true
- name: Terraform Apply
if: github.event_name == 'pull_request' && fromJSON(env.run_terraform_steps)
run: |
cd packages/firestore
# Define a temporary file, redirect both stdout and stderr to it
output_file=$(mktemp)
if ! terraform apply -var-file=../../config/project.json -auto-approve > "$output_file" 2>&1 ; then
cat "$output_file"
if cat "$output_file" | grep -q "index already exists"; then
echo "==================================================================================="
echo -e "\e[93m\e[1mTerraform apply failed due to index already exists; We can safely ignore this error.\e[0m"
echo "==================================================================================="
fi
exit 1
fi
rm -f "$output_file"
continue-on-error: true
- name: Set up Node (22)
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # ratchet:actions/setup-node@v4
with:
node-version: 22.12.0
- name: install Chrome stable
run: |
sudo apt-get update
sudo apt-get install google-chrome-stable
- name: Test setup and yarn install
run: yarn
- name: build
run: yarn build:changed firestore-integration
- name: Run tests if firestore or its dependencies has changed
run: yarn test:changed firestore-integration
@@ -1,294 +0,0 @@
# 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: Test Firestore
on:
workflow_dispatch:
pull_request:
permissions:
contents: read
env:
artifactRetentionDays: 14
# Bump Node memory limit
NODE_OPTIONS: "--max_old_space_size=4096"
jobs:
build:
name: Build Firestore
runs-on: ubuntu-latest
outputs:
changed: ${{ steps.set-output.outputs.CHANGED }}
steps:
- name: Checkout Repo
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # ratchet:actions/checkout@v4
with:
# This makes Actions fetch all Git history so run-changed script can diff properly.
fetch-depth: 0
persist-credentials: false
- name: Set up Node (22)
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # ratchet:actions/setup-node@v4
with:
node-version: 22.12.0
- name: install Chrome stable
run: |
sudo apt-get update
sudo apt-get install google-chrome-stable
- name: Test setup and yarn install
run: |
cp config/ci.config.json config/project.json
yarn
- name: build
id: build
run: |
set -o pipefail
yarn build:changed firestore | tee ${{ runner.temp }}/yarn.log.txt
continue-on-error: false
- name: Check if Firestore is changed
id: check-changed
run: egrep "Skipping all" ${{ runner.temp }}/yarn.log.txt
# Continue when "Skipping all" is not found
continue-on-error: true
- name: set output
# This means "Skipping all" was not found
if: steps.check-changed.outcome != 'success'
id: set-output
run: echo "CHANGED=true" >> "$GITHUB_OUTPUT";
- name: Archive build
if: ${{ !cancelled() && steps.build.outcome == 'success' && steps.check-changed.outcome != 'success' }}
run: |
tar -cf build.tar --exclude=.git .
gzip build.tar
- name: Upload build archive
if: ${{ !cancelled() && steps.build.outcome == 'success' && steps.check-changed.outcome != 'success' }}
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # ratchet:actions/upload-artifact@v4
with:
name: build.tar.gz
path: build.tar.gz
retention-days: ${{ env.artifactRetentionDays }}
compat-test-chrome:
name: Test Firestore Compatible
runs-on: ubuntu-latest
needs: build
if: ${{ needs.build.outputs.changed == 'true'}}
steps:
- name: Set up Node (22)
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # ratchet:actions/setup-node@v4
with:
node-version: 22.12.0
- name: install Chrome stable
run: |
sudo apt-get update
sudo apt-get install google-chrome-stable
- name: Download build archive
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # ratchet:actions/download-artifact@v4
with:
name: build.tar.gz
- name: Unzip build artifact
run: tar xf build.tar.gz
- name: Test setup and yarn install
run: cp config/ci.config.json config/project.json
- name: Run compat tests
run: cd packages/firestore-compat && yarn run test:ci
test-chrome:
name: Test Firestore
strategy:
matrix:
test-name: ["assertion-id:check", "test:browser", "test:node:emulator", "test:lite:browser", "test:browser:prod:enterprise", "test:lite:browser:enterprise"]
runs-on: ubuntu-latest
needs: build
if: ${{ needs.build.outputs.changed == 'true'}}
steps:
- name: Set up Node (22)
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # ratchet:actions/setup-node@v4
with:
node-version: 22.12.0
- name: install Chrome stable
run: |
sudo apt-get update
sudo apt-get install google-chrome-stable
- name: Download build archive
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # ratchet:actions/download-artifact@v4
with:
name: build.tar.gz
- name: Unzip build artifact
run: tar xf build.tar.gz
- name: Test setup and yarn install
run: cp config/ci.config.json config/project.json
- name: Run tests
run: cd packages/firestore && yarn run ${{ matrix.test-name }}
env:
EXPERIMENTAL_MODE: true
test-firestore-nightly-with-chrome:
name: Test Nightly Firestore with Chrome
strategy:
matrix:
test-name: ["test:browser:nightly"]
runs-on: ubuntu-latest
needs: build
if: ${{ github.event_name != 'pull_request' }}
steps:
- name: Set up Node (22)
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # ratchet:actions/setup-node@v4
with:
node-version: 22.12.0
- name: install Chrome stable
run: |
sudo apt-get update
sudo apt-get install google-chrome-stable
- name: Download build archive
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # ratchet:actions/download-artifact@v4
with:
name: build.tar.gz
- name: Unzip build artifact
run: tar xf build.tar.gz
- name: Test setup against nightly Firestore
env:
INTEG_TESTS_GOOGLE_SERVICES: ${{ secrets.FIRESTORE_SDK_NIGHTLY_PROJECT_JSON }}
run: |
echo $INTEG_TESTS_GOOGLE_SERVICES > config/project.json
- name: Run tests
run: cd packages/firestore && yarn run ${{ matrix.test-name }}
env:
EXPERIMENTAL_MODE: true
compat-test-firefox:
name: Test Firestore Compatible on Firefox
runs-on: ubuntu-latest
needs: build
if: ${{ needs.build.outputs.changed == 'true'}}
steps:
- name: install Firefox stable
run: npx @puppeteer/browsers install firefox@stable
- name: Set up Node (22)
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # ratchet:actions/setup-node@v4
with:
node-version: 22.12.0
- name: Download build archive
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # ratchet:actions/download-artifact@v4
with:
name: build.tar.gz
- name: Unzip build artifact
run: tar xf build.tar.gz
- name: Test setup and yarn install
run: cp config/ci.config.json config/project.json
- name: Run compat tests
run: cd packages/firestore-compat && xvfb-run yarn run test:ci
env:
BROWSERS: 'Firefox'
test-firefox:
name: Test Firestore on Firefox
strategy:
matrix:
test-name: ["test:browser", "test:node:emulator", "test:lite:browser", "test:browser:prod:enterprise", "test:lite:browser:enterprise"]
runs-on: ubuntu-latest
needs: build
if: ${{ needs.build.outputs.changed == 'true'}}
steps:
- name: install Firefox stable
run: npx @puppeteer/browsers install firefox@stable
- name: Download build archive
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # ratchet:actions/download-artifact@v4
with:
name: build.tar.gz
- name: Unzip build artifact
run: tar xf build.tar.gz
- name: Set up Node (22)
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # ratchet:actions/setup-node@v4
with:
node-version: 22.12.0
- name: Test setup and yarn install
run: cp config/ci.config.json config/project.json
- name: Run tests
run: cd packages/firestore && xvfb-run yarn run ${{ matrix.test-name }}
env:
BROWSERS: 'Firefox'
EXPERIMENTAL_MODE: true
compat-test-webkit:
name: Test Firestore Compatible on Webkit
runs-on: macos-latest
needs: build
if: ${{ needs.build.outputs.changed == 'true'}}
steps:
- name: Set up Node (22)
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # ratchet:actions/setup-node@v4
with:
node-version: 22.12.0
- name: Download build archive
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # ratchet:actions/download-artifact@v4
with:
name: build.tar.gz
- name: Unzip build artifact
run: tar xf build.tar.gz
- name: Test setup
run: |
cp config/ci.config.json config/project.json
npx playwright install webkit
- name: Run compat tests
run: cd packages/firestore-compat && yarn run test:ci
env:
BROWSERS: 'WebkitHeadless'
test-webkit:
name: Test Firestore on Webkit
strategy:
matrix:
# TODO (dlarocque): Add test:travis once the browser tests are isolated
# Exclude test:travis for now, since it includes node tests, which are failing for
# some reason.
test-name: ["test:browser", "test:lite:browser", "test:browser:prod:enterprise", "test:lite:browser:enterprise"]
runs-on: macos-latest
needs: build
if: ${{ needs.build.outputs.changed == 'true'}}
steps:
- name: Download build archive
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # ratchet:actions/download-artifact@v4
with:
name: build.tar.gz
- name: Unzip build artifact
run: tar xf build.tar.gz
- name: Set up Node (22)
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # ratchet:actions/setup-node@v4
with:
node-version: 22.12.0
- name: Test setup
run: |
cp config/ci.config.json config/project.json
npx playwright install webkit
- name: Run tests
run: cd packages/firestore && yarn run ${{ matrix.test-name }}
env:
BROWSERS: 'WebkitHeadless'
EXPERIMENTAL_MODE: true
# A job that fails if any required job in the test matrix fails,
# to be used as a required check for merging.
check-required-tests:
runs-on: ubuntu-latest
if: always()
name: Check all required tests results
needs: [build, test-chrome, compat-test-chrome]
steps:
- name: Check test matrix
if: needs.build.result == 'failure' || needs.test-chrome.result == 'failure' || needs.compat-test-chrome.result == 'failure'
run: exit 1
-62
View File
@@ -1,62 +0,0 @@
# 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: Test @firebase/rules-unit-testing
on: pull_request
permissions:
contents: read
env:
# Bump Node memory limit
NODE_OPTIONS: "--max_old_space_size=4096"
jobs:
test:
name: Test Misc Packages If Changed
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # ratchet:actions/checkout@v4
with:
# This makes Actions fetch all Git history so run-changed script can diff properly.
fetch-depth: 0
persist-credentials: false
- name: Set up Node (22)
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # ratchet:actions/setup-node@v4
with:
node-version: 22.12.0
# firebase-tools has a minimum java version requirement and is called by
# rules-unit-testing tests
- name: Set up Java (22)
uses: actions/setup-java@03ad4de0992f5dab5e18fcb136590ce7c4a0ac95 # v5.6.0
with:
distribution: 'temurin'
java-version: '22'
- name: install Chrome stable
run: |
sudo apt-get update
sudo apt-get install google-chrome-stable
- name: Test setup and yarn install
run: |
cp config/ci.config.json config/project.json
yarn
- name: build
run: yarn build:changed misc
- name: Run tests
run: yarn test:changed misc
env:
FIREBASE_TOKEN: ${{ secrets.FIREBASE_CLI_TOKEN }}
-117
View File
@@ -1,117 +0,0 @@
# 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: Test Modified Packages
on: pull_request
permissions:
contents: read
env:
# Bump Node memory limit
NODE_OPTIONS: "--max_old_space_size=4096"
jobs:
test-chrome:
name: Test Packages With Changed Files in Chrome and Node
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # ratchet:actions/checkout@v4
with:
# This makes Actions fetch all Git history so run-changed script can diff properly.
fetch-depth: 0
persist-credentials: false
- name: Set up Node (22)
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # ratchet:actions/setup-node@v4
with:
node-version: 22.12.0
# firebase-tools has a minimum java version requirement
- name: Set up Java (22)
uses: actions/setup-java@03ad4de0992f5dab5e18fcb136590ce7c4a0ac95 # v5.6.0
with:
distribution: 'temurin'
java-version: '22'
- name: install Chrome stable
run: |
sudo apt-get update
sudo apt-get install google-chrome-stable
- name: Test setup and yarn install
run: |
cp config/ci.config.json config/project.json
yarn
- name: build
run: yarn build:changed core
- name: Run tests on changed packages
run: xvfb-run yarn test:changed core
test-firefox:
name: Test Packages With Changed Files in Firefox
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # ratchet:actions/checkout@v4
with:
fetch-depth: 0
persist-credentials: false
- name: Set up Node (22)
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # ratchet:actions/setup-node@v4
with:
node-version: 22.12.0
- name: install Firefox stable
run: npx @puppeteer/browsers install firefox@stable
- name: Test setup and yarn install
env:
CHROMEDRIVER_SKIP_DOWNLOAD: true
run: |
cp config/ci.config.json config/project.json
yarn
- name: build
run: yarn build:changed core
- name: Run tests on changed packages
run: xvfb-run yarn test:changed core
env:
BROWSERS: 'Firefox'
test-webkit:
name: Test Packages With Changed Files in Webkit
runs-on: macos-latest
steps:
- name: Checkout Repo
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # ratchet:actions/checkout@v4
with:
fetch-depth: 0
persist-credentials: false
- name: Set up Node (22)
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # ratchet:actions/setup-node@v4
with:
node-version: 22.12.0
- name: Test setup and yarn install
env:
CHROMEDRIVER_SKIP_DOWNLOAD: true
run: |
cp config/ci.config.json config/project.json
yarn
npx playwright install webkit
- name: build
run: yarn build:changed core
- name: Run tests on changed packages
run: yarn test:changed core
env:
BROWSERS: 'WebkitHeadless'