Files
p0tion/.github/workflows/firebase-test.yaml
2023-07-14 16:16:43 +02:00

57 lines
1.5 KiB
YAML

name: Test p0tion
on:
workflow_call:
inputs:
github_ref:
description: 'The branch or tag ref that triggered the workflow'
required: true
type: string
environment:
description: 'Environment to deploy to'
required: true
type: string
firebase_project:
description: 'The name of the Firebase project to test'
required: true
type: string
jobs:
test-p0tion:
runs-on: ubuntu-22.04
environment: ${{ inputs.environment }}
steps:
- uses: actions/checkout@v3
with:
ref: ${{ inputs.github_ref }}
- name: Install npm packages and write env
run: |
yarn install --immutable
echo "${{ secrets.ACTIONS_ENV_FILE }}" > ./packages/actions/.env
echo "${{ secrets.BACKEND_ENV_FILE }}" > ./packages/backend/.env
- name: write Firebase service account key
id: create-json
uses: jsdaniell/create-json@v1.2.1
with:
name: "serviceAccountKey.json"
json: ${{ secrets.SERVICE_ACCOUNT_KEY }}
dir: "./packages/backend/"
- name: run test (unit & e2e)
run: yarn test:ci-prod
env:
GOOGLE_APPLICATION_CREDENTIALS: ./packages/backend/serviceAccountKey.json
NODE_OPTIONS: "--max_old_space_size=4096"
- name: Coveralls
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: ./coverage/lcov.info