Skip to content
Snippets Groups Projects
config.yml 5.03 KiB
defaults: &defaults
  working_directory: ~/repo

version: 2
jobs:
  lint-testunit:
    <<: *defaults
    docker:
      - image: circleci/node:8

    environment:
      CODECOV_TOKEN: caa771ab-3d45-4756-8e2a-e1f25996fef6

    steps:
      - checkout

      - run:
          name: Install NPM modules
          command: |
            npm install
            npm install codecov

      - run:
          name: Lint
          command: |
            npm run lint

      - run:
          name: Test
          command: |
            npm test

      - run:
          name: Codecov
          command: |
            npx codecov

  android-build:
    <<: *defaults
    docker:
      - image: circleci/android:api-26-alpha

    environment:
      GRADLE_OPTS: -Dorg.gradle.jvmargs="-Xmx2048m -XX:+HeapDumpOnOutOfMemoryError"
      JVM_OPTS: -Xmx2048m
      TERM: dumb
      BASH_ENV: "~/.nvm/nvm.sh"

    steps:
      - checkout

      - run:
          name: Install Node 8
          command: |
            curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.6/install.sh | bash
            source ~/.nvm/nvm.sh
            nvm install 8

      - restore_cache:
          key: node-modules-{{ checksum ".circleci/config.yml" }}-{{ checksum "package.json" }}

      - run:
          name: Install NPM modules
          command: |
            npm install

      - restore_cache:
          key: android-{{ checksum ".circleci/config.yml" }}-{{ checksum "android/build.gradle" }}-{{ checksum  "android/app/build.gradle" }}

      - run: