<commit_before>name: CI

on: [push]

env:
  TZ: UTC
  CI: true
  NODE_ENV: ci
  AWS_KEY: ${{ secrets.AWS_KEY }}
  AWS_SECRET: ${{ secrets.AWS_SECRET }}

jobs:
  lint:
    runs-on: ubuntu-latest

    steps:
      - name: Checkout
        uses: actions/checkout@v2-beta

      - name: Setup node
        uses: actions/setup-node@v1
        with:
          node-version: '12.x'

      - name: Restore node_modules
        uses: actions/cache@v1
        id: api-node-modules
        with:
          path: node_modules
          key: ${{ runner.os }}-api-node-modules-${{ hashFiles('package-lock.json') }}

      - name: Restore .npm cache
        if: steps.api-node-modules.outputs.cache-hit != 'true'
        uses: actions/cache@v1
        with:
          path: ~/.npm
          key: ${{ runner.os }}-api-npm-cache-${{ hashFiles('package-lock.json') }}
          restore-keys: |
            - ${{ runner.os }}-api-npm-cache-${{ hashFiles('package-lock.json') }}
            - ${{ runner.os }}-api-npm-cache-

      - name: Install dependencies
        if: steps.api-node-modules.outputs.cache-hit != 'true'
        run: npm ci --prefer-offline --no-audit

      - run: npm run lint:check

  prettier:
    runs-on: ubuntu-latest

    steps:
      - name: Checkout
        uses: actions/checkout@v2-beta

      - name: Setup node
        uses: actions/setup-node@v1
        with:
          node-version: '12.x'

      - name: Restore node_modules
        uses: actions/cache@v1
        id: api-node-modules
        with:
          path: node_modules
          key: ${{ runner.os }}-api-node-modules-${{ hashFiles('package-lock.json') }}

      - name: Restore .npm cache
        if: steps.api-node-modules.outputs.cache-hit != 'true'
        uses: actions/cache@v1
        with:
          path: ~/.npm
          key: ${{ runner.os }}-api-npm-cache-${{ hashFiles('package-lock.json') }}
          restore-keys: |
            - ${{ runner.os }}-api-npm-cache-${{ hashFiles('package-lock.json') }}
            - ${{ runner.os }}-api-npm-cache-

      - name: Install dependencies
        if: steps.api-node-modules.outputs.cache-hit != 'true'
        run: npm ci --prefer-offline --no-audit

      - run: npm run prettier:check

  typescript:
    runs-on: ubuntu-latest

    steps:
      - name: Checkout
        uses: actions/checkout@v2-beta

      - name: Setup node
        uses: actions/setup-node@v1
        with:
          node-version: '12.x'

      - name: Restore node_modules
        uses: actions/cache@v1
        id: api-node-modules
        with:
          path: node_modules
          key: ${{ runner.os }}-api-node-modules-${{ hashFiles('package-lock.json') }}

      - name: Restore .npm cache
        if: steps.api-node-modules.outputs.cache-hit != 'true'
        uses: actions/cache@v1
        with:
          path: ~/.npm
          key: ${{ runner.os }}-api-npm-cache-${{ hashFiles('package-lock.json') }}
          restore-keys: |
            - ${{ runner.os }}-api-npm-cache-${{ hashFiles('package-lock.json') }}
            - ${{ runner.os }}-api-npm-cache-

      - name: Install dependencies
        if: steps.api-node-modules.outputs.cache-hit != 'true'
        run: npm ci --prefer-offline --no-audit

      - run: npm run type:check

  build:
    runs-on: ubuntu-latest

    steps:
      - name: Checkout
        uses: actions/checkout@v2-beta

      - name: Setup node
        uses: actions/setup-node@v1
        with:
          node-version: '12.x'

      - name: Restore node_modules
        uses: actions/cache@v1
        id: api-node-modules
        with:
          path: node_modules
          key: ${{ runner.os }}-api-node-modules-${{ hashFiles('package-lock.json') }}

      - name: Restore .npm cache
        if: steps.api-node-modules.outputs.cache-hit != 'true'
        uses: actions/cache@v1
        with:
          path: ~/.npm
          key: ${{ runner.os }}-api-npm-cache-${{ hashFiles('package-lock.json') }}
          restore-keys: |
            - ${{ runner.os }}-api-npm-cache-${{ hashFiles('package-lock.json') }}
            - ${{ runner.os }}-api-npm-cache-

      - name: Install dependencies
        if: steps.api-node-modules.outputs.cache-hit != 'true'
        run: npm ci --prefer-offline --no-audit

      - name: Cache build
        uses: actions/cache@v1
        with:
          path: dist
          key: ${{ runner.os }}-api-build-${{ github.sha }}

      - name: Build
        run: npm run build

  test:
    runs-on: ubuntu-latest

    services:
      redis:
        image: redis
        ports:
          - 6379:6379
        options: --entrypoint redis-server
      postgres:
        image: mdillon/postgis:9.6
        env:
          POSTGRES_USER: postgres
          POSTGRES_DB: postgres
        ports:
          - 5432:5432
        options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5

    steps:
      - name: Checkout
        uses: actions/checkout@v2-beta

      - name: Setup node
        uses: actions/setup-node@v1
        with:
          node-version: '12.x'

      - name: Restore node_modules
        uses: actions/cache@v1
        id: api-node-modules
        with:
          path: node_modules
          key: ${{ runner.os }}-api-node-modules-${{ hashFiles('package-lock.json') }}

      - name: Restore .npm cache
        if: steps.api-node-modules.outputs.cache-hit != 'true'
        uses: actions/cache@v1
        with:
          path: ~/.npm
          key: ${{ runner.os }}-api-npm-cache-${{ hashFiles('package-lock.json') }}
          restore-keys: |
            - ${{ runner.os }}-api-npm-cache-${{ hashFiles('package-lock.json') }}
            - ${{ runner.os }}-api-npm-cache-

      - name: Install dependencies
        if: steps.api-node-modules.outputs.cache-hit != 'true'
        run: npm ci --prefer-offline --no-audit

      - run: npm run db:setup

      - run: npm run test<commit_msg>ci: run test folders separately<commit_after>name: CI

