<commit_before>name: CI

on:
  push:
    branches: [ master ]
  pull_request:
    branches: [ master ]

  workflow_dispatch:

jobs:
  build:
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v2

      - name: Setup node
        uses: actions/setup-node@v2

      - name: Get yarn cache directory path
        id: yarn-cache-dir-path
        run: echo "::set-output name=dir::$(yarn cache dir)"

      - uses: actions/cache@v2
        id: yarn-cache
        with:
          path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
          key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
          restore-keys: |
            ${{ runner.os }}-yarn-

      - name: Node check
        run: find . -name "*.js" -type f -not -path "./node_modules/*" -not -path "./\.*" -exec node --check {} \;

      - name: Lint
        run: yarn && yarn lint

  test:
    needs: [build]
    strategy:
      matrix:
        os:
          - "ubuntu-latest"
        node:
          - "18"
          - "16"
          - "14"
          - "12"
          - "10"
    name: Node.js ${{ matrix.node }} on ${{ matrix.os }}
    runs-on: ${{ matrix.os }}
    steps:
      - uses: actions/checkout@v2

      - name: Setup node
        uses: actions/setup-node@v2
        with:
          node-version: ${{ matrix.node }}

      - name: Print Node.js version
        run: node -v

      - name: Get yarn cache directory path
        id: yarn-cache-dir-path
        run: echo "::set-output name=dir::$(yarn cache dir)"

      - uses: actions/cache@v2
        id: yarn-cache
        with:
          path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
          key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
          restore-keys: |
            ${{ runner.os }}-yarn-

      - name: Start stripe-mock
        run: docker run -d -p 12111-12112:12111-12112 stripe/stripe-mock && sleep 5

      - name: Test
        run: yarn && yarn test<commit_msg>Add node release action (#1399)<commit_after>name: CI

on:
  workflow_dispatch: {}
  push:
    branches: [ master ]
    tags:
      - v[0-9]+.[0-9]+.[0-9]+*
  pull_request:
    branches: [ master ]


jobs:
  build:
    name: Build and test
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v2

      - name: Setup node
        uses: actions/setup-node@v2

      - name: Get yarn cache directory path
        id: yarn-cache-dir-path
        run: echo "::set-output name=dir::$(yarn cache dir)"

      - uses: actions/cache@v2
        id: yarn-cache
        with:
          path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
          key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
          restore-keys: |
            ${{ runner.os }}-yarn-

      - name: Node check
        run: find . -name "*.js" -type f -not -path "./node_modules/*" -not -path "./\.*" -exec node --check {} \;

      - name: Lint
        run: yarn && yarn lint

  test:
    needs: [build]
    strategy:
      matrix:
        os:
          - "ubuntu-latest"
        node:
          - "18"
          - "16"
          - "14"
          - "12"
          - "10"
    name: Node.js ${{ matrix.node }} on ${{ matrix.os }}
    runs-on: ${{ matrix.os }}
    steps:
      - uses: actions/checkout@v2

      - name: Setup node
        uses: actions/setup-node@v2
        with:
          node-version: ${{ matrix.node }}

      - name: Print Node.js version
        run: node -v

      - name: Get yarn cache directory path
        id: yarn-cache-dir-path
        run: echo "::set-output name=dir::$(yarn cache dir)"

      - uses: actions/cache@v2
        id: yarn-cache
        with:
          path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
          key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
          restore-keys: |
            ${{ runner.os }}-yarn-

      - name: Start stripe-mock
        run: docker run -d -p 12111-12112:12111-12112 stripe/stripe-mock && sleep 5

      - name: Test
        run: yarn && yarn test

  publish:
    name: Publish
    if: (((github.event_name == 'workflow_dispatch')) && (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/v')) && endsWith(github.actor, '-stripe'))
    needs: [build]
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - run: sudo apt-get install -y oathtool
      - name: Publish to NPM
        run: |
          set +x
          echo "Preparing .npmrc"
          echo '//registry.npmjs.org/:_authToken=$NPM_AUTH_TOKEN' > .npmrc
          echo 'registry=https://registry.npmjs.org' >> .npmrc
          npm publish --otp="$(oathtool -b --totp $NPM_OTP)"
        env:
          NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
          NPM_OTP: ${{ secrets.NPM_OTP }}
{'fraction_non_alphanumeric': 0.15690420807781771, 'fraction_numerical': 0.017974201733981815, 'mean_word_length': 1.667794698251551, 'pattern_counts': {'":': 4, '<': 3, '<?xml version=': 0, '>': 6, 'https://': 1, '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': '7026993', 'n_tokens_mistral': 1690, 'n_tokens_neox': 1562, 'n_words': 375}