name: Integration Tests

on:
  push:
    branches:
      - master
      - release/*
  pull_request:

jobs:
  karma:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v2

      - name: Read .nvmrc
        run: echo "##[set-output name=NVMRC;]$(cat .nvmrc)"
        id: nvm

      - name: Setup Node
        uses: actions/setup-node@v1
        with:
          node-version: ${{ steps.nvm.outputs.NVMRC }}

      - name: Setup npm cache
        uses: pat-s/always-upload-cache@v1.1.4
        with:
          path: node_modules
          key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
          restore-keys: |
            ${{ runner.os }}-npm-${{ env.cache-name }}-
            ${{ runner.os }}-npm-
            ${{ runner.os }}-

      - name: Install dependencies
        run: npm ci
        env:
          CI: true

      - name: Run integration tests
        run: npm run test:karma -- --headless --snapshots

      - name: Uplaod Percy snapshots
        env:
          PERCY_TOKEN: ${{ secrets.PERCY_TOKEN }}
        run: npm run percy

name: Integration Tests

on:
  push:
    branches:
      - master
      - release/*
  pull_request:

jobs:
  karma:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v2

      - name: Read .nvmrc
        run: echo "##[set-output name=NVMRC;]$(cat .nvmrc)"
        id: nvm

      - name: Setup Node
        uses: actions/setup-node@v1
        with:
          node-version: ${{ steps.nvm.outputs.NVMRC }}

      - name: Setup npm cache
        uses: pat-s/always-upload-cache@v1.1.4
        with:
          path: node_modules
          key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
          restore-keys: |
            ${{ runner.os }}-npm-${{ env.cache-name }}-
            ${{ runner.os }}-npm-
            ${{ runner.os }}-

      - name: Install dependencies
        run: npm ci
        env:
          CI: true

      - name: Run integration tests
        run: npm run test:karma -- --headless --snapshots
      # Disabled until we have proper license.
      # - name: Uplaod Percy snapshots
      #   env:
      #     PERCY_TOKEN: ${{ secrets.PERCY_TOKEN }}
      #   run: npm run percy

Disable percy until we have the proper license
Disable percy until we have the proper license
