From 680620eb9e0554e22d58d1ed76bde5a9acbb2909 Mon Sep 17 00:00:00 2001 From: Teo Anastasiadis Date: Thu, 8 Feb 2024 16:24:02 +0200 Subject: [PATCH] chore: update jest.config.json --- .github/workflows/ci.yaml | 29 ++++++++++++++++++++--------- jest.config.json | 2 +- 2 files changed, 21 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 6ecf038..1e746af 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -7,18 +7,10 @@ on: branches: ["main"] jobs: - build: + test_server: runs-on: ubuntu-latest env: NODE_ENV: development - DATABASE_URL: ${{ secrets.DATABASE_URL }} - DEV_DATABASE_URL: ${{ secrets.DEV_DATABASE_URL }} - SALT_ROUNDS: ${{ secrets.SALT_ROUNDS }} - DEV_SALT_ROUNDS: ${{ secrets.DEV_SALT_ROUNDS }} - SENTRY_DSN: ${{ secrets.SENTRY_DSN }} - FACEBOOK_APP_ID: ${{ secrets.FACEBOOK_APP_ID }} - FACEBOOK_APP_SECRET: ${{ secrets.FACEBOOK_APP_SECRET }} - VIBER_BOT_SECRET: ${{ secrets.VIBER_BOT_SECRET }} steps: - uses: actions/checkout@v3 - uses: actions/setup-node@v3 @@ -26,5 +18,24 @@ jobs: node-version: 18 cache: "npm" - run: npm ci + - run: | + touch .env + echo "${{ secrets.ENV_FILE }}" > .env - run: npm run lint - run: npm run test:unit + + deploy_server: + runs-on: ubuntu-latest + needs: test_server + env: + GOOGLE_APPLICATION_CREDENTIALS: google-application-credentials.json + steps: + - uses: actions/checkout@v3 + with: + node-version: 18 + cache: "npm" + - run: npm ci + - run: echo "${{ secrets.ENV_FILE }}" > .env + - run: npm run build:server + - run: echo ${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }} > google-application-credentials.json" + - run: firebase deploy --only functions:auth,functions:data \ No newline at end of file diff --git a/jest.config.json b/jest.config.json index cef2b2a..e8e8871 100644 --- a/jest.config.json +++ b/jest.config.json @@ -9,7 +9,7 @@ ], "coverageDirectory": "./coverage/server", "coverageThreshold": { - "global": { "statements": 98 } + "global": { "statements": 96 } }, "transform": { "^.+\\.[tj]sx?$": [