add package.json and package-lock.json to src folder. #72
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: Run unit and integration tests | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
unit-and-integration-tests: | |
name: Unit and integration tests | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
shell: bash | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Use Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '18.x' | |
- name: Install dependencies | |
run: | | |
cd extension | |
npm install | |
- name: Build | |
run: | | |
cd extension | |
npm run build --if-present | |
- name: Create serviceAccountKey.json | |
env: | |
SERVICE_ACCOUNT_KEY: ${{ secrets.SERVICE_ACCOUNT_KEY }} | |
run: echo $SERVICE_ACCOUNT_KEY | base64 -di > ./extension/tests/configs/serviceAccountKey.json | |
- name: Run unit tests | |
env: | |
BUCKET_NAME: ${{ secrets.BUCKET_NAME }} | |
CRON_SCHEDULE: ${{ secrets.CRON_SCHEDULE }} | |
PROJECT_ID: ${{ secrets.PROJECT_ID }} | |
run: | | |
cd extension | |
npm run test:unit | |
- name: Run integration tests | |
env: | |
BUCKET_NAME: ${{ secrets.BUCKET_NAME }} | |
CRON_SCHEDULE: ${{ secrets.CRON_SCHEDULE }} | |
PROJECT_ID: ${{ secrets.PROJECT_ID }} | |
run: | | |
cd extension | |
npm run test:integration | |
# - name: Install Firebase CLI | |
# run: | | |
# curl -sL https://firebase.tools | bash | |
# - name: Start Firebase Emulator and run system tests | |
# env: | |
# BUCKET_NAME: ${{ secrets.BUCKET_NAME }} | |
# CRON_SCHEDULE: ${{ secrets.CRON_SCHEDULE }} | |
# PROJECT_ID: ${{ secrets.PROJECT_ID }} | |
# FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }} | |
# run: | | |
# cd extension/tests/system-tests | |
# firebase emulators:exec --project $PROJECT_ID "npm run test:system" |