<commit_before>name: CI

on:
  push:
    branches: ['**', '!gh-pages']
  pull_request:
    branches: ['**', '!gh-pages']
  create:
    tags: 'v[0-9]*'

jobs:

  test:
    name: Test on ${{ matrix.os }}
    strategy:
      matrix: { os: [ubuntu-latest] }
    runs-on: ${{ matrix.os }}
    steps:
      - uses: actions/checkout@v2
      - uses: actions/cache@v2
        with:
          path: ~/.npm
          key: ${{ runner.os }}-${{ hashFiles('package.json', 'package-lock.json') }}
          restore-keys: ${{ runner.os }}-
      - uses: actions/setup-node@v2
        with:
          node-version: '16'
      - run: |
          npm install
          xvfb-run --auto-servernum npm test
          npm run lint

  deploy:
    name: Deploy on ${{ matrix.os }}
    needs: test
    if: |
      github.event_name == 'create' &&
      startsWith(github.ref, 'refs/tags/')
    strategy:
      matrix: { os: [ubuntu-latest] }
    runs-on: ${{ matrix.os }}
    steps:
      - uses: actions/checkout@v2
      - uses: actions/cache@v2
        with:
          path: ~/.npm
          key: ${{ runner.os }}-${{ hashFiles('package.json', 'package-lock.json') }}
          restore-keys: ${{ runner.os }}-
      - uses: actions/setup-node@v2
        with:
          node-version: '16'
          registry-url: 'https://registry.npmjs.org'
      - run: |
          npm install
          #npm run dist
          sed -i 's/"private":\ true/"private":\ false/' package.json
          sed -i -E 's/^dist\/?.*$//' .gitignore
          cp -r src/* .
      - run: npm publish
        env:
          NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }}

  benchmark:
    name: Benchmark on ${{ matrix.os }}
    needs: test
    if: |
      github.event_name == 'push' ||
      github.event_name == 'pull_request'
    strategy:
      matrix: { os: [ubuntu-latest] }
    runs-on: ${{ matrix.os }}
    steps:
      - uses: actions/checkout@v2
      - uses: actions/cache@v2
        with:
          path: ~/.npm
          key: ${{ runner.os }}-${{ hashFiles('package.json', 'package-lock.json') }}
          restore-keys: ${{ runner.os }}-
      - uses: actions/setup-node@v2
        with:
          node-version: '16'
      - run: |
          npm install
          xvfb-run --auto-servernum npm run bench<commit_msg>Refactoring<commit_after>name: CI

on:
  push:
    branches: ['**', '!gh-pages']
  pull_request:
    branches: ['**', '!gh-pages']
  create:
    tags: 'v[0-9]*'

jobs:

  test:
    name: Test on ${{ matrix.os }}
    strategy:
      matrix: { os: [ubuntu-latest] }
    runs-on: ${{ matrix.os }}
    steps:
      - uses: actions/checkout@v2
      - uses: actions/cache@v2
        with:
          path: ~/.npm
          key: ${{ runner.os }}-${{ hashFiles('package.json', 'package-lock.json') }}
          restore-keys: ${{ runner.os }}-
      - uses: actions/setup-node@v2
        with:
          node-version: '16'
      - run: |
          npm install
          xvfb-run --auto-servernum npm test
          npm run lint

  deploy:
    name: Deploy on ${{ matrix.os }}
    needs: test
    if: |
      github.event_name == 'create' &&
      startsWith(github.ref, 'refs/tags/')
    strategy:
      matrix: { os: [ubuntu-latest] }
    runs-on: ${{ matrix.os }}
    steps:
      - uses: actions/checkout@v2
      - uses: actions/cache@v2
        with:
          path: ~/.npm
          key: ${{ runner.os }}-${{ hashFiles('package.json', 'package-lock.json') }}
          restore-keys: ${{ runner.os }}-
      - uses: actions/setup-node@v2
        with:
          node-version: '16'
          registry-url: 'https://registry.npmjs.org'
      - run: |
          npm install
          #npm run dist
          sed -i 's/"private":\ true/"private":\ false/' package.json
          sed -i -E 's/^dist\/?.*$//' .gitignore
          cp -r src/* .
      - run: npm publish
        env:
          NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }}

  benchmark:
    name: Benchmark on ${{ matrix.os }}
    needs: test
    if: |
      github.event_name == 'push' ||
      github.event_name == 'pull_request'
    strategy:
      matrix: { os: [ubuntu-latest] }
    runs-on: ${{ matrix.os }}
    steps:
      - uses: actions/checkout@v2
      - uses: actions/cache@v2
        with:
          path: ~/.npm
          key: ${{ runner.os }}-${{ hashFiles('package.json', 'package-lock.json') }}
          restore-keys: ${{ runner.os }}-
      - uses: actions/setup-node@v2
        with:
          node-version: '16'
      - run: |
          npx envinfo -yes
          npm install
          xvfb-run --auto-servernum npm run bench
{'fraction_non_alphanumeric': 0.16779402138337335, 'fraction_numerical': 0.007418721361553567, 'mean_word_length': 1.6917204932472107, 'pattern_counts': {'":': 4, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, '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': '3190803', 'n_tokens_mistral': 1599, 'n_tokens_neox': 1522, 'n_words': 328}