Skip to content

Commit

Permalink
test functions and deploy on merge only
Browse files Browse the repository at this point in the history
  • Loading branch information
gregoriopalama committed Mar 7, 2024
1 parent c52dda5 commit 2a3d395
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/deploy-firebase-functions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Build and Deploy Firebase Functions

on:
push:
branches: [ "main", "INFRA18"]
branches: [ "main"]
workflow_dispatch:

jobs:
Expand Down
41 changes: 41 additions & 0 deletions .github/workflows/test-firebase-functions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Test Firebase Functions

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
test:
timeout-minutes: 60
runs-on: ubuntu-latest
env:
FIREBASE_CONFIG: ${{ secrets.FIREBASE_CONFIG }}
FIREBASE_SERVICE_ACCOUNT: ${{ secrets.FIREBASE_SERVICE_ACCOUNT }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- uses: pnpm/action-setup@v2
name: Install pnpm
with:
version: 8
run_install: false
- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v4
name: Setup pnpm cache
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- run: cd functions && pnpm install --no-frozen-lockfile
- run: cd functions && pnpm run build
- run: cd functions && pnpm run test

0 comments on commit 2a3d395

Please sign in to comment.