Skip to content

Merge branch 'master' into tonyjhuang/secret-location #26025

Merge branch 'master' into tonyjhuang/secret-location

Merge branch 'master' into tonyjhuang/secret-location #26025

Workflow file for this run

name: CI Tests
on:
- pull_request
- push
- merge_group
env:
CI: true
NO_COLOR: true
permissions:
contents: read
concurrency:
# node-test-[pull_request|push]-[branch], typically. Will cancel previous runs that match!
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.head_ref || github.ref_name }}
cancel-in-progress: true
jobs:
lint:
runs-on: ubuntu-latest
if: contains(fromJSON('["pull_request", "merge_group"]'), github.event_name)
strategy:
matrix:
node-version:
- "20"
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: npm
cache-dependency-path: npm-shrinkwrap.json
- run: npm i -g npm@9.5
- run: npm ci
- run: npm run lint:changed-files
unit:
runs-on: ubuntu-latest
strategy:
matrix:
node-version:
- "18"
- "20"
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: npm
cache-dependency-path: npm-shrinkwrap.json
- run: npm i -g npm@9.5
- run: npm ci
- run: npm test -- -- --forbid-only
- uses: codecov/codecov-action@v3
if: matrix.node-version == '20'
integration:
needs: unit
if: contains(fromJSON('["push", "merge_group"]'), github.event_name)
runs-on: ubuntu-latest
env:
FIREBASE_EMULATORS_PATH: ${{ github.workspace }}/emulator-cache
COMMIT_SHA: ${{ github.sha }}
CI_JOB_ID: ${{ github.action }}
FBTOOLS_TARGET_PROJECT: ${{ secrets.FBTOOLS_TARGET_PROJECT }}
FBTOOLS_CLIENT_INTEGRATION_SITE: ${{ secrets.FBTOOLS_CLIENT_INTEGRATION_SITE }}
CI_RUN_ID: ${{ github.run_id }}
CI_RUN_ATTEMPT: ${{ github.run_attempt }}
strategy:
fail-fast: false
matrix:
node-version:
- "20"
script:
- npm run test:client-integration
- npm run test:emulator
- npm run test:extensions-emulator
- npm run test:frameworks
- npm run test:functions-discover
- npm run test:hosting
# - npm run test:hosting-rewrites # Long-running test that might conflict across test runs. Run this manually.
- npm run test:import-export
- npm run test:storage-deploy
- npm run test:storage-emulator-integration
- npm run test:triggers-end-to-end
- npm run test:triggers-end-to-end:inspect
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: npm
cache-dependency-path: npm-shrinkwrap.json
- name: Cache firebase emulators
uses: actions/cache@v3
with:
path: ${{ env.FIREBASE_EMULATORS_PATH }}
key: ${{ runner.os }}-firebase-emulators-${{ hashFiles('emulator-cache/**') }}
continue-on-error: true
- run: npm i -g npm@9.5
- run: npm ci
- run: echo ${{ secrets.service_account_json_base64 }} | base64 -d > ./scripts/service-account.json
- run: ${{ matrix.script }}
- name: Print debug logs
if: failure()
run: find . -type f -name "*debug.log" | xargs cat
integration-windows:
needs: unit
if: contains(fromJSON('["push", "merge_group"]'), github.event_name)
runs-on: windows-latest
env:
FIREBASE_EMULATORS_PATH: ${{ github.workspace }}/emulator-cache
COMMIT_SHA: ${{ github.sha }}
CI_JOB_ID: ${{ github.action }}
FBTOOLS_TARGET_PROJECT: ${{ secrets.FBTOOLS_TARGET_PROJECT }}
FBTOOLS_CLIENT_INTEGRATION_SITE: ${{ secrets.FBTOOLS_CLIENT_INTEGRATION_SITE }}
CI_RUN_ID: ${{ github.run_id }}
CI_RUN_ATTEMPT: ${{ github.run_attempt }}
strategy:
fail-fast: false
matrix:
node-version:
- "20"
script:
- npm run test:hosting
# - npm run test:hosting-rewrites # Long-running test that might conflict across test runs. Run this manually.
- npm run test:client-integration
- npm run test:emulator
# - npm run test:import-export # Fails becuase port 4000 is taken after first run - hub not shutting down?
# - npm run test:extensions-emulator # Fails due to cannot find module sharp (not waiting for npm install?)
- npm run test:functions-discover
# - npm run test:triggers-end-to-end
- npm run test:triggers-end-to-end:inspect
- npm run test:storage-deploy
# - npm run test:storage-emulator-integration
steps:
- name: Setup Java JDK
uses: actions/setup-java@v3.3.0
with:
java-version: 17
distribution: temurin
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: npm
cache-dependency-path: npm-shrinkwrap.json
- name: Cache firebase emulators
uses: actions/cache@v3
with:
path: ${{ env.FIREBASE_EMULATORS_PATH }}
key: ${{ runner.os }}-firebase-emulators-${{ hashFiles('emulator-cache/**') }}
continue-on-error: true
- run: echo ${{ secrets.service_account_json_base64 }} > tmp.txt
- run: certutil -decode tmp.txt scripts/service-account.json
- run: npm i -g npm@9.5
- run: npm ci
- run: ${{ matrix.script }}
- name: Print debug logs
if: failure()
run: type *debug.log
check-package-lock:
runs-on: ubuntu-latest
strategy:
matrix:
node-version:
- "20"
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- run: npm i -g npm@9.5
# --ignore-scripts prevents the `prepare` script from being run.
- run: npm install --package-lock-only --ignore-scripts
- run: "git diff --exit-code -- npm-shrinkwrap.json || (echo 'Error: npm-shrinkwrap.json is changed during npm install! Please make sure to use npm >= 8 and commit npm-shrinkwrap.json.' && false)"
check-package-lock-vsce:
runs-on: ubuntu-latest
strategy:
matrix:
node-version:
- "20"
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- run: npm i -g npm@9.5
# --ignore-scripts prevents the `prepare` script from being run.
- run: "(cd firebase-vscode && npm install --package-lock-only --ignore-scripts)"
- run: "git diff --exit-code -- firebase-vscode/package-lock.json || (echo 'Error: firebase-vscode/package-lock.json is changed during npm install! Please make sure to use npm >= 8 and commit firebase-vscode/package-lock.json.' && false)"
check-json-schema:
runs-on: ubuntu-latest
strategy:
matrix:
node-version:
- "20"
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: npm
cache-dependency-path: npm-shrinkwrap.json
- run: npm install
- run: npm run generate:json-schema
- run: "git diff --exit-code -- schema/*.json || (echo 'Error: JSON schema is changed! Please run npm run generate:json-schema and commit the results.' && false)"