From 16e522d7df0c6ad3f43ee313cfd76246408ec4fd Mon Sep 17 00:00:00 2001 From: Sawyer Hollenshead Date: Mon, 26 Dec 2022 15:29:01 -0800 Subject: [PATCH] Add CI for Firebase directory (#72) --- .github/workflows/ci-email-importer.yml | 4 ++ .github/workflows/ci-firebase.yml | 49 +++++++++++++++++++++++++ 2 files changed, 53 insertions(+) create mode 100644 .github/workflows/ci-firebase.yml diff --git a/.github/workflows/ci-email-importer.yml b/.github/workflows/ci-email-importer.yml index f510f09b..d9eaf18d 100644 --- a/.github/workflows/ci-email-importer.yml +++ b/.github/workflows/ci-email-importer.yml @@ -3,8 +3,12 @@ name: CI (email-importer) on: push: branches: [main] + paths: + - aws/email-importer/** pull_request: branches: [main] + paths: + - aws/email-importer/** workflow_dispatch: defaults: diff --git a/.github/workflows/ci-firebase.yml b/.github/workflows/ci-firebase.yml new file mode 100644 index 00000000..67191f23 --- /dev/null +++ b/.github/workflows/ci-firebase.yml @@ -0,0 +1,49 @@ +name: CI (firebase) + +on: + push: + branches: [main] + paths: + - firebase/functions/** + pull_request: + branches: [main] + paths: + - firebase/functions/** + workflow_dispatch: + +defaults: + run: + working-directory: firebase/functions + +concurrency: + group: ci-firebase + cancel-in-progress: true + +jobs: + test: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: 18 + cache: npm + cache-dependency-path: firebase/functions/package-lock.json + - name: Setup Firebase CLI + run: npm install -g firebase-tools + - run: npm ci + name: Install dependencies + + - name: Setup Firebase service account + run: echo "$SERVICE_ACCOUNT" > secrets/test-service-account.json + env: + SERVICE_ACCOUNT: "${{ secrets.TEST_FIREBASE_SERVICE_ACCOUNT }}" + + - name: Setup Firebase app + run: echo "$FIREBASE_APP" > secrets/test-app.json + env: + FIREBASE_APP: "${{ secrets.TEST_FIREBASE_APP }}" + + - run: npm test + name: Run tests