<commit_before>name: Node CI

on:
  push:
    branches:
      - master
  pull_request:
    branches:
      - '**'

jobs:
  cleanup-runs:
    runs-on: ubuntu-latest
    steps:
      - uses: rokroskar/workflow-run-cleanup-action@master
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
    if: "!startsWith(github.ref, 'refs/tags/') && github.ref != 'refs/heads/master'"

  lint-and-typecheck:
    name: Running TypeScript compiler & ESLint
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v2
      - name: Get yarn cache
        id: yarn-cache
        run: echo "::set-output name=dir::$(yarn cache dir)"
      - uses: actions/cache@v1
        with:
          path: ${{ steps.yarn-cache.outputs.dir }}
          key: ubuntu-latest-node-12.x-yarn-${{ hashFiles('**/yarn.lock') }}
          restore-keys: |
            ubuntu-latest-node-12.x-yarn-
      - uses: actions/setup-node@v1
        with:
          node-version: 12.x
      - name: install
        run: yarn install-no-ts-build
      - name: build
        run: node scripts/build.js
      - name: run tsc
        run: yarn build:ts
      - name: verify TypeScript@3.8 compatibility
        run: yarn verify-old-ts
      - name: run eslint
        run: yarn lint
      - name: run prettier
        run: yarn lint:prettier:ci
      - name: check copyright headers
        run: yarn check-copyright-headers
  test:
    name: Node v${{ matrix.node-version }} on ${{ matrix.os }}
    strategy:
      fail-fast: false
      matrix:
        node-version: [10.x, 12.x, 13.x, 14.x]
        os: [ubuntu-latest, macOS-latest, windows-latest]
    runs-on: ${{ matrix.os }}

    steps:
      - name: Set git config
        shell: bash
        run: |
          git config --global core.autocrlf false
          git config --global core.symlinks true
        if: runner.os == 'Windows'
      - uses: actions/checkout@v2
      - name: Get yarn cache
        id: yarn-cache
        run: echo "::set-output name=dir::$(yarn cache dir)"
      - uses: actions/cache@v1
        with:
          path: ${{ steps.yarn-cache.outputs.dir }}
          key: ${{ runner.os }}-node-${{ matrix.node-version }}-yarn-${{ hashFiles('**/yarn.lock') }}
          restore-keys: |
            ${{ runner.os }}-node-${{ matrix.node-version }}-yarn-
      - name: Use Node.js ${{ matrix.node-version }}
        uses: actions/setup-node@v1
        with:
          node-version: ${{ matrix.node-version }}
      - name: install
        run: yarn install-no-ts-build
      - name: run tests
        run: yarn test-ci-partial
        env:
          CI: true<commit_msg>chore(deps): bump actions/cache from v1 to v2 (#10245)<commit_after>name: Node CI

on:
  push:
    branches:
      - master
  pull_request:
    branches:
      - '**'

jobs:
  cleanup-runs:
    runs-on: ubuntu-latest
    steps:
      - uses: rokroskar/workflow-run-cleanup-action@master
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
    if: "!startsWith(github.ref, 'refs/tags/') && github.ref != 'refs/heads/master'"

  lint-and-typecheck:
    name: Running TypeScript compiler & ESLint
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v2
      - name: Get yarn cache
        id: yarn-cache
        run: echo "::set-output name=dir::$(yarn cache dir)"
      - uses: actions/cache@v2
        with:
          path: ${{ steps.yarn-cache.outputs.dir }}
          key: ubuntu-latest-node-12.x-yarn-${{ hashFiles('**/yarn.lock') }}
          restore-keys: |
            ubuntu-latest-node-12.x-yarn-
      - uses: actions/setup-node@v1
        with:
          node-version: 12.x
      - name: install
        run: yarn install-no-ts-build
      - name: build
        run: node scripts/build.js
      - name: run tsc
        run: yarn build:ts
      - name: verify TypeScript@3.8 compatibility
        run: yarn verify-old-ts
      - name: run eslint
        run: yarn lint
      - name: run prettier
        run: yarn lint:prettier:ci
      - name: check copyright headers
        run: yarn check-copyright-headers
  test:
    name: Node v${{ matrix.node-version }} on ${{ matrix.os }}
    strategy:
      fail-fast: false
      matrix:
        node-version: [10.x, 12.x, 13.x, 14.x]
        os: [ubuntu-latest, macOS-latest, windows-latest]
    runs-on: ${{ matrix.os }}

    steps:
      - name: Set git config
        shell: bash
        run: |
          git config --global core.autocrlf false
          git config --global core.symlinks true
        if: runner.os == 'Windows'
      - uses: actions/checkout@v2
      - name: Get yarn cache
        id: yarn-cache
        run: echo "::set-output name=dir::$(yarn cache dir)"
      - uses: actions/cache@v2
        with:
          path: ${{ steps.yarn-cache.outputs.dir }}
          key: ${{ runner.os }}-node-${{ matrix.node-version }}-yarn-${{ hashFiles('**/yarn.lock') }}
          restore-keys: |
            ${{ runner.os }}-node-${{ matrix.node-version }}-yarn-
      - name: Use Node.js ${{ matrix.node-version }}
        uses: actions/setup-node@v1
        with:
          node-version: ${{ matrix.node-version }}
      - name: install
        run: yarn install-no-ts-build
      - name: run tests
        run: yarn test-ci-partial
        env:
          CI: true
{'fraction_non_alphanumeric': 0.13852567746825847, 'fraction_numerical': 0.009664582148948267, 'mean_word_length': 1.833064949006978, 'pattern_counts': {'":': 4, '<': 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': '3368107', 'n_tokens_mistral': 1806, 'n_tokens_neox': 1704, 'n_words': 406}