shootismoke/webapp

View on GitHub
.github/workflows/pr.yml

Summary

Maintainability
Test Coverage
name: ci

on:
    push:
        branches:
            - master
    pull_request_target:

jobs:
    lint:
        runs-on: ubuntu-latest
        steps:
            - uses: actions/checkout@v2
            - run: yarn install
            - run: yarn lint

    # Dry-run the email reporting script.
    test-email:
        runs-on: ubuntu-latest
        steps:
            - uses: actions/checkout@v2
            - name: Install Dependencies
              run: yarn install
            - name: Start MongoDB
              uses: supercharge/mongodb-github-action@1.3.0
              with:
                  mongodb-version: 4.4
            - run: yarn ts-node -P scripts/tsconfig.json scripts/email.ts
              env:
                  DEBUG: shootismoke:*
                  BACKEND_AQICN_TOKEN: ${{ secrets.AQICN_TOKEN }}
                  BACKEND_MAILGUN_API_KEY: ${{ secrets.STAGING_BACKEND_MAILGUN_API_KEY }}
                  BACKEND_MAILGUN_DOMAIN: ${{ secrets.STAGING_BACKEND_MAILGUN_DOMAIN }}
                  BACKEND_MONGODB_ATLAS_URI: mongodb://localhost/shootismoke

    # Dry-run the expo reporting script.
    test-expo:
        runs-on: ubuntu-latest
        steps:
            - uses: actions/checkout@v2
            - name: Install Dependencies
              run: yarn install
            - name: Start MongoDB
              uses: supercharge/mongodb-github-action@1.3.0
              with:
                  mongodb-version: 4.4
            - run: yarn ts-node -P scripts/tsconfig.json scripts/expo.ts
              env:
                  DEBUG: shootismoke:*
                  BACKEND_AQICN_TOKEN: ${{ secrets.AQICN_TOKEN }}
                  BACKEND_MONGODB_ATLAS_URI: mongodb://localhost/shootismoke

    test-unit:
        runs-on: ubuntu-latest
        steps:
            - uses: actions/checkout@v2
            - name: Install Dependencies
              run: yarn install
            - name: Run unit test
              run: yarn test:unit

    test-coverage:
        runs-on: ubuntu-latest
        steps:
            - uses: actions/checkout@v2
            - name: Start MongoDB
              uses: supercharge/mongodb-github-action@1.3.0
              with:
                  mongodb-version: 4.4
            - name: Install Dependencies
              run: yarn install
            - name: Run server, test and generate coverage report
              run: |
                  cp .env.example .env
                  yarn dev &
                  sleep 10
                  yarn test --coverage