ci: run tests in the firebase emulator #384
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI Tests | |
on: | |
- pull_request | |
- push | |
env: | |
CI: true | |
jobs: | |
unit: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: | |
- 20.x | |
- 22.x | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: Cache npm | |
uses: actions/cache@v4 | |
with: | |
path: ~/.npm | |
key: ${{ runner.os }}-node-${{ matrix.node-version }}-${{ hashFiles('**/package-lock.json') }} | |
- run: npm install | |
- run: npm run bootstrap | |
- run: npm run lint | |
- run: npm run test | |
- name: Run tests against emulator | |
run: | | |
npm install -g firebase-tools | |
firebase emulators:exec --only database --project fake-project-id 'npm run test' | |
- run: npm run coverage | |
- name: Coveralls | |
uses: coverallsapp/github-action@master | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
path-to-lcov: packages/geofire/coverage/lcov.info |