on: [push]

env:
  TZ: UTC
  CI: true
  NODE_ENV: ci
  AWS_KEY: ${{ secrets.AWS_KEY }}
  AWS_SECRET: ${{ secrets.AWS_SECRET }}

jobs:
  lint:
    runs-on: ubuntu-latest

    steps:
      - name: Checkout
        uses: actions/checkout@v2-beta

      - name: Setup node
        uses: actions/setup-node@v1
        with:
          node-version: '12.x'

      - name: Restore node_modules
        uses: actions/cache@v1
        id: api-node-modules
        with:
          path: node_modules
          key: ${{ runner.os }}-api-node-modules-${{ hashFiles('package-lock.json') }}

      - name: Restore .npm cache
        if: steps.api-node-modules.outputs.cache-hit != 'true'
        uses: actions/cache@v1
        with:
          path: ~/.npm
          key: ${{ runner.os }}-api-npm-cache-${{ hashFiles('package-lock.json') }}
          restore-keys: |
            - ${{ runner.os }}-api-npm-cache-${{ hashFiles('package-lock.json') }}
            - ${{ runner.os }}-api-npm-cache-

      - name: Install dependencies
        if: steps.api-node-modules.outputs.cache-hit != 'true'
        run: npm ci --prefer-offline --no-audit

      - run: npm run lint:check

  prettier:
    runs-on: ubuntu-latest

    steps:
      - name: Checkout
        uses: actions/checkout@v2-beta

      - name: Setup node
        uses: actions/setup-node@v1
        with:
          node-version: '12.x'

      - name: Restore node_modules
        uses: actions/cache@v1
        id: api-node-modules
        with:
          path: node_modules
          key: ${{ runner.os }}-api-node-modules-${{ hashFiles('package-lock.json') }}

      - name: Restore .npm cache
        if: steps.api-node-modules.outputs.cache-hit != 'true'
        uses: actions/cache@v1
        with:
          path: ~/.npm
          key: ${{ runner.os }}-api-npm-cache-${{ hashFiles('package-lock.json') }}
          restore-keys: |
            - ${{ runner.os }}-api-npm-cache-${{ hashFiles('package-lock.json') }}
            - ${{ runner.os }}-api-npm-cache-

      - name: Install dependencies
        if: steps.api-node-modules.outputs.cache-hit != 'true'
        run: npm ci --prefer-offline --no-audit

      - run: npm run prettier:check

  typescript:
    runs-on: ubuntu-latest

    steps:
      - name: Checkout
        uses: actions/checkout@v2-beta

      - name: Setup node
        uses: actions/setup-node@v1
        with:
          node-version: '12.x'

      - name: Restore node_modules
        uses: actions/cache@v1
        id: api-node-modules
        with:
          path: node_modules
          key: ${{ runner.os }}-api-node-modules-${{ hashFiles('package-lock.json') }}

      - name: Restore .npm cache
        if: steps.api-node-modules.outputs.cache-hit != 'true'
        uses: actions/cache@v1
        with:
          path: ~/.npm
          key: ${{ runner.os }}-api-npm-cache-${{ hashFiles('package-lock.json') }}
          restore-keys: |
            - ${{ runner.os }}-api-npm-cache-${{ hashFiles('package-lock.json') }}
            - ${{ runner.os }}-api-npm-cache-

      - name: Install dependencies
        if: steps.api-node-modules.outputs.cache-hit != 'true'
        run: npm ci --prefer-offline --no-audit

      - run: npm run type:check

  build:
    runs-on: ubuntu-latest

    steps:
      - name: Checkout
        uses: actions/checkout@v2-beta

      - name: Setup node
        uses: actions/setup-node@v1
        with:
          node-version: '12.x'

      - name: Restore node_modules
        uses: actions/cache@v1
        id: api-node-modules
        with:
          path: node_modules
          key: ${{ runner.os }}-api-node-modules-${{ hashFiles('package-lock.json') }}

      - name: Restore .npm cache
        if: steps.api-node-modules.outputs.cache-hit != 'true'
        uses: actions/cache@v1
        with:
          path: ~/.npm
          key: ${{ runner.os }}-api-npm-cache-${{ hashFiles('package-lock.json') }}
          restore-keys: |
            - ${{ runner.os }}-api-npm-cache-${{ hashFiles('package-lock.json') }}
            - ${{ runner.os }}-api-npm-cache-

      - name: Install dependencies
        if: steps.api-node-modules.outputs.cache-hit != 'true'
        run: npm ci --prefer-offline --no-audit

      - name: Cache build
        uses: actions/cache@v1
        with:
          path: dist
          key: ${{ runner.os }}-api-build-${{ github.sha }}

      - name: Build
        run: npm run build

  test:
    runs-on: ubuntu-latest

    services:
      redis:
        image: redis
        ports:
          - 6379:6379
        options: --entrypoint redis-server
      postgres:
        image: mdillon/postgis:9.6
        env:
          POSTGRES_USER: postgres
          POSTGRES_DB: postgres
        ports:
          - 5432:5432
        options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5

    steps:
      - name: Checkout
        uses: actions/checkout@v2-beta

      - name: Setup node
        uses: actions/setup-node@v1
        with:
          node-version: '12.x'

      - name: Restore node_modules
        uses: actions/cache@v1
        id: api-node-modules
        with:
          path: node_modules
          key: ${{ runner.os }}-api-node-modules-${{ hashFiles('package-lock.json') }}

      - name: Restore .npm cache
        if: steps.api-node-modules.outputs.cache-hit != 'true'
        uses: actions/cache@v1
        with:
          path: ~/.npm
          key: ${{ runner.os }}-api-npm-cache-${{ hashFiles('package-lock.json') }}
          restore-keys: |
            - ${{ runner.os }}-api-npm-cache-${{ hashFiles('package-lock.json') }}
            - ${{ runner.os }}-api-npm-cache-

      - name: Install dependencies
        if: steps.api-node-modules.outputs.cache-hit != 'true'
        run: npm ci --prefer-offline --no-audit

      - run: npm run db:setup

      - run: npm run test:graphql
      - run: npm run test:lib
      - run: npm run test:models
      - run: npm run test:payment-providers
      - run: npm run test:routes
      - run: npm run test:scripts
{'fraction_non_alphanumeric': 0.1470881863560732, 'fraction_numerical': 0.008818635607321131, 'mean_word_length': 1.7246146872166819, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3708465', 'n_tokens_mistral': 4088, 'n_tokens_neox': 3794, 'n_words': 817}