Skip to content

BO16 - Create an endpoint to list all Sponsorship levels and Sponsors #239

BO16 - Create an endpoint to list all Sponsorship levels and Sponsors

BO16 - Create an endpoint to list all Sponsorship levels and Sponsors #239

name: Test Firebase Functions
on:
pull_request_target:
branches: [main]
jobs:
authorize:
environment:
${{ github.event_name == 'pull_request_target' && github.event.pull_request.head.repo.full_name != github.repository && 'external' || 'internal' }}
runs-on: ubuntu-latest
steps:
- run: true
test:
needs: authorize
timeout-minutes: 60
runs-on: ubuntu-latest
steps:
- uses: actions/github-script@v7
id: pr
with:
script: |
const { data: pullRequest } = await github.rest.pulls.get({
...context.repo,
pull_number: context.payload.pull_request.number,
});
return pullRequest
- uses: actions/checkout@v4
with:
ref: ${{fromJSON(steps.pr.outputs.result).merge_commit_sha}}
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- uses: pnpm/action-setup@v3
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: pnpm install -g firebase-tools
- name: Make envfile for functions
uses: SpicyPizza/[email protected]
with:
envkey_PUBLIC_FIREBASE_CONFIG: ${{ secrets.FIREBASE_CONFIG }}
envkey_PUBLIC_FIREBASE_SERVICE_ACCOUNT: ${{ secrets.FIREBASE_SERVICE_ACCOUNT }}
envkey_PUBLIC_FIREBASE_FUNCTIONS_REGION: ${{ vars.REGION }}
file_name: .env
directory: functions
- name: Make envfile
uses: SpicyPizza/[email protected]
with:
envkey_PUBLIC_FIREBASE_CONFIG: ${{ secrets.FIREBASE_CONFIG }}
envkey_PUBLIC_FIREBASE_SERVICE_ACCOUNT: ${{ secrets.FIREBASE_SERVICE_ACCOUNT }}
envkey_PUBLIC_FIREBASE_FUNCTIONS_REGION: ${{ vars.REGION }}
file_name: .env
- run: cd functions && pnpm run build
- run: cd functions && pnpm run test