<commit_before>name: Clippy Test (bors)

on:
  push:
    branches: [auto, try]
    # Don't run tests, when only textfiles were modified
    paths-ignore:
    - 'COPYRIGHT'
    - 'LICENSE-*'
    - '**.md'
    - '**.txt'

env:
  RUST_BACKTRACE: 1
  CARGO_TARGET_DIR: '${{ github.workspace }}/target'
  GHA_CI: 1

jobs:
  changelog:
    runs-on: ubuntu-latest

    steps:
    - uses: rust-lang/simpleinfra/github-actions/cancel-outdated-builds@master
      with:
        github_token: "${{ secrets.github_token }}"
    - name: Checkout
      uses: actions/checkout@v2.0.0
      with:
        ref: ${{ github.ref }}
    - name: Check Changelog
      run: |
        MESSAGE=$(git log --format=%B -n 1)
        PR=$(echo "$MESSAGE" | grep -o "#[0-9]*" | head -1 | sed -e 's/^#//')
        output=$(curl -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" -s "https://api.github.com/repos/rust-lang/rust-clippy/pulls/$PR" | \
          python -c "import sys, json; print(json.load(sys.stdin)['body'])" | \
          grep "^changelog: " | \
          sed "s/changelog: //g")
        if [[ -z "$output" ]]; then
          echo "ERROR: PR body must contain 'changelog: ...'"
          exit 1
        elif [[ "$output" = "none" ]]; then
          echo "WARNING: changelog is 'none'"
        fi
  base:
    needs: changelog
    strategy:
      matrix:
        os: [ubuntu-latest, windows-latest, macos-latest]
        host: [x86_64-unknown-linux-gnu, i686-unknown-linux-gnu, x86_64-apple-darwin, x86_64-pc-windows-msvc]
        exclude:
        - os: ubuntu-latest
          host: x86_64-apple-darwin
        - os: ubuntu-latest
          host: x86_64-pc-windows-msvc
        - os: macos-latest
          host: x86_64-unknown-linux-gnu
        - os: macos-latest
          host: i686-unknown-linux-gnu
        - os: macos-latest
          host: x86_64-pc-windows-msvc
        - os: windows-latest
          host: x86_64-unknown-linux-gnu
        - os: windows-latest
          host: i686-unknown-linux-gnu
        - os: windows-latest
          host: x86_64-apple-darwin

    runs-on: ${{ matrix.os }}

    steps:
    - uses: rust-lang/simpleinfra/github-actions/cancel-outdated-builds@master
      with:
        github_token: "${{ secrets.github_token }}"
    - name: Install dependencies (Linux-i686)<commit_msg>Allow non-ascii characters in changelog check<commit_after>name: Clippy Test (bors)

on:
  push:
    branches: [auto, try]
    # Don't run tests, when only textfiles were modified
    paths-ignore:
    - 'COPYRIGHT'
    - 'LICENSE-*'
    - '**.md'
    - '**.txt'

env:
  RUST_BACKTRACE: 1
  CARGO_TARGET_DIR: '${{ github.workspace }}/target'
  GHA_CI: 1

jobs:
  changelog:
    runs-on: ubuntu-latest

    steps:
    - uses: rust-lang/simpleinfra/github-actions/cancel-outdated-builds@master
      with:
        github_token: "${{ secrets.github_token }}"
    - name: Checkout
      uses: actions/checkout@v2.0.0
      with:
        ref: ${{ github.ref }}
    - name: Check Changelog
      run: |
        MESSAGE=$(git log --format=%B -n 1)
        PR=$(echo "$MESSAGE" | grep -o "#[0-9]*" | head -1 | sed -e 's/^#//')
        output=$(curl -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" -s "https://api.github.com/repos/rust-lang/rust-clippy/pulls/$PR" | \
          python -c "import sys, json; print(json.load(sys.stdin)['body'])" | \
          grep "^changelog: " | \
          sed "s/changelog: //g")
        if [[ -z "$output" ]]; then
          echo "ERROR: PR body must contain 'changelog: ...'"
          exit 1
        elif [[ "$output" = "none" ]]; then
          echo "WARNING: changelog is 'none'"
        fi
      env:
        PYTHONIOENCODING: 'utf-8'
  base:
    needs: changelog
    strategy:
      matrix:
        os: [ubuntu-latest, windows-latest, macos-latest]
        host: [x86_64-unknown-linux-gnu, i686-unknown-linux-gnu, x86_64-apple-darwin, x86_64-pc-windows-msvc]
        exclude:
        - os: ubuntu-latest
          host: x86_64-apple-darwin
        - os: ubuntu-latest
          host: x86_64-pc-windows-msvc
        - os: macos-latest
          host: x86_64-unknown-linux-gnu
        - os: macos-latest
          host: i686-unknown-linux-gnu
        - os: macos-latest
          host: x86_64-pc-windows-msvc
        - os: windows-latest
          host: x86_64-unknown-linux-gnu
        - os: windows-latest
          host: i686-unknown-linux-gnu
        - os: windows-latest
          host: x86_64-apple-darwin

    runs-on: ${{ matrix.os }}

    steps:
    - uses: rust-lang/simpleinfra/github-actions/cancel-outdated-builds@master
      with:
        github_token: "${{ secrets.github_token }}"
    - name: Install dependencies (Linux-i686)
{'fraction_non_alphanumeric': 0.1481323372465315, 'fraction_numerical': 0.02497331910352188, 'mean_word_length': 2.0096339113680153, 'pattern_counts': {'":': 0, '<': 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': '1343308', 'n_tokens_mistral': 1734, 'n_tokens_neox': 1612, 'n_words': 339}