Skip to content

Add Codecov to CI

Add Codecov to CI #33

Workflow file for this run

name: Testing and update Codecov
on:
push:
branches:
- "*"
pull_request:
branches:
- "*"
jobs:
update-codecov:
environment: prod
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0 # Nécessaire pour récupérer tous les tags
- name: Set up Node.js
uses: actions/setup-node@v1
with:
node-version: "20.x"
- name: Use NPM to install dependencies
uses: actions/setup-node@v1
with:
node-version: "20.x"
- run: npm install
- name: Build application
run: npm run build
- name: Setup Firebase emulator
run: |
curl -sL https://firebase.tools | bash
echo $GCP_SA_KEY > $HOME/gcloud_service_key.json
export GOOGLE_APPLICATION_CREDENTIALS="$HOME/gcloud_service_key.json"
env:
GCP_SA_KEY: ${{ secrets.FIREBASE_SA_KEY }}
- name: Run tests
run: npm run firebase:emulator:ci
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4.0.1
with:
token: ${{ secrets.CODECOV_TOKEN }}
slug: ${{ github.repository }}
file: ./coverage/lcov.info
fail_ci_if_error: true