name: JS Tests

on:
  push:
    branches:
      - develop
      - master
  pull_request:
    types:
      - opened
      - reopened
      - synchronize

jobs:
  js-tests:
    name: JS
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - name: Read .nvmrc
        run: echo "##[set-output name=NVMRC;]$(cat .nvmrc)"
        id: nvm
      - name: Setup Node.js (.nvmrc)
        uses: actions/setup-node@v1
        with:
          node-version: "${{ steps.nvm.outputs.NVMRC }}"
      - name: Cache Node - npm
        uses: actions/cache@v1
        with:
          path: ~/.npm
          key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
          restore-keys: |
            ${{ runner.os }}-node-cache-
      - name: npm install
        run: npm ci
        env:
          PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: true
      - name: Jest Tests
        run: npm run test:js
      - name: Build JS (Production Version, with tests)
        run: npm run build:test
      - name: Bundlesize
        # run: npm run test:bundlesize
        uses: preactjs/compressed-size-action@v2
        with:
          repo-token: "${{ secrets.BUNDLESIZE_GITHUB_TOKEN }}"
          # pattern: "{build/**/*.js,build/**/*.css}"
        # env:
        #   BUNDLESIZE_GITHUB_TOKEN: ${{ secrets.BUNDLESIZE_GITHUB_TOKEN }}
        #   CI_REPO_OWNER: 'google'
        #   CI_REPO_NAME: 'site-kit-wp'
        #   CI_COMMIT_MESSAGE: ${{ github.event.head_commit.message }}
        #   CI_COMMIT_SHA: ${{ github.sha }}

name: JS Tests

on:
  push:
    branches:
      - develop
      - master
  pull_request:
    types:
      - opened
      - reopened
      - synchronize

jobs:
  js-tests:
    name: JS
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - name: Read .nvmrc
        run: echo "##[set-output name=NVMRC;]$(cat .nvmrc)"
        id: nvm
      - name: Setup Node.js (.nvmrc)
        uses: actions/setup-node@v1
        with:
          node-version: "${{ steps.nvm.outputs.NVMRC }}"
      - name: Cache Node - npm
        uses: actions/cache@v1
        with:
          path: ~/.npm
          key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
          restore-keys: |
            ${{ runner.os }}-node-cache-
      - name: npm install
        run: npm ci
        env:
          PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: true
      - name: Jest Tests
        run: npm run test:js
      - name: Build JS (Production Version, with tests)
        run: npm run build:test
      - name: Bundlesize
        uses: preactjs/compressed-size-action@v2
        with:
          repo-token: "${{ secrets.GITHUB_TOKEN }}"

Clear comments in JS build step and switch to main GITHUB_TOKEN.
Clear comments in JS build step and switch to main GITHUB_TOKEN.
