<commit_before>name: CI

# Declare default permissions as read only.
permissions: read-all

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

concurrency:
  group: ${{ github.head_ref || github.run_id }}
  cancel-in-progress: true

jobs:
  inspect-code:
    name: Inspect code
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v3
        with:
          fetch-depth: 2
      - name: Set up Node.js
        uses: actions/setup-node@v3.4.1
        with:
          node-version: 18
      - name: Setup cache for Chromium binary
        uses: actions/cache@v3
        with:
          path: .local-chromium
          key: ${{ runner.os }}-chromium-${{ hashFiles('src/revisions.ts') }}
      - name: Install dependencies
        run: npm ci
      - name: Check code
        run: npm run check
      - name: Lint code
        run: npm run lint
      - name: Lint commits
        run: npm run commitlint
        if: github.event_name != 'pull_request'

  check-docs:
    name: Check documentation
    runs-on: ubuntu-latest
    outputs:
      needs_deploying: ${{ steps.needs_deploying.outputs.value }}
    steps:
      - name: Checkout
        uses: actions/checkout@v3
        with:
          fetch-depth: 2
      - name: Set up Node.js
        uses: actions/setup-node@v3.4.1
        with:
          cache: npm
      - name: Setup cache for Chromium binary
        uses: actions/cache@v3
        with:
          path: .local-chromium
          key: ${{ runner.os }}-chromium-${{ hashFiles('src/revisions.ts') }}
      - name: Install dependencies
        run: npm ci
      - name: Build
        run: npm run docs
      - name: Check if autogenerated docs differ
        run: |
          diff_file=$(mktemp doc_diff_XXXXXX)
          git diff --color > $diff_file
          if [[ -s $diff_file ]]; then
            echo "Please update the documentation by running 'npm run docs'. The following was the diff"
            cat $diff_file
            rm $diff_file
            exit 1
          fi
          rm $diff_file
      - name: Check if docs need to be deployed
        id: needs_deploying
        run: |
          if [[ $(git diff HEAD^ -- ./docs ./website) ]]; then
            needs_deploying=true
          else
            needs_deploying=false
          fi
          echo "::set-output name=value::$needs_deploying"

  deploy-docs:
    needs: check-docs
    name: Deploy docs (if needed)
    if: ${{ needs.check-docs.outputs.needs_deploying == 'true' && github.event_name != 'pull_request' }}
    runs-on: ubuntu-latest
    permissions:
      contents: write
    steps:
      - name: Checkout
        uses: actions/checkout@v3
      - name: Set up Node.js
        uses: actions/setup-node@v3.4.1
        with:
          cache: npm
      - name: Install dependencies
        working-directory: ./website
        run: npm ci
      - name: Build website
        working-directory: ./website
        env:
          NODE_OPTIONS: --max-old-space-size=6144
        run: npm run build
      - name: Deploy to GitHub Pages
        uses: peaceiris/actions-gh-pages@v3
        with:
          github_token: ${{ secrets.GITHUB_TOKEN }}
          publish_dir: ./website/build
          user_name: release-please[bot]
          user_email: 55107282+<EMAIL>[<EMAIL>

  tests:
    name: ${{ matrix.spec.name }} tests on ${{ matrix.spec.machine }}(${{ matrix.spec.node }})
    runs-on: ${{ matrix.spec.machine }}
    strategy:
      matrix:
        spec:
          - name: chrome-headless
            machine: ubuntu-latest
            xvfb: true
            node: 14
            suite: chrome-headless
          - name: chrome-headless
            machine: ubuntu-latest
            xvfb: true
            node: 16
            suite: chrome-headless
          - name: chrome-headless
            machine: ubuntu-latest
            xvfb: true
            node: 18
            suite: chrome-headless
          - name: chrome-headless
            machine: windows-latest
            xvfb: false
            node: 18
            suite: chrome-headless
          - name: chrome-headless
            machine: macos-latest
            xvfb: false
            node: 18
            suite: chrome-headless
          - name: chrome-headful
            machine: ubuntu-latest<commit_msg>chore: add strategy.fail-fast=false (#9007)<commit_after>name: CI

# Declare default permissions as read only.
permissions: read-all

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

concurrency:
  group: ${{ github.head_ref || github.run_id }}
  cancel-in-progress: true

jobs:
  inspect-code:
    name: Inspect code
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v3
        with:
          fetch-depth: 2
      - name: Set up Node.js
        uses: actions/setup-node@v3.4.1
        with:
          node-version: 18
      - name: Setup cache for Chromium binary
        uses: actions/cache@v3
        with:
          path: .local-chromium
          key: ${{ runner.os }}-chromium-${{ hashFiles('src/revisions.ts') }}
      - name: Install dependencies
        run: npm ci
      - name: Check code
        run: npm run check
      - name: Lint code
        run: npm run lint
      - name: Lint commits
        run: npm run commitlint
        if: github.event_name != 'pull_request'

  check-docs:
    name: Check documentation
    runs-on: ubuntu-latest
    outputs:
      needs_deploying: ${{ steps.needs_deploying.outputs.value }}
    steps:
      - name: Checkout
        uses: actions/checkout@v3
        with:
          fetch-depth: 2
      - name: Set up Node.js
        uses: actions/setup-node@v3.4.1
        with:
          cache: npm
      - name: Setup cache for Chromium binary
        uses: actions/cache@v3
        with:
          path: .local-chromium
          key: ${{ runner.os }}-chromium-${{ hashFiles('src/revisions.ts') }}
      - name: Install dependencies
        run: npm ci
      - name: Build
        run: npm run docs
      - name: Check if autogenerated docs differ
        run: |
          diff_file=$(mktemp doc_diff_XXXXXX)
          git diff --color > $diff_file
          if [[ -s $diff_file ]]; then
            echo "Please update the documentation by running 'npm run docs'. The following was the diff"
            cat $diff_file
            rm $diff_file
            exit 1
          fi
          rm $diff_file
      - name: Check if docs need to be deployed
        id: needs_deploying
        run: |
          if [[ $(git diff HEAD^ -- ./docs ./website) ]]; then
            needs_deploying=true
          else
            needs_deploying=false
          fi
          echo "::set-output name=value::$needs_deploying"

  deploy-docs:
    needs: check-docs
    name: Deploy docs (if needed)
    if: ${{ needs.check-docs.outputs.needs_deploying == 'true' && github.event_name != 'pull_request' }}
    runs-on: ubuntu-latest
    permissions:
      contents: write
    steps:
      - name: Checkout
        uses: actions/checkout@v3
      - name: Set up Node.js
        uses: actions/setup-node@v3.4.1
        with:
          cache: npm
      - name: Install dependencies
        working-directory: ./website
        run: npm ci
      - name: Build website
        working-directory: ./website
        env:
          NODE_OPTIONS: --max-old-space-size=6144
        run: npm run build
      - name: Deploy to GitHub Pages
        uses: peaceiris/actions-gh-pages@v3
        with:
          github_token: ${{ secrets.GITHUB_TOKEN }}
          publish_dir: ./website/build
          user_name: release-please[bot]
          user_email: 55107282+release-please[<EMAIL>]@<EMAIL>

  tests:
    name: ${{ matrix.spec.name }} tests on ${{ matrix.spec.machine }}(${{ matrix.spec.node }})
    runs-on: ${{ matrix.spec.machine }}
    strategy:
      fail-fast: false
      matrix:
        spec:
          - name: chrome-headless
            machine: ubuntu-latest
            xvfb: true
            node: 14
            suite: chrome-headless
          - name: chrome-headless
            machine: ubuntu-latest
            xvfb: true
            node: 16
            suite: chrome-headless
          - name: chrome-headless
            machine: ubuntu-latest
            xvfb: true
            node: 18
            suite: chrome-headless
          - name: chrome-headless
            machine: windows-latest
            xvfb: false
            node: 18
            suite: chrome-headless
          - name: chrome-headless
            machine: macos-latest
            xvfb: false
            node: 18
            suite: chrome-headless
          - name: chrome-headful
            machine: ubuntu-latest
{'fraction_non_alphanumeric': 0.09879931389365351, 'fraction_numerical': 0.010062893081761006, 'mean_word_length': 1.6123058542413382, 'pattern_counts': {'":': 2, '<': 7, '<?xml version=': 0, '>': 9, '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': '203896', 'n_tokens_mistral': 2747, 'n_tokens_neox': 2533, 'n_words': 692}